Skip to content

Unify CI pipelines across Scala repositories #5

Open

Description

@stasimus

All Scala repositories hand-roll their own ci.yml. That means every sbt/scoverage/coverage trap has
to be rediscovered per repo, and quality gates differ silently between projects. Tracking the move to
a single shared pipeline here.

Steps

  1. Add a reusable ci.yml (done, Add reusable Scala CI workflow #3) — tests, coverage → Coveralls, binary compatibility,
    scalafmt, scaladoc. Coverage build runs before other compiles and sbt/setup-sbt disk cache is
    disabled while coverage is on, because sbt 2's compile cache is not keyed on scoverage
    instrumentation and would otherwise yield a silently empty report. Gates run as explicit sbt tasks
    rather than through a per-repo check alias, which can be (and is) stubbed to show version.
  2. Pilot on two repos of different shapes (done) — Adopt shared Scala CI workflow smetrics#450 (sbt 2) and
    Adopt shared Scala CI workflow cats-helper#397 (sbt 1, stubbed check).
  3. Starter workflows for new repos — Add Scala starter workflows .github#7 adds workflow-templates/ so new
    repos get the shared CI and release workflows offered by default.
  4. Roll out to the remaining active public Scala libraries as thin caller files.
  5. Optionally enforce with a workflows ruleset rule, the same mechanism the AI Policy Check
    already uses, plus a documented exclude list.

Known gaps

  • Binary-compatibility checking is vacuous wherever CI checks out shallow: sbt-dynver reports 0.0.0
    so there is no previous version to compare against. The shared workflow uses fetch-depth: 0, which
    means adopting it can surface real pre-existing incompatibilities.
  • SonarQube Cloud analysis is inconsistent across the org and is being handled separately.

Rollout PRs

Not included

  • sequentially uses sbt-projectmatrix and so has no ++ cross-build; the shared workflow needs an input for that first.
  • metered-scaffeine publishes without sbt-dynver or the Artifactory plugin.
  • The Maven Central publishers, non-libraries and the stale set, per the out-of-scope note above.

Activity

  1. stasimus commented on Aug 7, 2026

    @stasimus
    ContributorAuthor

    Two findings from the rollout:

    The documented caller failed SonarQube Cloud's quality gate — C security rating on new code in all 10 analysed repos. Two rules: the unpinned @v6 ref, and secrets: inherit. Probed independently on evolution-gaming/skafka#607; neither fix alone was enough. Fixed in #6.

    Several gates only looked enabled. derivation and pubsub have sbt-version-policy but never set versionPolicyIntention, so versionPolicyCheck errors as soon as it really runs. pubsub has sbt-scalafmt but no .scalafmt.conf. Six repos had never run scalafmtSbtCheck against project/plugins.sbt.

  2. stasimus commented on Aug 7, 2026

    @stasimus
    ContributorAuthor

    Rollout open and green: all 27 rollout PRs plus the cats-helper pilot pass, including every Sonar-analysed repo.

    evolution-gaming/smetrics#450 is red on purpose. It surfaces a real binary incompatibility in smetrics-doobie (doobie moved to org.typelevel.doobie.*), previously hidden because shallow checkout made sbt-dynver report 0.0.0, and inherits a test failing on smetrics master since #440. Both need a versioning decision there.

    What adoption changed in enforcement terms, across the 27 repos: 8 had never had project/plugins.sbt checked by scalafmt, 2 had a versionPolicyCheck that could only error, 1 had scalafmt with no config, and every shallow-checkout repo had a binary-compatibility gate that compared nothing.

  3. mr-git commented on Aug 14, 2026

    @mr-git
    Contributor

    Continuation: #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions