Skip to content

refactor(ra): add draft_release.py, issue_events.py and a publish entry point in release_publisher - #488

Merged
hdamker merged 1 commit into
camaraproject:release-automation-refactorfrom
hdamker:refactor/ra-act-modules
Oct 23, 2026
Merged

hdamker merged 1 commit into
camaraproject:release-automation-refactorfrom
hdamker:refactor/ra-act-modules

Conversation

@hdamker

@hdamker hdamker commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • cleanup

What this PR does / why we need it:

Adds the modules the act job will call, with tests against an in-memory GitHub client (release_automation/tests/fake_github.py). Nothing is wired yet; the next PR replaces the command jobs with act and snapshot.

  • draft_release.py replaces Extract CHANGELOG release notes, Create Draft Release, Discard Snapshot, Delete Draft Release and both Cleanup review branch steps. Same CHANGELOG candidates, candidate-block stripping (full block or orphan marker), release-notes extraction, fallback body, -preserved rename.
  • It serves both publish_mode values of the plan: create_draft() for draft (today's path) and publish_on_merge() for on_merge: CHANGELOG cleanup commit, release_date commit, published release and tag at that commit, prerelease flag from the release type, then the same post-publication steps as /publish-release. All policy values are still draft, so on_merge does not run yet.
  • release_publisher.publish_draft() replaces the 97-line Python heredoc of publish-release; complete_publication() (reference tag, pointer branch, branch cleanup, warnings) is shared by both modes.
  • issue_events.py: reopen a Release Issue closed during a release, with the issue_reopened comment.
  • The CHANGELOG cleanup commit on the snapshot branch is retried twice (5 s, 10 s) on GitHub's transient ruleset timeout ("Rule was unable to be completed in 10 seconds"); other errors fail as before. See Retry logic for transient GitHub ruleset validation timeouts #155.
  • repository-setup.md now says what happens without README release-info delimiters: the README update is skipped with a warning (the docs said the step fails).

Behaviour differences, all on failure paths:

  • a missing snapshot branch on /discard-snapshot or /delete-draft reports "Snapshot branch … not found" instead of the API's "Reference does not exist"
  • a failed CHANGELOG cleanup commit returns success=false with "CHANGELOG cleanup failed: …" (it was an unhandled step failure); no draft is created in both cases

GitHubClient gains create_release, delete_release, delete_tag, reopen_issue and get_branch_sha; bot_responder.post_comment() is the comment helper finalize already had.

Which issue(s) this PR fixes:

Part of #476

Special notes for reviewers:

Targets release-automation-refactor. No change on a running path except finalize calling the shared post_comment().

Changelog input

 release-note

Additional documentation

docs

@hdamker
hdamker requested review from Kevsy and rartych as code owners October 23, 2026 18:22
@hdamker
hdamker merged commit cba583a into camaraproject:release-automation-refactor Oct 23, 2026
8 checks passed
@hdamker
hdamker deleted the refactor/ra-act-modules branch October 24, 2026 06:35
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