Repository navigation
Manage dependencies in dependencies.conf and migrate to the sbt-ci stack - #291
Merged
Merged
Conversation
Adds sbt-dependencies to the meta-build and moves every dependency declaration into project/dependencies.conf: the library dependencies, the sbt plugins as the sbt-build group, and the Scala versions as common-settings. project/plugins.sbt and project/Dependencies.scala are no longer needed. sbt-dependencies requires sbt 1.12.15, which brings two forced changes. Its SIP-51 check rejects Scala 2.13.8 against the 2.13.10 scala-library the dependencies pull in, so 2.13 moves to 2.13.17 and Scala 3 to 3.3.7. Scala 2.12.16 is dropped: it cannot build a compiler bridge on a current JDK, and the artifact was already the least used cross-version. The kind-projector and better-monadic-for compiler plugins go with it. Neither is needed to compile the sources on 2.13 or 3.
Replaces the hand-written build with generated tooling: sbt-modules defines the module, sbt-ci owns the CI files and the publishing metadata, sbt-fix covers formatting, scalafix and headers, and sbt-ci-release with sbt-version-policy drives tag-based releases in place of sbt-ci-release-early. Everything derived from the GitHub repository disappears from the build: the root aggregate, publish settings, licenses, developers, homepage, scmInfo, versionScheme and the whole githubWorkflow block, so ci-release.sbt is gone. Scalac options come from sbt-tpolecat and .scalafmt.conf is downloaded at build time by sbt-scalafmt-defaults. The module directory is renamed to match the name sbt-modules derives from the project. The published artifact id is unchanged. Scala 2.13 moves to 2.13.18 because the mdoc documentation project pulls in a scala-library that SIP-51 refuses to pair with an older compiler. versionPolicyIntention starts at Compatibility.None because dropping Scala 2.12 is a breaking change.
Runs `updateAllDependencies`, which moves the build plugins and Scala versions forward and takes trace4cats to 0.14.7 and fs2-kafka to 4.0.0. fs2-kafka also changed organization, from com.github.fd4s to org.typelevel. fs2-kafka 4.0.0 removes the public constructors this module relied on. `CommittableOffset` can no longer be built outside fs2.kafka, so `TracedConsumer.injectK` cannot rebuild a record in the tracing effect, and `KafkaProducer` absorbed the transactional methods, two of which a wrapper cannot implement without a transformation back to the underlying effect. Both are written out as they will look once typelevel/fs2-kafka#1522 adds `mapK` and `imapK`, and commented out with a pointer to it, so they can be restored and released as soon as that is merged and released. `Timestamp` also dropped `createTime` and `logAppendTime` in favour of subtypes, so the span attributes now match on those.
Applies `sbt fix`, which uses the .scalafmt.conf and .scalafix.conf that sbt-scalafmt-defaults and sbt-scalafix-defaults download at build time. One import per line, four-space continuation indents and aligned tuple arrows are the visible differences. No behaviour change.
Replaces the sbt-github-actions workflows with the ones sbt-ci generates, which run the ci-test, ci-docs and ci-publish aliases and pin every action by SHA. The JDK matrix becomes 17, 21 and 25. Drops the configuration the old setup needed: the artifact-cleanup workflow, release-drafter, whose job sbt-ci covers with .github/release.yml, mergify, whose steward auto-merge is now a CI job and whose check-name regexes no longer matched the generated workflow, and dependabot, which only existed to ignore the actions sbt-github-actions managed. The generated .gitignore excludes the scalafmt and scalafix configs that are downloaded at build time. Note the release workflow pushes to `main`, so the default branch needs renaming from `master`.
README.md and LICENSE.md are now rendered by sbt-github-mdoc and sbt-github-header from templates under .github/docs, so the coordinates, version, supported Scala versions and copyright stay in step with the build and the repository instead of being edited by hand. The README also gains a usage snippet, which mdoc compiles against the module on every CI run. The MIT text moves into the template with the year range and copyright owner as placeholders; sbt-ci had generated an Apache 2.0 one, which is the wrong licence for this repository. headerCreateAll adds the MIT header to every source file, which none of them carried. CODE_OF_CONDUCT.md and CONTRIBUTING.md go, as the README covers contributing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💻 How to review this PR?
This PR was created with the idea of being reviewed commit by commit. Each commit contains an incremental change that makes it easier to review. Also some of the commits contain additional information in their description to help understand why the change was made.
I also recommend checking "Hide whitespace" when reviewing this PR!
🚀 What's included in this PR?
Modernises the build: dependencies live in a single HOCON file, and the CI files, README, LICENSE and publishing metadata are generated rather than maintained by hand. It also updates every dependency, which is where this gets interesting.
CommittableOffsetcan no longer be constructed outsidefs2.kafka, soTracedConsumer.injectKcannot rebuild a record in the tracing effect.KafkaProduceralso absorbed the transactional methods, two of which a wrapper cannot implement without a transformation back to the underlying effect, which breaksTracedProducer.create.Both are written out as they will look once the new API exists and are commented out with a pointer to typelevel/fs2-kafka#1522, which adds
mapKandimapK. They should be uncommented and released as soon as that PR is merged and released. The plan in the meantime is to publish an RC.Timestampalso droppedcreateTimeandlogAppendTimein favour of subtypes, so the span attributes now match on those. Theconsumer.groupattribute is gone withCommittableOffset.consumerGroupId.Scala 2.12 is dropped as well: it cannot build a compiler bridge on a current JDK. The published artifact id is unchanged.