Repository navigation
fix(ci): rehearse the pack directory named by the pack distribution workflow's pack input - #467
Merged
Merged
Conversation
…orkflow's pack input
The workflow declared a `pack` dispatch input but never passed it on, and
the rehearsal hard-coded TechVault. The run step now passes the input
through a step-level `env:` entry (REHEARSAL_PACK), never `${{ }}` inside
`run:`. The script rehearses that directory (default packs/techvault),
stops before publishing when validate_pack() rejects it, and names the
consumer directories after the built pack's name, which static
validation requires.
Closes #451
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Pack distribution rehearsalworkflow declares apackdispatch input (defaultpacks/techvault), but its run step never passed it on andtests_integration/distribution_rehearsal.pyhard-coded TechVault, so every dispatch rehearsed TechVault. The step now hands the input to the script through a step-levelenv:entry (REHEARSAL_PACK: ${{ inputs.pack }}), so the dispatch value is never pasted into the generated shell script, following GitHub's "Use an intermediate environment variable" guidance (https://docs.github.com/en/actions/reference/security/secure-use). The script rehearses that directory (repo-relative or absolute; unset or empty meanspacks/techvault) and names its consumer directories after the built pack'sname. The registry repository already used that name since #453.Before anything is built, the script runs
validation.validate_pack()on the directory, the one static-validation authority (ADR 0013), applied before any publish effect (ADR 0037). A directory it rejects stops the run with exit 1 andrehearsal stopped: <dir as given> (<resolved path>) is not a pack: <diagnostic codes>.Naming the consumer directories after the pack is required: static validation requires an installed pack's directory to carry its name (see Verification).
Related issues
Closes #451
Builds on #453 (release paths from the pack version), already on
dev.Known limit, tracked in #470: a
pack: packs/ai-escape-labdispatch currently publishes, then stops at install with[failed] content-binding, because 12 members of that pack'sassociated-artifacts.jsonno longer match their bytes ondevsince #431, and no CI gate byte-binds it. That is pack content, so it is not fixed here.inputs.packto the script through an environment variable, and the script rehearses that pack directory (defaultpacks/techvault). Its consumer directories and registry repository are named after the pack'sname.pack-distribution.ymlstepenv: REHEARSAL_PACK;distribution_rehearsal.py:_pack_root,pack_rootparameter on_publish/offline_rehearsal/registry_rehearsal,consumer/<name>andinstalled/<name>test_rehearsal_step_passes_the_pack_input_through_env,test_offline_rehearsal_rehearses_the_pack_the_dispatch_names,test_registry_rehearsal_names_the_repository_and_consumers_after_the_packtestsdistribution_rehearsal.py:_require_pack, called first inmain()test_a_directory_that_is_not_a_pack_stops_before_publishing(docs,packs/no-such-pack, a directory whosepack.yamlname differs)teststests/test_pack_distribution_workflow.pychecks that the run step passes the input throughenv:, and a test drives the rehearsal with a pack other than TechVault. Both fail ondev.test_no_run_body_interpolates_an_expression(norun:in the workflow contains${{)testsVerification
python -m unittest discover -s testsraes-pack-validate --repo .raes-pack-release check --allraes-pack-validate --packs-root packsraes-pack-release check --packs-root packsdocs/public/warning-free (sphinx-build -W).Run locally on Linux, Python 3.12.3, in a venv with
requirements/runtime.txt,coverage.txtandbuild.txtinstalled by hash, as the CItestsjob does, and the package editable:python -m unittest discover -s tests: 978 tests. The first run lackedcoverage.txt, so onetest_techvault_packtest could not importbcrypt; with it installed, that module's 72 tests pass.python -m unittest tests.test_distribution_rehearsal tests.test_pack_distribution_workflow tests.test_workflow_permissions: 26 tests, OK (123 s; four end-to-end rehearsals).dev, the new tests fail: the env test (None != '${{ inputs.pack }}'), the participant-study offline test (it published TechVault), all three not-a-pack cases (the run ignored the variable and passed), and both registry tests (registry_rehearsalhas nopack_rootparameter ondev).techvault, the participant-study offline test fails withinstall plan not applicableand the registry test withpulled release failed verification: accepted=False authenticated=True.registry:2container on127.0.0.1, withoras1.3.3 (the workflow's version, checksum-verified) and acosignstub that exits 0,REHEARSAL_PACK=packs/techvault-participant-study REHEARSAL_REGISTRY=localhost:15451 python tests_integration/distribution_rehearsal.pyexited 0, pushedlocalhost:15451/techvault-participant-study:0.1.2, and printedOFFLINE REHEARSAL PASSEDandREGISTRY REHEARSAL PASSED. The container, image andorasdownload were removed afterwards.python -m compileall src tests tests_integration,python -m sphinx -W -b html docs/public <out>andtools/check_docs_publication_boundary.pyall exit 0.Checklist
packs/.CHANGELOG.md— release-please owns them.