Files
Harish b1c5210303 feat(release): export the qualification library for reuse by other repositories (#2367)
* feat(release): export the qualification library for reuse by other repositories

Move the qualification and resolve packages from release/internal to
release/pkg so another module can import them.

Add BuildResolvers, which takes the strategies a caller adds to the built-in
ones. An addition that shadows a built-in strategy, is named in both halves,
has no factory or builds nothing is refused. qualify passes none, so its
behaviour is unchanged.

Add Planner.SubjectFile and the --subject-spec flag, so a subject's spec can
live apart from the tree --root points at. --root now names only the tree the
resolvers read.

Closes #2366

Signed-off-by: Harish Sampath <hasampath@nvidia.com>

* docs(release): point the layout table at release/pkg

The layout table linked the qualification and resolve packages at their old
release/internal paths, which docs-check rejects now that they live under
release/pkg. Update both links, and say that these two packages are importable
from other modules.

Signed-off-by: Harish Sampath <hasampath@nvidia.com>

* fix(release): keep a Planner from reusing the last plan's commit

Plan cached the commit it resolved on the Planner and never cleared it, so a
Planner used again with ResolveAtCommit off still recorded the old commit and
offered it to the resolvers. Clear it at the start of each Plan, and say that
a Planner is not safe for concurrent use.

Review feedback on the exported library:

- Name the cause when the subject's resolver returns no ref to describe at,
  instead of an empty ref inside a git error.
- Document that a strategy resolving the subject must return a ref naming a
  commit in the tree at Root when planning at a commit.
- Reject an empty strategy name in either map of Strategies.
- Cover the commit path of Plan, a Planner used twice, custom strategies
  planned through the exported API, and a successful plan with the subject's
  spec outside the tree --root names.

Signed-off-by: Harish Sampath <hasampath@nvidia.com>

---------

Signed-off-by: Harish Sampath <hasampath@nvidia.com>
2026-11-17 22:30:58 +05:30
..