Skip to content

refactor: dedup gitinfo's parallel dev-tag derivations #67

Description

@mostlymaxi

Follow-up to #64.

cargo-athena/src/gitinfo.rs has parallel "derive a dev tag from git" paths: resolve() (build/publish, gated: --allow-dirty, off-branch prompt, --dev-tag slot logic), export_source_build_tag() (consumer source builds, ungated), and export_dev_tag() (added by the source-build tag fix). They share only git_state(), and resolve's slot chain is richer, so for the same tree they can pick different slots. The unsafe set_var trio is also written in more than one place.

Proposed:

  • One dev_outcome(git_state, dev_tag) -> BuildTag doing the slot/tag/prefix computation, called by all paths; layer the gates on top only for build/publish.
  • One bake_env(&BuildTag) (same helper as the BinSel side-effect follow-up).
  • Optionally make BuildTag.channel a method (api::munge::channel_of(&self.tag)) so tag and channel can't disagree.

Scope/risk: highest-churn area, entangled with the recent tag fix; redesign against the current three-function shape, guarded by smoke + e2e. Pairs with the BinSel side-effect follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions