Skip to content

feat(infra): automaticRelease=false, snapshot workflow, proper resolveAndLockAll#9

Merged
MichielDean merged 4 commits into
mainfrom
track/infra-followup-1
May 14, 2026
Merged

feat(infra): automaticRelease=false, snapshot workflow, proper resolveAndLockAll#9
MichielDean merged 4 commits into
mainfrom
track/infra-followup-1

Conversation

@MichielDean
Copy link
Copy Markdown
Collaborator

@MichielDean MichielDean commented May 14, 2026

Follow-up to #3. Addresses issue #8 — three items from bokelley's post-merge review.

What changed

Area Change
automaticRelease = false Staged bundles wait for human review in Central Portal UI before going live. Flip back to true after first clean v0.3 publish — tracked in #10.
publish-snapshot.yml New workflow on push to main. Reads project version via ./gradlew properties; skips if not -SNAPSHOT. vanniktech routes -SNAPSHOT versions to Central Portal's snapshot repo automatically. GPG secret names aligned with release.yml (GPG_SECRET_KEY / GPG_KEY_ID / GPG_PASSPHRASE). Added concurrency group (cancel-in-progress: false) to prevent racing uploads of the same SNAPSHOT coordinates. cosign-installer step moved after version check and guarded with the same if: condition — only installs when the publish step will actually run.
resolveAndLockAll (per Gradle docs) Previous updateLocks used dependsOn(:X:dependencies) which only walks the dependency report. Correct Gradle pattern: configurations.filter { it.isCanBeResolved }.forEach { it.resolve() } within each project's own context. Registered in adcp.java-base-conventions so each subproject owns it (Gradle 9 disallows cross-project config resolution from a root doLast). Root updateLocks aggregates :${name}:resolveAndLockAll.
Documentation fix build.gradle.kts and CONTRIBUTING.md incorrectly claimed settings-gradle.lockfile is auto-rewritten by updateLocks --write-locks. Testing confirms this is false. Corrected: the settings lockfile must be regenerated separately with rm settings-gradle.lockfile && ./gradlew help --write-locks.
release.yml task fix Changed from publishAndReleaseToMavenCentral to publishToMavenCentral — the former always auto-releases regardless of the automaticRelease flag; only the latter respects it.

Test plan

  • ./gradlew clean build -PskipCosign=true — BUILD SUCCESSFUL
  • ./gradlew updateLocks --write-locks -q && git diff --exit-code — no drift
  • ./gradlew updateLocks (without --write-locks) — fails fast with clear fix-command message
  • Corrupt a lockfile → updateLocks --write-locks repairs it
  • Corrupt settings-gradle.lockfileupdateLocks --write-locks does NOT repair it (by design, documented correctly now)
  • Both workflows use identical GPG secret names: GPG_SECRET_KEY / GPG_KEY_ID / GPG_PASSPHRASE

Closes #8

…eAndLockAll

Address three follow-up items from bokelley review (issue #8).

automaticRelease = false (adcp.publishing-conventions):
  For v0.3's first Central Portal publish, keep staged artifacts in
  the portal UI for human review before going live. Flip back to true
  after one or two clean publishes.

publish-snapshot.yml:
  New workflow on push to main. Reads project version via
  `./gradlew properties`; skips if version is not a -SNAPSHOT.
  vanniktech routes -SNAPSHOT versions to Central Portal's snapshot
  repo automatically — no staging/release step needed.

resolveAndLockAll / updateLocks (Gradle docs pattern):
  The previous updateLocks used dependsOn(:X:dependencies) which only
  traversed the dependency report, not all resolvable configurations.
  Per Gradle docs, the correct pattern is a resolveAndLockAll task
  that calls configurations.filter { it.isCanBeResolved }.forEach {
  it.resolve() } within each project's own build context (Gradle 9
  disallows cross-project config resolution from a root doLast).

  - adcp.java-base-conventions: register resolveAndLockAll per subproject
  - build.gradle.kts: updateLocks aggregates :X:resolveAndLockAll tasks
  - ci.yml: drop --no-configuration-cache (task declares incompatibility)
  - CONTRIBUTING.md: explain both lockfile layers and the fix command

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MichielDean MichielDean requested a review from bokelley as a code owner May 14, 2026 15:29
Found during validation against vanniktech docs:

- release.yml: publishAndReleaseToMavenCentral always auto-releases
  regardless of the automaticRelease setting, making automaticRelease=false
  a no-op. Switch to publishToMavenCentral so staged bundles wait for
  human review in the Central Portal UI before going live (the intent
  of automaticRelease=false per bokelley).

- publish-snapshot.yml: vanniktech docs explicitly state that
  publishToMavenCentral is the correct task for SNAPSHOT publishing
  (routes to central.sonatype.com/repository/maven-snapshots/).
  The generic publish task was incorrect here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@bokelley bokelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with JDK 21: updateLocks --write-locks produces no drift, and updateLocks without the flag now fails fast with must be run with the --write-locks flag per module. The Gradle 9 isolation issue is correctly addressed by the per-project resolveAndLockAll pattern.

Blocker — GPG secret name mismatch with release.yml

release.yml uses:

GPG_SECRET_KEY      → signingInMemoryKey
GPG_KEY_ID          → signingInMemoryKeyId
GPG_PASSPHRASE      → signingInMemoryKeyPassword

publish-snapshot.yml (new) uses:

GPG_SIGNING_KEY            → signingInMemoryKey
GPG_SIGNING_KEY_ID         → signingInMemoryKeyId
GPG_SIGNING_KEY_PASSWORD   → signingInMemoryKeyPassword

With signAllPublications() still in adcp.publishing-conventions.gradle.kts, the snapshot job will resolve those secrets to empty strings (GitHub masks the lookup, doesn't error) and signing will fail at runtime. Either rename to match release.yml, or update both workflows to one canonical set — but don't ship them divergent.

Nits (non-blocking)

  1. No concurrency: group on publish-snapshot.yml. Two pushes to main in quick succession will race two Central Portal uploads of the same SNAPSHOT coordinates. Suggest:

    concurrency:
      group: publish-snapshot
      cancel-in-progress: false

    cancel-in-progress: false is safer — you don't want a half-uploaded artifact from a cancelled job.

  2. cosign-installer runs unconditionally, even when the version isn't a SNAPSHOT and the publish step is skipped. Minor; could move under the same if: as the publish step.

  3. automaticRelease = false flip — exactly what was asked for. Worth filing a quick follow-up issue (flip back to true after first clean v0.3 publish) so the manual step doesn't outlive its usefulness.

Looks good

  • resolveAndLockAll registered in java-base-conventions (applied transitively to every subproject via java-library-conventions / kotlin-library-conventions / schema-codegen-conventions).
  • require(...isWriteDependencyLocks) guard with clear error message.
  • notCompatibleWithConfigurationCache(...) declaration is correct since the task resolves configurations at execution time.
  • CI step simplification (--no-configuration-cache removed) is appropriate now that the task itself declares incompatibility.
  • CONTRIBUTING.md doc update accurately describes the new behavior.

Once the secret names are aligned with release.yml (and ideally the concurrency group added), this is ready to merge.

- publish-snapshot.yml was referencing GPG_SIGNING_KEY / GPG_SIGNING_KEY_ID /
  GPG_SIGNING_KEY_PASSWORD which don't match the secrets documented and used
  by release.yml (GPG_SECRET_KEY / GPG_KEY_ID / GPG_PASSPHRASE). Aligned
  snapshot workflow to use the same names so a single set of org secrets
  covers both workflows.

- build.gradle.kts and CONTRIBUTING.md incorrectly claimed that
  settings-gradle.lockfile is automatically rewritten when --write-locks is
  active. Testing confirms this is false: updateLocks --write-locks and
  help --write-locks both leave a corrupted settings lockfile untouched.
  The correct procedure is: rm settings-gradle.lockfile && ./gradlew help
  --write-locks. Updated comments and docs to reflect actual behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…orkflow

- Add concurrency group 'publish-snapshot' with cancel-in-progress: false
  to prevent two pushes to main racing concurrent SNAPSHOT uploads to the
  same Central Portal coordinates. cancel-in-progress: false is chosen over
  true to avoid leaving a half-uploaded artifact from a cancelled job.

- Move Install cosign step to after version-check and guard it with the
  same if: condition as the Publish SNAPSHOT step. cosign is only needed
  when publishToMavenCentral actually runs (D4 schema-bundle verification);
  running it unconditionally wasted ~10s on every non-SNAPSHOT push.

Closes #10 will be filed as a follow-up for flipping automaticRelease=true
after the first clean v0.3 publish (tracked in issue #10).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MichielDean MichielDean requested a review from bokelley May 14, 2026 15:55
Copy link
Copy Markdown
Contributor

@bokelley bokelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three items from the prior review are addressed:

  • GPG secret names now match release.yml (GPG_SECRET_KEY / GPG_KEY_ID / GPG_PASSPHRASE). ✅
  • Concurrency group added with cancel-in-progress: false. ✅
  • cosign-installer step is now scoped under if: steps.version-check.outputs.is_snapshot == 'true'. ✅

Bonus improvements:

  • release.yml switched from publishAndReleaseToMavenCentral to publishToMavenCentral, which is the right pairing with automaticRelease = false and includes a clear comment about the migration back to publishAndReleaseToMavenCentral once we've had a clean publish or two. This tackles the follow-up I'd flagged.
  • The settings-gradle.lockfile docs are now honest: updateLocks doesn't regenerate it, and the manual rm settings-gradle.lockfile && ./gradlew help --write-locks workaround is documented. CI's drift check on the file will catch any divergence. Pragmatic given the Gradle quirk.

Verified locally one more time: ./gradlew updateLocks --write-locks produces no drift, and CI is green on both build and storyboard. LGTM.

@MichielDean MichielDean merged commit 76e1553 into main May 14, 2026
8 checks passed
@MichielDean MichielDean deleted the track/infra-followup-1 branch May 14, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[track:infra] Track 1 follow-up: automaticRelease, snapshot publishing, settings lockfile

3 participants