refactor!: drop --fast-only flag and tighten renovate-deps timing#270
refactor!: drop --fast-only flag and tighten renovate-deps timing#270zeitlinger merged 18 commits intomainfrom
Conversation
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
|
Upstream follow-up is open at renovatebot/renovate#43129 . Once that lands and is available in the Renovate version Flint runs, the local runtime loader workaround in this PR can be removed. |
1 similar comment
|
Upstream follow-up is open at renovatebot/renovate#43129 . Once that lands and is available in the Renovate version Flint runs, the local runtime loader workaround in this PR can be removed. |
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses regressions in fix-mode timing output and optimizes renovate-deps execution by avoiding unnecessary Renovate lookups, skipping renovate-deps on irrelevant changed-file runs, and only escalating from extract-only runs to lookup when rule-coverage validation needs missing package identity metadata.
Changes:
- Preserve
--timeoutput inflint run --fixby carrying fullCheckResultdata through fix-mode summarization. - Make
renovate-depsrelevance-aware for changed-file runs and introduce conditional metadata lookup logic (extract by default; lookup only when required). - Add an extract-mode workaround patch injection via
NODE_OPTIONS --import=...for Renovate local dry-run behavior, and expand/adjust tests accordingly.
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cases/renovate-deps/metadata-stale-lint-fails/test.toml | Adds case asserting stale metadata fails lint in extract mode. |
| tests/cases/renovate-deps/metadata-stale-lint-fails/files/renovate.json5 | Renovate config fixture for stale-metadata scenario. |
| tests/cases/renovate-deps/metadata-stale-lint-fails/files/renovate-tracked-deps.json | Snapshot fixture missing meta to trigger stale-metadata behavior. |
| tests/cases/renovate-deps/metadata-stale-lint-fails/files/mise.toml | Installs Renovate for the test fixture. |
| tests/cases/renovate-deps/metadata-stale-fix-refreshes/test.toml | Adds case asserting fix triggers lookup and refreshes snapshot. |
| tests/cases/renovate-deps/metadata-stale-fix-refreshes/files/renovate.json5 | Renovate config fixture for fix-refresh scenario. |
| tests/cases/renovate-deps/metadata-stale-fix-refreshes/files/renovate-tracked-deps.json | Snapshot fixture to be updated by fix path. |
| tests/cases/renovate-deps/metadata-stale-fix-refreshes/files/mise.toml | Installs Renovate for the test fixture. |
| tests/cases/renovate-deps/metadata-fresh-fix-stays-fast/test.toml | Adds case asserting fix remains extract-only when metadata is sufficient. |
| tests/cases/renovate-deps/metadata-fresh-fix-stays-fast/files/renovate.json5 | Renovate config fixture for metadata-fresh scenario. |
| tests/cases/renovate-deps/metadata-fresh-fix-stays-fast/files/renovate-tracked-deps.json | Snapshot fixture including meta so lookup is unnecessary. |
| tests/cases/renovate-deps/metadata-fresh-fix-stays-fast/files/mise.toml | Installs Renovate for the test fixture. |
| tests/cases/renovate-deps/irrelevant/test.toml | Adds case asserting renovate is not invoked for unrelated changes. |
| tests/cases/renovate-deps/irrelevant/files/README.md | Unrelated-change fixture file. |
| tests/cases/renovate-deps/irrelevant/files/package.json | Unrelated-change fixture file. |
| tests/cases/renovate-deps/irrelevant/files/mise.toml | Toolchain fixture including Renovate. |
| tests/cases/renovate-deps/irrelevant/files/.github/renovate.json5 | Renovate config fixture for irrelevant scenario. |
| tests/cases/renovate-deps/irrelevant/files/.github/renovate-tracked-deps.json | Snapshot fixture ensuring relevance logic can evaluate tracked files. |
| tests/cases/renovate-deps/full-slow-lookup-when-rule-needs-meta/test.toml | Adds case asserting lookup happens when rule coverage needs missing meta. |
| tests/cases/renovate-deps/full-slow-lookup-when-rule-needs-meta/files/renovate.json5 | Renovate config fixture using matchers that require meta. |
| tests/cases/renovate-deps/full-slow-lookup-when-rule-needs-meta/files/renovate-tracked-deps.json | Snapshot fixture lacking meta to force lookup. |
| tests/cases/renovate-deps/full-slow-lookup-when-rule-needs-meta/files/mise.toml | Installs Renovate for the test fixture. |
| tests/cases/renovate-deps/full-fast-extract-only/test.toml | Adds case asserting full run stays extract-only when meta is sufficient. |
| tests/cases/renovate-deps/full-fast-extract-only/files/renovate.json5 | Renovate config fixture for fast extract-only scenario. |
| tests/cases/renovate-deps/full-fast-extract-only/files/renovate-tracked-deps.json | Snapshot fixture with meta so lookup is unnecessary. |
| tests/cases/renovate-deps/full-fast-extract-only/files/mise.toml | Installs Renovate for the test fixture. |
| tests/cases/renovate-deps/fix-up-to-date/test.toml | Adds case asserting fix is a no-op when snapshot is current. |
| tests/cases/renovate-deps/fix-up-to-date/files/renovate-tracked-deps.json | Snapshot fixture for up-to-date scenario. |
| tests/cases/renovate-deps/fix-up-to-date/files/package.json | Dependency fixture used by snapshot relevance. |
| tests/cases/renovate-deps/fix-up-to-date/files/mise.toml | Installs Renovate for the test fixture. |
| tests/cases/renovate-deps/fix-up-to-date/files/.renovaterc.json | Renovate config fixture for up-to-date scenario. |
| tests/cases/general/time-flag-fix/test.toml | Adds case asserting --fix --time prints timing consistently. |
| tests/cases/general/time-flag-fix/files/mise.toml | Tool fixtures for time-flag test. |
| tests/cases/general/time-flag-fix/files/good.sh | Shell fixture file for time-flag test. |
| src/runner.rs | Adds Clone to CheckResult and threads verbose into native run context. |
| src/registry/types.rs | Extends NativeRunContext with verbose. |
| src/main.rs | Fix-mode summary now retains per-check duration/output and prints timing when requested. |
| src/linters/renovate_deps/tests.rs | Adds unit tests for metadata-lookup decisions and extract workaround env injection. |
| src/linters/renovate_deps/rules.rs | Implements metadata_lookup_reason and supporting logic for deciding when lookup is required. |
| src/linters/renovate_deps/mod.rs | Skips irrelevant changed-file runs; uses extract by default and lookup only when needed; passes verbosity through. |
| src/linters/renovate_deps/install_patch.rs | Introduces extract-only Renovate loader/register injection workaround. |
| src/config.rs | Removes refresh_meta config option from RenovateDepsConfig. |
| docs/linters/renovate-deps.md | Updates docs to reflect new extract/lookup behavior and removal of refresh-meta env var. |
| .github/renovate-tracked-deps.json | Updates tracked deps snapshot content (meta shape change for an entry). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Summary - make non-CI `flint run` use the filtered local selection by default - keep CI, `--full`, and explicit linter names on the broader path - drop `--fast-only` from generated local hook/init guidance and document the new behavior ## Testing - cargo test - mise run lint:fix
Local `flint run` already filtered by default; CI runs everything. The flag added surface area (CLI, env var, fixtures, enum branches) without behavior worth keeping — only `renovate-deps` opted in, and it self-gates via `adaptive_relevance`. Removed: - `--fast-only` / `FLINT_FAST_ONLY` - `RunPolicy` enum and `run_policy` field on `Check` - `.adaptive()` builder; `Check::slow()` now only sets the init category - `filtered_run_policy` plumbing through runner and prepare context - redundant prepare-step relevance gate in renovate-deps - 3 fast-only fixture cases `Category::Slow` kept — it gates `flint init` profile membership (comprehensive-only), independent of run-time behavior. README restructured: noob-friendly Day-to-day section, new Adaptive runs reference section. renovate-deps page gets a "When does this run?" change/local/CI table. BREAKING CHANGE: `--fast-only` and `FLINT_FAST_ONLY` are removed. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…ps-timing # Conflicts: # src/main.rs
- install_patch: use tempfile::Builder for a randomized private dir, cached in a OnceLock per process — closes the predictable-path symlink/TOCTOU vector - renovate_deps::run: drop unused extracted clone, bind directly to mut generated - format_duration_suffix: deduplicate, expose runner copy as pub(crate), drop main.rs duplicate Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Extract-only doesn't always emit datasource (e.g. bare-key mise tools resolved through aqua), which silently writes partial meta and can drift Renovate's grouping behavior over time. Fix mode now always regenerates via --dry-run=lookup so every meta entry carries both packageName and datasource. - run_inner: dry_run = "lookup" when fix, "extract" otherwise - non-fix path keeps cheap extract + committed-meta merge, plus a pre-trim incomplete_meta_for_rules check that bails with a clear "run --fix" hint when committed meta is gappy - post-trim missing_meta_field sanity check covers both modes - drop now-redundant config_changed plumbing (no consumer left) - drop unused metadata_lookup_reason / dep_metadata_lookup_reason and associated tests; replaced with missing_meta_field tests - update fixtures: metadata-stale-fix-refreshes goes from extract/extract/lookup (3 calls) to extract/lookup (2 calls) Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Bare-key mise tools that resolve via aqua don't surface a datasource in Renovate's --dry-run output, leaving partial meta in the snapshot. The strict meta validation in renovate-deps now requires every meta entry to have datasource, so add explicit regex customManagers for these two bare-key tools so the snapshot is complete. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
…format" This reverts commit 8f3e986. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
… rules Strict "every meta entry must have datasource" can't hold against real Renovate output: bare-key mise tools like biome and google-java-format resolve through aqua but Renovate's --dry-run output doesn't surface a datasource for them, even in lookup mode. The actual correctness constraint: - packageName is required for any dep referenced by a packageRule - datasource is additionally required only for deps matched via matchPackageNames, where Renovate groups by (packageName, datasource) - matchDepNames rules match by name regardless of datasource This matches Renovate's grouping semantics and lets the linter pass against real lookup output without forcing custom regex managers for every bare-key mise tool. Drops the post-trim missing_meta_field strict check; folds the verification into the single pre-trim incomplete_meta_for_rules pass that runs in both modes. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
## Summary - Pass `--git-token` and `--forge github` to `release-plz release` and `release-plz release-pr` from the workflow as usage args. - Extract `release:pr` from inline `mise.toml` to `.mise/tasks/release/pr` so it can forward variadic args the same way `release:create` already does. ## Why release-plz 0.3.x requires explicit `--git-token` and `--forge` for both `release` and `release-pr`. Without them, both fail with: ```text ERROR git release not configured. Did you specify git-token and forge? ``` Every release-plz workflow run since [#234](#234) has been failing for that reason, leaving release PR [#242](#242) stuck on its 2026-04-28 snapshot. After this merges, the next push to `main` will refresh #242 with all merged commits since. ## Test plan - [ ] CI green on this PR - [ ] After merge, next push to `main` refreshes #242 with all merged commits + correct version bump (note: `#270` was `refactor!` so the bump should be a major increment per release-plz semantics) --------- Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
What changed
This updates two regressions in Flint's newer runner and
renovate-depsbehavior:--timeoutput inflint run --fixby carrying real per-check results through fix-mode reportingrenovate-depsentirely on irrelevant changed-file runsrenovate-depson the cheap--dry-run=extractpath by default, and only escalate to alookuprun when package-rule coverage validation still needs missing package identity metadataWhy
Two issues showed up in follow-up testing:
flint run --fix --timeaccepted the flag but fix-mode reporting dropped the timing output because the fix summary path discarded the runner durationsrenovate-depsalways ran Renovate before deciding whether metadata was actually needed, which made relevant runs slower than intended and also made irrelevant changed-file runs waste workThe desired behavior is:
--fullruns: fast extract-only snapshot by defaultImpact
--fix --timenow prints per-linter timing consistentlyrenovate-depsruns avoid unnecessary lookup work when cached metadata is already sufficientrenovate-deps, but only pays the slower lookup cost when coverage validation truly needs itValidation
cargo testmise run lint:fixgeneral/time-flag-fixrenovate-deps/irrelevantrenovate-deps/full-fast-extract-onlyrenovate-deps/full-slow-lookup-when-rule-needs-meta