Skip to content

publish --rev fails to delete merged release branches #878

Description

@jpnurmi

Environment

getsentry/publish using getsentry/craft:latest

Steps to Reproduce

  1. Prepare release/<version> and publish through getsentry/publish with a CI-approved SHA. Since Publish commit 7c60ddb, the workflow invokes craft publish <version> --rev <SHA>.
  2. Inspect the 0.17.0 and 0.17.1 jobs.

Expected Result

Craft merges the release into master and deletes the remote release/<version> branch.

Actual Result

Both jobs succeeded and pushed their merges (0.17.0, 0.17.1), but the 0.17.0 and 0.17.1 branches remain. Both logs report error: branch 'remotes/origin/release/<version>' not found.

On the --rev path, git name-rev returned a remote-tracking ref for these jobs. After pushing the merge, Craft attempts to delete that name as a local branch before deleting the remote. The local deletion fails, so the remote deletion never runs. The catch handler incorrectly calls this a merge failure and suggests git push origin --delete remotes/origin/release/<version>, which is not the remote branch name.

Proposed fix: use the approved SHA for publishing, but resolve the canonical release/<version> name for remote deletion. Do not depend on deleting a local branch first. Report cleanup failures separately from merge failures.

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions