Skip to content

fix(changelog): remap stale SHAs in-memory to survive ctx exit dump#22

Merged
EspenAlbert merged 3 commits into
mainfrom
t07-48-fix-rebase-sha-overwrite
Feb 25, 2026
Merged

fix(changelog): remap stale SHAs in-memory to survive ctx exit dump#22
EspenAlbert merged 3 commits into
mainfrom
t07-48-fix-rebase-sha-overwrite

Conversation

@EspenAlbert

@EspenAlbert EspenAlbert commented Feb 25, 2026

Copy link
Copy Markdown
Owner

Summary

_resolve_stale_shas detected stale SHAs after rebase and applied corrections via file-level regex replacement. But pkg_ctx.__exit__ unconditionally re-dumps self._actions (still holding old SHAs), overwriting the file fix. A secondary issue: the regex _SHORT_SHA_PATTERN couldn't handle YAML-quoted SHA values.

Switched to in-memory operations: apply_remap_to_actions mutates FixAction.short_sha directly on ctx._actions, and remove_actions_by_sha filters the list. When __exit__ dumps, it writes corrected SHAs. Removed dead file-level functions (apply_remap_to_file, remove_actions_from_file) and _SHORT_SHA_PATTERN.

Considerations

  • apply_remap_to_actions mutates in-place (returns count); remove_actions_by_sha returns a new list. Callers must assign the result of remove_actions_by_sha back to ctx._actions

@EspenAlbert EspenAlbert changed the title todo update me with the PR title for branch t07-48-fix-rebase-sha-overwrite fix(changelog): remap stale SHAs in-memory to survive ctx exit dump Feb 25, 2026
@EspenAlbert EspenAlbert marked this pull request as ready for review February 25, 2026 10:58
@EspenAlbert EspenAlbert merged commit f03c6ec into main Feb 25, 2026
16 checks passed
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