Skip to content

Support multiple modules and make release preparation idempotent - #512

Open
ppkarwasz wants to merge 3 commits into
gha/v0from
release-multi-module
Open

Support multiple modules and make release preparation idempotent#512
ppkarwasz wants to merge 3 commits into
gha/v0from
release-multi-module

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Adapts deploy-release-reusable to repositories with multiple modules inheriting directly from logging-parent (e.g. Apache Flume, whose reactor root and flume-parent both do), and makes the release preparation idempotent.

Multi-module support

  • The revision and project.build.outputTimestamp properties are now updated in every git-tracked pom.xml that defines them (auto-discovered with git grep, excluding src/** so test-resource POMs are never touched) — no new workflow input needed.
  • Updates use versions:set-property with -f <pom> per module, replacing both the help:evaluate check (which only reports one value per invocation) and the sed hack for the timestamp. One commit per property covers all changed POMs.
  • The two property steps are merged into one, sharing a Bash function.

Idempotency

  • The changelog is released first, so the timestamp covers all release preparation commits. Since the POMs still contain the old version at that point, revision is overridden on the command line (-Drevision).
  • The timestamp is taken from the author date of HEAD (%ad instead of %cd) — preserved by squash commits and rebases — and the commit updating it is backdated (GIT_AUTHOR_DATE) to the same value. Re-runs therefore recompute the identical timestamp and create no new commits.
  • All release preparation commits are published with a single git push at the end.

Adapt `deploy-release-reusable` to repositories with multiple modules
inheriting directly from `logging-parent` (e.g. Apache Flume, whose
reactor root and `flume-parent` both do):

* The `revision` and `project.build.outputTimestamp` properties are now
  updated in every git-tracked `pom.xml` defining them (excluding
  `src/**`), using `versions:set-property` instead of `help:evaluate`
  and a `sed` hack. Both updates share a single step and Bash function.

Also make the release preparation commits idempotent:

* The changelog is released first, so the `project.build.outputTimestamp`
  value covers all release preparation commits. Since the `pom.xml` still
  contains the old version at that point, `revision` is overridden on the
  command line.
* The timestamp is taken from the author date of `HEAD` (preserved by
  squash commits and rebases) and the commit updating it is backdated to
  the same value, so re-runs produce no new commits.
* All commits are published with a single `git push` at the end.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A4jy56QVeduMJcpkryJQpG
Export `GIT_AUTHOR_DATE` once, right after checkout: the author date of
the checked out commit. All automatic commits (changelog, `revision`,
`project.build.outputTimestamp`) and the timestamp property now share
this value, so re-runs of the workflow regenerate commits with
identical author dates.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A4jy56QVeduMJcpkryJQpG
The step no longer only configures the committer identity, it also
exports `GIT_AUTHOR_DATE`.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A4jy56QVeduMJcpkryJQpG
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.

1 participant