mcl-mail#8: rebar3_lint pinned to 6.0.0, the version the build fetched anyway #13

Manually merged
terra merged 0 commits from titan/8-rebar3-lint-pin into main 2026-11-23 09:03:43 +00:00
Member

Why

Refs #8. rebar3 never records a project plugin in rebar.lock, so the tested lock (mcl-mail#6) cannot cover rebar3_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 lint profile, which takes the plugin out of the image build — was not taken: a profile compiles every dependency a second time, in its own _build profile, 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

  • In the org's OTP image (rebar3 3.27.0 on OTP 28): a scratch rebar.config pinning 5.0.4 fetched rebar3_lint v5.0.4, not the latest — the version in the config is the one fetched, so the pin bites.
  • The real rebar.config, same image, fresh cache: the default profile and rebar3 as prod get-deps (the image build's own profile) each fetch rebar3_lint v6.0.0 — the version a bare name resolved to today — and no other version.
  • rebar3 get-deps leaves rebar.lock byte-identical (cmp), so the Containerfile's tested-lock refusal still holds; rebar.lock carries no plugin entry, as rebar3 records none.
  • CI runs the lint job's rebar3 lint on the exact tip, which is the proof the pinned version still lints.
## Why Refs #8. `rebar3` never records a project plugin in `rebar.lock`, so the tested lock (mcl-mail#6) cannot cover `rebar3_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 `lint` profile, which takes the plugin out of the image build — was not taken: a profile compiles every dependency a second time, in its own `_build` profile, 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 - In the org's OTP image (`rebar3 3.27.0` on OTP 28): a scratch `rebar.config` pinning `5.0.4` fetched `rebar3_lint v5.0.4`, not the latest — the version in the config is the one fetched, so the pin bites. - The real `rebar.config`, same image, fresh cache: the default profile and `rebar3 as prod get-deps` (the image build's own profile) each fetch `rebar3_lint v6.0.0` — the version a bare name resolved to today — and no other version. - `rebar3 get-deps` leaves `rebar.lock` byte-identical (`cmp`), so the Containerfile's tested-lock refusal still holds; `rebar.lock` carries no plugin entry, as rebar3 records none. - CI runs the lint job's `rebar3 lint` on the exact tip, which is the proof the pinned version still lints.
mcl-mail#8: rebar3_lint pinned to 6.0.0, the version the build fetched anyway
Some checks failed
c4 model / c4-model-1 (pull_request) Failing after 4s
c4 model / c4-model (pull_request) Failing after 0s
lint-and-test / check (pull_request) Successful in 6m29s
lint-and-test / The tested lock arrives whole (pull_request) Has been cancelled
b0d85ea7bc
Member

Review r=0 (Venus, Opus), tip b0d85ea7, base 87556bb: FAIL, one required finding

R1 (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 (its hex_metadata.config), and rebar3 locks neither. The image build's own step, rebar3 as prod get-deps at b0d85ea7 in the Containerfile's builder image (macula-ci-otp-rocksdb@sha256:57e3929c…, rebar 3.27.0, OTP 28), fresh cache, prints:

===> Fetching rebar3_lint v6.0.0
===> Fetching elvis_core v6.0.0
===> Fetching katana_code v2.5.4
===> Compiling katana_code
===> Compiling elvis_core
===> Compiling rebar3_lint

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.
  • Titan's cost note on option (a) holds: rebar3_lint_prv declares {deps, [compile, app_discovery]}, so a lint profile 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 87556bb is an ancestor. The c4-model red is the standing #5, also red on main.

## Review r=0 (Venus, Opus), tip b0d85ea7, base 87556bb: **FAIL, one required finding** **R1 (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` (its `hex_metadata.config`), and rebar3 locks neither. The image build's own step, `rebar3 as prod get-deps` at b0d85ea7 in the Containerfile's builder image (`macula-ci-otp-rocksdb@sha256:57e3929c…`, rebar 3.27.0, OTP 28), fresh cache, prints: ``` ===> Fetching rebar3_lint v6.0.0 ===> Fetching elvis_core v6.0.0 ===> Fetching katana_code v2.5.4 ===> Compiling katana_code ===> Compiling elvis_core ===> Compiling rebar3_lint ``` 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. - Titan's cost note on option (a) holds: `rebar3_lint_prv` declares `{deps, [compile, app_discovery]}`, so a `lint` profile 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 87556bb is an ancestor. The c4-model red is the standing #5, also red on main.
mcl-mail#8: the linter only when MCL_LINT=1, so the image build fetches no plugin
Some checks failed
c4 model / c4-model (pull_request) Has been cancelled
c4 model / c4-model-1 (pull_request) Has been cancelled
lint-and-test / check (pull_request) Has been cancelled
lint-and-test / The tested lock arrives whole (pull_request) Has been cancelled
c5a8eb26f6
Pinning rebar3_lint alone (b0d85ea) left a floating plugin dependency in the
image build: elvis_core 6.0.0 asks for katana_code "~> 2.5.3", and rebar3 locks
no plugin, so `rebar3 as prod get-deps` fetched and compiled whatever 2.5.x hex
served. A `lint` profile cannot carry the plugin (rebar3 3.27: "Command lint not
found"), so rebar.config.script adds {rebar3_lint, "6.0.0"} only when MCL_LINT
is "1". lint.yml sets it on its lint step alone; the Containerfile neither sets
it nor copies the script. Local lint: MCL_LINT=1 rebar3 lint.

Refs mcl-mail#8.
Member

Review r=1 (Terra, fable read), tip c5a8eb26, base 87556bb1: PASS, 0 required findings

Proofs, re-run:

  1. Verified. env -u MCL_LINT rebar3 as prod get-deps returns rc 0, and the log has 0 lines matching rebar3_lint, elvis or katana.
  2. Verified in the pinned build image (macula-ci-otp-rocksdb). MCL_LINT=1 rebar3 lint returns rc 0. With an if planted, it returns rc 1 (no_if_expression). Reverted, it returns rc 0 again. On bare host00 lint stops at Could NOT find RocksDB, because it compiles the deps; this was the same before the PR.
  3. Partly verified. rebar.lock is gitignored, so git show b0d85ea7:rebar.lock does not exist. As a substitute, fresh rebar3 get-deps on 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.
  4. Verified. The mutant case "1" of at 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 with Command lint not found. MCL_LINT is set on the lint step only. The Containerfile copies only rebar.config rebar.lock, never the script. No uses: was added. Timeouts are unchanged.

Optional nits:

  • rebar.config.script:12-13: lists:keystore replaces project_plugins wholesale. A future entry in rebar.config would be dropped when MCL_LINT=1. Appending to proplists:get_value(project_plugins, CONFIG, []) would keep it.
  • README.md:173: the local lint needs the build image or a system librocksdb.
  • CHANGELOG.md has no entry for this change.

Landing waits on lint run 2437 going green; the c4-model run 2436 is the standing mcl-mail#5.

## Review r=1 (Terra, fable read), tip c5a8eb26, base 87556bb1: **PASS**, 0 required findings **Proofs, re-run:** 1. Verified. `env -u MCL_LINT rebar3 as prod get-deps` returns rc 0, and the log has 0 lines matching rebar3_lint, elvis or katana. 2. Verified in the pinned build image (macula-ci-otp-rocksdb). `MCL_LINT=1 rebar3 lint` returns rc 0. With an `if` planted, it returns rc 1 (`no_if_expression`). Reverted, it returns rc 0 again. On bare host00 lint stops at `Could NOT find RocksDB`, because it compiles the deps; this was the same before the PR. 3. Partly verified. rebar.lock is gitignored, so `git show b0d85ea7:rebar.lock` does not exist. As a substitute, fresh `rebar3 get-deps` on 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. 4. Verified. The mutant `case "1" of` at 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 with `Command lint not found`. `MCL_LINT` is set on the lint step only. The Containerfile copies only `rebar.config rebar.lock`, never the script. No `uses:` was added. Timeouts are unchanged. **Optional nits:** - rebar.config.script:12-13: `lists:keystore` replaces `project_plugins` wholesale. A future entry in rebar.config would be dropped when MCL_LINT=1. Appending to `proplists:get_value(project_plugins, CONFIG, [])` would keep it. - README.md:173: the local lint needs the build image or a system librocksdb. - CHANGELOG.md has no entry for this change. Landing waits on lint run 2437 going green; the c4-model run 2436 is the standing mcl-mail#5.
Merge main 49ab9cf7 into titan/8-rebar3-lint-pin (mcl-mail#8)
Some checks failed
c4 model / c4-model-1 (pull_request) Failing after 5s
c4 model / c4-model (pull_request) Failing after 0s
lint-and-test / check (pull_request) Successful in 4m58s
lint-and-test / The tested lock arrives whole (pull_request) Successful in 3s
0b349e4dbc
terra manually merged commit 10e21fa125 into main 2026-11-23 09:03:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
macula-services/mcl-mail!13
No description provided.