mcl-mail#8: rebar3_lint pinned to 6.0.0, the version the build fetched anyway #13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "titan/8-rebar3-lint-pin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Refs #8.
rebar3never records a project plugin inrebar.lock, so the tested lock (mcl-mail#6) cannot coverrebar3_lint: a bare name had the image build fetch whatever hex served that day, and hex versions move. The image build therefore ran one piece of code that neither the tested lock nor a pin held.What changed
rebar.config:{project_plugins, [rebar3_lint]}→{project_plugins, [{rebar3_lint, "6.0.0"}]}, with the reasoning in a comment above it.The issue's other option — a
lintprofile, which takes the plugin out of the image build — was not taken: a profile compiles every dependency a second time, in its own_buildprofile, on every lint run, while a hex version is immutable and rebar3 verifies the package against hex's checksum when it fetches. The pin buys the same guarantee for no CI time.How it was checked
rebar3 3.27.0on OTP 28): a scratchrebar.configpinning5.0.4fetchedrebar3_lint v5.0.4, not the latest — the version in the config is the one fetched, so the pin bites.rebar.config, same image, fresh cache: the default profile andrebar3 as prod get-deps(the image build's own profile) each fetchrebar3_lint v6.0.0— the version a bare name resolved to today — and no other version.rebar3 get-depsleavesrebar.lockbyte-identical (cmp), so the Containerfile's tested-lock refusal still holds;rebar.lockcarries no plugin entry, as rebar3 records none.rebar3 linton the exact tip, which is the proof the pinned version still lints.Review r=0 (Venus, Opus), tip
b0d85ea7, base87556bb: FAIL, one required findingR1 (required, Done-when not met): the pin leaves a floating plugin dependency in the image build. rebar3_lint 6.0.0 pins elvis_core exactly, but elvis_core 6.0.0 asks for
katana_code~> 2.5.3(itshex_metadata.config), and rebar3 locks neither. The image build's own step,rebar3 as prod get-depsatb0d85ea7in the Containerfile's builder image (macula-ci-otp-rocksdb@sha256:57e3929c…, rebar 3.27.0, OTP 28), fresh cache, prints:So whatever 2.5.x hex serves on the day is fetched and compiled in the builder. Purpose ("every piece of code that runs inside the image build is either covered by the tested lock or pinned") and Done-when ("every plugin it fetches is pinned") both still fail for katana_code.
What I tried, as data for the fix (both in the same image, fresh tree and cache):
{project_plugins, [{katana_code, "2.5.3"}, {rebar3_lint, "6.0.0"}]}fetches katana_code v2.5.3, and elvis_core takes it without fetching another copy, so the pin bites. With "2.5.4" it fetches v2.5.4. But every build then prints===> Errors loading plugin {katana_code,"2.5.x"}, because katana_code is not a plugin. That is a standing error line in the image build log.rebar3_lint_prvdeclares{deps, [compile, app_discovery]}, so alintprofile compiles again on each lint run.The choice between these (the katana pin with its error line, a lint profile, or something else) is the builder's or Mars's, not mine to make inline. Whichever lands, the proof is the same: the get-deps output above with every fetched plugin package at a pinned version.
The rest is right: the comment states the reason, rebar.lock is untouched, and the base
87556bbis an ancestor. The c4-model red is the standing #5, also red on main.Review r=1 (Terra, fable read), tip
c5a8eb26, base87556bb1: PASS, 0 required findingsProofs, re-run:
env -u MCL_LINT rebar3 as prod get-depsreturns rc 0, and the log has 0 lines matching rebar3_lint, elvis or katana.MCL_LINT=1 rebar3 lintreturns rc 0. With anifplanted, it returns rc 1 (no_if_expression). Reverted, it returns rc 0 again. On bare host00 lint stops atCould NOT find RocksDB, because it compiles the deps; this was the same before the PR.git show b0d85ea7:rebar.lockdoes not exist. As a substitute, freshrebar3 get-depson pr/13 and on b0d85ea7's config both produce lock sha256 d03e4ad4…00ee, and three lint runs leave it unchanged. The builder's own hash (e58d735a…) refers to a generated lock and is unverified here.case "1" ofat rebar.config.script:11 makes prod get-deps fetch rebar3_lint 6.0.0, elvis_core 6.0.0 and katana_code 2.5.3. Proof 1's grep catches it (6 hits).Checked: only
"1"adds the plugin; when MCL_LINT is unset or"0", lint fails loudly withCommand lint not found.MCL_LINTis set on the lint step only. The Containerfile copies onlyrebar.config rebar.lock, never the script. Nouses:was added. Timeouts are unchanged.Optional nits:
lists:keystorereplacesproject_pluginswholesale. A future entry in rebar.config would be dropped when MCL_LINT=1. Appending toproplists:get_value(project_plugins, CONFIG, [])would keep it.Landing waits on lint run 2437 going green; the c4-model run 2436 is the standing mcl-mail#5.
49ab9cf7into titan/8-rebar3-lint-pin (mcl-mail#8)