Skip to content

Remove .pr artifacts in the release PR instead of separate cleanup PRs #22

Closed

Description

@smolpaws

Goal

Delete tracked repository-root .pr/ evidence as part of the normal release PR, rather than opening/updating a separate cleanup PR after each product PR merge. Preserve evidence on product PR branches during review and keep normal release checks and branch protections.

Requested in the release cleanup discussion. OpenHands/OpenHands#19050 is a merged example: 46 deleted .pr/ files and a separate CI cycle. This change should reduce cleanup-only pushes; it does not eliminate normal release CI.

Current implementation

  • The shared workflow has two engines: stock release-please-action by default, and a library-mode driver only when github-scoped-notes is enabled. Both must support cleanup; do not make cleanup require a notes-format change.
  • The library driver uses Manifest.createReleases() followed by createPullRequests(). Its dependency is release-please 17.3.0.
  • OpenHands/OpenHands, extensions, and automation call the shared workflow and have separate .pr/ cleanup producers. OpenHands and extensions also reject release trees that still contain .pr/.
  • Deletion needs explicit implementation. In release-please 17.3.0 buildChangeSet, an updater returning an empty string adds no change. extra-files or an empty-content updater therefore does not delete files. Use true tree/ChangeSet deletions (sha: null at the Git Trees layer), without reading/re-encoding binary evidence.

Proposed implementation and rollout

  1. Add an explicit cleanup opt-in to the shared workflow and enable it in adopting callers. Include deletions in the release engine's initial create/update commit, before opening/updating the PR. Cover stock and custom-notes paths via a shared deletion-capable adapter/driver; avoid a second cleanup commit/push after release-please, which causes another synchronize/CI cycle.
  2. Enumerate tracked .pr/ entries on the actual target branch, recompute them on every release-PR refresh, and combine the deletions with normal version/manifest/notes changes. Handle pagination/truncated-tree responses, binary files, symlinks, empty/missing directories, reruns, and concurrent updates. Root .pr/ only: never delete .pr-other/ or package-local directories by prefix accident. Never push a cleanup commit directly to main or a maintenance branch.
  3. Preserve branch/config/manifest isolation for main, release/**, and callers with multiple release lines. No extra release or cleanup PR when there is no release candidate.
  4. In adopting consumers, disable the competing post-merge automation/remove-pr-artifacts PR producer; retain reviewer notices with updated timing, and reconcile existing cleanup PRs without auto-merging them. Keep the release-tree guard and update its remediation to refresh the release PR, rather than requiring a separate cleanup merge. Update contributor/agent guidance consistently. Repositories that have not opted in keep existing behavior.
  5. Prevent evidence writers from reintroducing .pr/ on release heads. Canvas live E2E CI currently commits .pr/live-e2e media back to same-repository PR heads. For release PRs, retain evidence as Actions artifacts/comments instead of committing .pr/; do not skip the tests themselves. Otherwise the guard and cleanup can loop.

Acceptance / verification

  • Both release engines create and refresh a release PR with normal release changes plus real .pr/ deletions in the same branch update; release PR/tag/release outputs and notes behavior remain compatible.
  • A binary/image/video, symlink, nested path, and more-than-one-page fixture are all removed; unrelated tracked paths, including .pr-other/, are unchanged. Missing .pr/ is a no-op.
  • Later target-branch artifacts disappear on refresh; repeated runs are idempotent; main/maintenance and multi-line releases remain isolated.
  • In an opted-in consumer, merging a product PR with evidence produces no cleanup-only PR/push; a release candidate absorbs cleanup. Review evidence stays on the product PR branch.
  • Required release checks still run on the final head, reject residual .pr/, and do not regenerate it. No auto-merge, skip-CI marker, or branch-protection bypass.

SDK currently uses manual prepare-release.yml; its corresponding change is tracked in OpenHands/software-agent-sdk#6334.

This issue was created by an AI agent (OpenHands/SmolPaws) on behalf of Engel Nyst.

Activity

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