Skip to content

fix: preserve release tag during rollback - #224

Merged
rodri-oliveira-dev merged 5 commits into
mainfrom
fix/release-rerun-tag-retention
Oct 1, 2026
Merged

rodri-oliveira-dev merged 5 commits into
mainfrom
fix/release-rerun-tag-retention

Conversation

@rodri-oliveira-dev

@rodri-oliveira-dev rodri-oliveira-dev commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Preserves the release tag when a downstream release step fails, instead of deleting it during compensating rollback.

Problem

The previous rollback removed a newly-created release tag after a partial release failure. On Re-run failed jobs, GitHub reused the successful Create release tag job result instead of recreating the tag, causing gh release create --verify-tag to fail because the tag no longer existed.

Changes

  • stop passing -DeleteReleaseTag from release.yml;
  • remove tag-deletion behavior from eng/rollback-release.ps1;
  • retain the validated release tag so retries and the recovery workflow can reconcile partial release state safely;
  • keep existing behavior that removes a partially-created GitHub Release while leaving package registry artifacts untouched.

Expected behavior

After a partial release failure, the release tag remains bound to the validated commit. A subsequent Re-run failed jobs can therefore complete the GitHub Release step without depending on the tag-creation job being rerun.

Scope

No package IDs, artifacts, versioning rules, publishing credentials, or registry publication semantics were changed.

Summary by CodeRabbit

  • Correções
    • Durante o rollback, a tag da versão é preservada para permitir novas tentativas e recuperação. A versão publicada no GitHub continua sendo excluída, sem alterações nesse comportamento.
    • A operação informa que a tag foi mantida. A preservação da tag também se aplica ao rollback iniciado pelo fluxo de publicação.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: rodri-oliveira-dev/Dapper-FluentMap/https://raw.githubusercontent.com/rodri-oliveira-dev/.github/main/coderabbit-templates/dotnet-library.yaml (via .coderabbit.yaml)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: cf006a8b-5e99-45b3-87f0-836d7df055eb

📥 Commits

Reviewing files that changed from the base of the PR and between 0e7670f and 0008c84.

📒 Files selected for processing (1)
  • eng/test-release-governance.ps1

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: Analyze C# with CodeQL
  • GitHub Check: Provider compatibility (SQL Server, PostgreSQL, MySQL, MariaDB)
  • GitHub Check: Public API and nullable contracts
  • GitHub Check: Native AOT strict generated smoke (SQLite, win-x64)
  • GitHub Check: Compatibility (minimum, Dapper 2.1.79)
  • GitHub Check: Repository configuration
  • GitHub Check: Analyzer and generator compatibility
  • GitHub Check: Compatibility (latest-stable, Dapper 2.1.89)
🔇 Additional comments (1)
eng/test-release-governance.ps1 (1)

894-894: LGTM!


📝 Walkthrough

Walkthrough

O rollback deixa de aceitar a opção de excluir a tag e passa a mantê-la. O script continua excluindo o GitHub Release e informa que preserva a tag para nova tentativa e recuperação.

Changes

Retenção da tag no rollback

Layer / File(s) Resumo
Comportamento de retenção da tag
eng/rollback-release.ps1
O script remove o parâmetro e a solicitação de exclusão da tag. Ele continua excluindo o GitHub Release e registra que mantém a tag.
Integração e testes do rollback
.github/workflows/release.yml, eng/test-release-governance.ps1
O workflow deixa de passar o parâmetro removido. Os testes simulam a consulta e a exclusão do GitHub Release e verificam que a tag permanece.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0008c

O rollback preserva a tag validada para novas tentativas e continua removendo o Release parcial. Não há risco acionável identificado para impedir o merge.

Architecture Summary

Architecture risk: 🔵 Low · up to 0008c

The change affects 1 system.

Changed systems: eng

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — eng (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in eng/rollback-release.ps1: GitHubToken no longer has a trailing comma, and the DeleteReleaseTag switch parameter was removed.
  • observed — Modified behavior in eng/rollback-release.ps1: Removed the conditional tag-deletion request, its handling of HTTP 204, 404, and 422 as success, and the alternate message for tags not created by this workflow run. The script now always retains the tag and logs its preservation for retry and recovery.
  • observed — Modified behavior in eng/test-release-governance.ps1: Added Invoke-RollbackScenario to run eng/rollback-release.ps1 with a test version, tag, repository, and token. Its mocked Invoke-WebRequest logs requests, returns release ID 4242 for matching tag lookups and a successful response for deleting release 4242, and throws for other requests. The scenario captures success, output, and request log, then removes the mock, restores the prior environment variable, and deletes temporary files.
  • observed — Modified behavior in eng/test-release-governance.ps1: Added tests asserting that rollback succeeds, performs exactly one release lookup by tag and one release deletion, sends no tag-reference deletion request, and reports that the tag is retained. Added a workflow assertion that release.yml does not contain -DeleteReleaseTag.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed O título descreve de forma clara e concisa a principal alteração: preservar a release tag durante o rollback.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04a5e86381

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread eng/rollback-release.ps1 Resolved
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

SonarQube Cloud success

The SonarQube Cloud Quality Gate passed for this PR.

Quality Gate status: OK

Metric Status Actual Threshold
new_reliability_rating OK 1 1
new_security_rating OK 1 1
new_maintainability_rating OK 1 1
new_duplicated_lines_density OK 0.0 3
new_security_hotspots_reviewed OK 100.0 100

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rodri-oliveira-dev
rodri-oliveira-dev merged commit 2b66742 into main Oct 1, 2026
15 checks passed
@rodri-oliveira-dev
rodri-oliveira-dev deleted the fix/release-rerun-tag-retention branch October 1, 2026 09:41
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

⌂ 换网址