fix(downgrade): register unregistered [sources] pins before resolving - #65
fix(downgrade): register unregistered [sources] pins before resolving#65seabbs-bot wants to merge 2 commits into
Conversation
Pkg reads `[sources]` only from the active project, so dependency collection cannot see a dependency pinned by git url/rev and absent from General. Registering those pins into a depot-level scratch registry makes them resolve by name in every environment on the runner. The depot cache restore moves ahead of the bootstrap so it cannot overwrite the registry the bootstrap writes. Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
There was a problem hiding this comment.
The PR reorders julia-actions/cache ahead of julia-downgrade-compat and inserts a step that registers unregistered [sources] git pins into a scratch depot-level registry before dependency resolution, matching an established pattern already used in benchmark.yml and benchmark-history.yml. The ordering rationale and registry-staleness handling are sound, but the new step diverges from its two siblings by hardcoding the EpiAware org instead of reusing the org input pattern, and it's now the third verbatim copy of the same ~20-line block.
Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: first pass. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.
| Pkg.add([ | ||
| Pkg.PackageSpec(name = "LocalRegistry"), | ||
| Pkg.PackageSpec( | ||
| url = "https://github.com/EpiAware/EpiAwarePackageTools.jl", |
There was a problem hiding this comment.
issue This hardcodes https://github.com/EpiAware/EpiAwarePackageTools.jl, but the same step in benchmark.yml (lines 79-81) and benchmark-history.yml (lines 96-97) builds the URL from an org workflow input (default: EpiAware) instead. Add a matching org input to this workflow's inputs: block and use url = "https://github.com/${{ inputs.org }}" * "/EpiAwarePackageTools.jl" here, so downgrade.yml behaves consistently with the other two reusable workflows that already support pointing at a different org/fork.
| # its revision moves. It is dropped before the guard as well, so a | ||
| # caller that has since dropped its pin is not left with a registry | ||
| # still carrying the name, which fails the depot with a hash mismatch. | ||
| - name: Bootstrap registry for unregistered [sources] deps |
There was a problem hiding this comment.
suggestion This step is now duplicated near-verbatim across three workflows (benchmark.yml, benchmark-history.yml, and this one). The duplication already caused the org-hardcoding drift in the previous comment. Worth factoring into a composite action (e.g. .github/actions/bootstrap-sources-registry) that takes org as an input, so all three call sites stay in sync by construction.
|
Merge-order note: #65 and #66 both edit The overlap is only in the This was opened by a bot. Please ping @seabbs for any questions. |
benchmark.yml and benchmark-history.yml both build the kit's URL from an `org` input defaulting to EpiAware. This step hardcoded the org, so a fork calling it would install EpiAware's kit rather than its own. Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
|
I'm not clear why we need this we don't want a source pin for epiawarepackage tools anywhere? |
Closes #30.
What
downgrade.ymlgains aBootstrap registry for unregistered [sources] depsstep between
setup-juliaandjulia-downgrade-compat.Pkg reads
[sources]only from the active project. A step that collectsdependencies without resolving the pins therefore cannot see a dependency
pinned by git url/rev and absent from General, and the job dies with
A registry is depot-level, so registering the pins makes them resolve by name
in every environment on the runner. The step calls
EpiAwarePackageTools.Benchmarks.bootstrap_sources_registry(
src/benchmarks.jl:700), which is the same helper the kit'sbenchmark.yamland
benchmark-history.yamltemplates already use.Ordering
julia-actions/cache@v3moves ahead of the downgrade step, which is adeviation from the action's own example. The bootstrap writes the scratch
registry into the depot, and
julia-actions/cachecaches registries, so arestore landing after the bootstrap would overwrite it.
The
rm -rfruns before the[sources]guard on purpose: a caller that hassince dropped its pin must not be left with a restored registry still carrying
the name, which fails the depot with a hash mismatch.
bootstrap_sources_registryremoves the registry unconditionally itself, butonly on the path where a
[sources]table exists.Scope
No live failure remains to reproduce. None of the org's Julia packages carries
a root
[sources]table any more, and the interim opt-out is gone —ConvolvedDistributions.jl/.github/workflows/test.yamlrunsdowngrade-compatwith no
if: false. This is worth landing anyway because the kit still shipsan
unregistered_sourcesmode (src/scaffold.jl:4081 _detect_unregistered_sources),so a newly scaffolded package can reintroduce the failure.
Validation
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/downgrade.yml'))"passes.
This was opened by a bot. Please ping @seabbs for any questions.