Repository navigation
QA: load Plots so the PlotsExt extension is actually scanned - #239
Merged
ChrisRackauckas merged 2 commits intoAug 1, 2026
Merged
Conversation
ExplicitImports only adds an extension module to the set of checked modules when `Base.get_extension` returns non-`nothing`, which requires the trigger package to be loaded. The QA environment did not load Plots, so `PlotsExt` was never scanned. Add Plots to `test/qa/Project.toml` and load it in `qa.jl`. The one finding this surfaces is `PlotsExt` accessing `RootedTrees._distinguishable_colors`, which is RootedTrees' own internal hook that the extension exists to fill in; it is ignored with a comment rather than promoted to public API. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
`Base.get_extension` returning `nothing` makes ExplicitImports silently skip the extension and still report a clean pass, so a future precompilation break in `PlotsExt` would drop QA coverage back to zero without failing anything. Guard against that explicitly. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
ChrisRackauckas
marked this pull request as ready for review
August 1, 2026 08:39
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.
This is a QA-infrastructure change opened for review, not a merge request. RootedTrees.jl is primarily maintained by @ranocha outside SciML, so this is offered as a suggestion — please treat it as a proposal to comment on rather than something to merge as-is. Please ignore until reviewed by @ChrisRackauckas.
Problem
SciMLTesting.run_qaruns ExplicitImports' checks on the package module. ExplicitImports does know about extensions — it reads the[extensions]table out ofProject.tomland adds each extension to the set of checked modules — but only when the extension module actually exists:An extension module only exists once its trigger weakdep has been loaded. The QA environment (
test/qa/Project.toml) did not depend onPlots, soPlotsExtwas never scanned by QA.This is invisible in the test summary: each ExplicitImports check folds all submodules into a single
@test, so the QA output is byte-identical whether or not the extension is covered.Change
test/qa/Project.toml: addPlotsunder[deps](same UUID as the root[weakdeps]entry) and a[compat]entry mirroring the rootPlots = "1.39"bound.Testis added alongside it for the load guard below.test/qa/qa.jl:using Plotsbeforerun_qa, with a comment explaining why.test/qa/qa.jl: a load guard asserting the extension really materialized (see below).Coverage
PlotsExtNothing is left out —
Plotsis the only weakdep, and it resolves and loads fine in the QA environment.Proof that
PlotsExtis actually scannedRun from the QA environment (ExplicitImports stacked in from a scratch env so it does not pollute
test/qa/Project.toml):With
Plotsloaded (this PR):Without
Plotsloaded (maintoday):Independently corroborated by the fact that adding
using Plotsimmediately produced a new ExplicitImports failure thatmainnever reported (below).Load guard: keeping the coverage from silently regressing
The
ext_mod === nothing && continueabove is a silent skip. If someone later breaksPlotsExt's precompilation, or the weakdep drops out of the QA environment,Base.get_extensionreturnsnothing, ExplicitImports quietly checks fewer modules, andrun_qastill reports a completely green summary — coverage falls back to zero with nothing failing. Merely adding the dependency is therefore not self-defending.So the PR also asserts the extension exists, rather than trusting a green
run_qa:This is the one assertion in the file whose failure unambiguously means "the extension is no longer being scanned."
Finding surfaced, and the one ignore entry added
Once
PlotsExtwas in scope,all_qualified_accesses_are_publicerrored:Justification for ignoring:
RootedTrees._distinguishable_colorsis RootedTrees' own internal hook — it exists specifically soPlotsExtcan define a method for it (RootedTrees._distinguishable_colors(n) = Plots.distinguishable_colors(n)). An extension filling in its parent package's internal hook is exactly the intended design; ExplicitImports simply does not classify an extension module as internal to its parent, so it flags the access. There is no public spelling to switch to, and promoting an underscore-prefixed implementation hook to public API (which would also require documenting it, and would make it subject to SemVer) would be the wrong fix. So it is ignored, with a comment naming the owner and the reason:No check is disabled, nothing is marked
@test_broken, and no extension source needed fixing —ext/PlotsExt.jlis already clean (using Plots: Plots,using RootedTrees: RootedTrees) and is untouched by this PR.Local result
GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()'on this branch:21 rather than 20 because of the added load-guard
@test. For contrast, the intermediate state (Plots loaded, no ignore entry) gave19 passed, 0 failed, 1 errored— which is the evidence that the extension genuinely entered the scan.test/qa/Manifest.tomlis a local build artifact and is not committed (**/Manifest.tomlis already gitignored).