Skip to content

refactor!: drop --fast-only flag and tighten renovate-deps timing#270

Merged
zeitlinger merged 18 commits intomainfrom
codex/fix-renovate-deps-timing
May 8, 2026
Merged

refactor!: drop --fast-only flag and tighten renovate-deps timing#270
zeitlinger merged 18 commits intomainfrom
codex/fix-renovate-deps-timing

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

What changed

This updates two regressions in Flint's newer runner and renovate-deps behavior:

  • preserve --time output in flint run --fix by carrying real per-check results through fix-mode reporting
  • skip renovate-deps entirely on irrelevant changed-file runs
  • keep renovate-deps on the cheap --dry-run=extract path by default, and only escalate to a lookup run when package-rule coverage validation still needs missing package identity metadata

Why

Two issues showed up in follow-up testing:

  • flint run --fix --time accepted the flag but fix-mode reporting dropped the timing output because the fix summary path discarded the runner durations
  • after the rule-coverage/meta-caching work, renovate-deps always ran Renovate before deciding whether metadata was actually needed, which made relevant runs slower than intended and also made irrelevant changed-file runs waste work

The desired behavior is:

  • irrelevant changed-file runs: skip
  • relevant or --full runs: fast extract-only snapshot by default
  • metadata lookup: only when rule coverage for deps mentioned by Renovate package rules still requires missing package identity metadata

Impact

  • --fix --time now prints per-linter timing consistently
  • ordinary renovate-deps runs avoid unnecessary lookup work when cached metadata is already sufficient
  • full mode still runs renovate-deps, but only pays the slower lookup cost when coverage validation truly needs it

Validation

  • cargo test
  • mise run lint:fix
  • targeted cases for general/time-flag-fix
  • targeted cases for renovate-deps/irrelevant
  • targeted cases for renovate-deps/full-fast-extract-only
  • targeted cases for renovate-deps/full-slow-lookup-when-rule-needs-meta

zeitlinger added 2 commits May 6, 2026 14:37
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Copy Markdown
Member Author

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
@zeitlinger
Copy link
Copy Markdown
Member Author

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.

zeitlinger added 5 commits May 6, 2026 17:02
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>
@zeitlinger zeitlinger marked this pull request as ready for review May 7, 2026 06:43
@zeitlinger zeitlinger requested a review from a team as a code owner May 7, 2026 06:43
Copilot AI review requested due to automatic review settings May 7, 2026 06:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --time output in flint run --fix by carrying full CheckResult data through fix-mode summarization.
  • Make renovate-deps relevance-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.

Comment thread src/linters/renovate_deps/install_patch.rs
Comment thread src/linters/renovate_deps/install_patch.rs Outdated
Comment thread src/linters/renovate_deps/mod.rs Outdated
Comment thread src/main.rs Outdated
## 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
@zeitlinger zeitlinger marked this pull request as draft May 7, 2026 14:38
zeitlinger added 2 commits May 8, 2026 09:00
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>
@zeitlinger zeitlinger changed the title fix: avoid unnecessary renovate-deps lookups and preserve fix timing refactor!: drop --fast-only flag and tighten renovate-deps timing May 8, 2026
zeitlinger added 8 commits May 8, 2026 09:08
- 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>
@zeitlinger zeitlinger marked this pull request as ready for review May 8, 2026 12:21
@zeitlinger zeitlinger merged commit eddb8dc into main May 8, 2026
12 checks passed
@zeitlinger zeitlinger deleted the codex/fix-renovate-deps-timing branch May 8, 2026 12:41
zeitlinger added a commit that referenced this pull request May 8, 2026
## 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>
This was referenced May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants