Skip to content

Manage dependencies in dependencies.conf and migrate to the sbt-ci stack - #291

Merged
alejandrohdezma merged 6 commits into
mainfrom
build/adopt-sbt-ci
Sep 14, 2026
Merged

alejandrohdezma merged 6 commits into
mainfrom
build/adopt-sbt-ci

Conversation

@alejandrohdezma

Copy link
Copy Markdown
Member

💻 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.

⚠️ fs2-kafka 4.0.0 removes API this module depends on

CommittableOffset can no longer be constructed outside fs2.kafka, so TracedConsumer.injectK cannot rebuild a record in the tracing effect. KafkaProducer also absorbed the transactional methods, two of which a wrapper cannot implement without a transformation back to the underlying effect, which breaks TracedProducer.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 mapK and imapK. 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.

Timestamp also dropped createTime and logAppendTime in favour of subtypes, so the span attributes now match on those. The consumer.group attribute is gone with CommittableOffset.consumerGroupId.

Scala 2.12 is dropped as well: it cannot build a compiler bridge on a current JDK. The published artifact id is unchanged.

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.
@github-actions github-actions Bot added 🔧 build Changes to the build ⚖️ XL Size of PR between 1000 and 2000 lines labels Sep 14, 2026
@alejandrohdezma
alejandrohdezma merged commit 24fac86 into main Sep 14, 2026
5 of 7 checks passed
@alejandrohdezma
alejandrohdezma deleted the build/adopt-sbt-ci branch September 14, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚖️ XL Size of PR between 1000 and 2000 lines 🔧 build Changes to the build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant