feat(infra): automaticRelease=false, snapshot workflow, proper resolveAndLockAll#9
Conversation
…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>
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>
bokelley
left a comment
There was a problem hiding this comment.
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)
-
No
concurrency:group onpublish-snapshot.yml. Two pushes tomainin 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: falseis safer — you don't want a half-uploaded artifact from a cancelled job. -
cosign-installerruns unconditionally, even when the version isn't a SNAPSHOT and the publish step is skipped. Minor; could move under the sameif:as the publish step. -
automaticRelease = falseflip — 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
resolveAndLockAllregistered injava-base-conventions(applied transitively to every subproject viajava-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-cacheremoved) 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>
bokelley
left a comment
There was a problem hiding this comment.
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-installerstep is now scoped underif: steps.version-check.outputs.is_snapshot == 'true'. ✅
Bonus improvements:
release.ymlswitched frompublishAndReleaseToMavenCentraltopublishToMavenCentral, which is the right pairing withautomaticRelease = falseand includes a clear comment about the migration back topublishAndReleaseToMavenCentralonce we've had a clean publish or two. This tackles the follow-up I'd flagged.- The
settings-gradle.lockfiledocs are now honest:updateLocksdoesn't regenerate it, and the manualrm settings-gradle.lockfile && ./gradlew help --write-locksworkaround 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.
Follow-up to #3. Addresses issue #8 — three items from bokelley's post-merge review.
What changed
automaticRelease = falsetrueafter first clean v0.3 publish — tracked in #10.publish-snapshot.ymlmain. Reads project version via./gradlew properties; skips if not-SNAPSHOT. vanniktech routes-SNAPSHOTversions to Central Portal's snapshot repo automatically. GPG secret names aligned withrelease.yml(GPG_SECRET_KEY/GPG_KEY_ID/GPG_PASSPHRASE). Addedconcurrencygroup (cancel-in-progress: false) to prevent racing uploads of the same SNAPSHOT coordinates.cosign-installerstep moved after version check and guarded with the sameif:condition — only installs when the publish step will actually run.resolveAndLockAll(per Gradle docs)updateLocksuseddependsOn(: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 inadcp.java-base-conventionsso each subproject owns it (Gradle 9 disallows cross-project config resolution from a rootdoLast). RootupdateLocksaggregates:${name}:resolveAndLockAll.build.gradle.ktsandCONTRIBUTING.mdincorrectly claimedsettings-gradle.lockfileis auto-rewritten byupdateLocks --write-locks. Testing confirms this is false. Corrected: the settings lockfile must be regenerated separately withrm settings-gradle.lockfile && ./gradlew help --write-locks.release.ymltask fixpublishAndReleaseToMavenCentraltopublishToMavenCentral— the former always auto-releases regardless of theautomaticReleaseflag; 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 messageupdateLocks --write-locksrepairs itsettings-gradle.lockfile→updateLocks --write-locksdoes NOT repair it (by design, documented correctly now)GPG_SECRET_KEY/GPG_KEY_ID/GPG_PASSPHRASECloses #8