fix: leave mode-keyed pins to a hand edit

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 09:25:23 +02:00
1 parent d89b193780
commit b0f2c3bb88
2 files changed
+27 -3

No files matched your search

+9 -3
View File
@@ -2459,6 +2459,15 @@ def bump_commit(
if pending_recale(report, accept_changed, text):
return False
document = yaml.safe_load(text)
if any(isinstance(document.get(f), dict) for f in ("source_commit", "upstream_commit")):
# A pin per build mode names one revision per repository, and the
# report heads only the primary one: rewriting str(dict) was a
# refused write on mesence, supermodel and xemu.
print(
f"{path.stem}: pins keyed by build mode are advanced by hand",
file=sys.stderr,
)
return False
upstream_moves = bool(
report.upstream_head and report.upstream_pin != report.upstream_head
)
@@ -2466,9 +2475,6 @@ def bump_commit(
# Rewriting the pin to the value it already holds is not a bump, and
# announcing it buries the profiles that did move.
return False
if isinstance(document.get("upstream_commit"), dict):
# A pin per build mode names no single upstream revision to advance.
return False
expected = dict(document)
expected["source_commit"] = report.head
new_text = _set_pin(text, document, "source_commit", report.head, "profiled_date")