feat: let a profile say its pin is held on purpose

nethersx2-turnip-classic documents the shim rules of the revision it
pins, and says so in prose: the classic build is that revision. Compared
to HEAD it reported the same two changes every pass, and recaling would
have repointed its refs at rules this build never had.

pin_frozen says the freeze is deliberate, and the profile is then judged
against its own revision, exactly as one pinned to a superseded tag
already was. Recale and bump are refused for it, which is what makes the
declaration safe to trust.
This commit is contained in:
Abdessamad Derraz committed 2026-09-05 10:50:53 +02:00
1 parent 88c7e213b6
commit a0b2263bae
5 files changed
+51 -1

No files matched your search

+8 -1
View File
@@ -1272,7 +1272,14 @@ def build_report(
report.repos = [v.repo.slug for v in views]
report.pin, report.pin_origin = primary.pin, primary.origin
report.head = primary.head
report.pinned_tag = detect_pinned_tag(profile, views, cache_dir, offline)
# A profile can hold its pin on purpose, documenting a build that is that
# revision. Comparing it to HEAD says nothing and recaling would repoint
# its refs at code the build never had, so it is judged like a frozen tag:
# against itself.
frozen = str(profile.get("pin_frozen") or "").strip()
report.pinned_tag = frozen or detect_pinned_tag(
profile, views, cache_dir, offline
)
# A profile carrying no source_ref still has a pin worth writing and a
# version worth checking, so the revisions above are resolved first.