Skip to content

feat: auto-regenerate super-linter version mapping on Renovate bumps#102

Closed
zeitlinger wants to merge 25 commits intomainfrom
feat/auto-regenerate-versions
Closed

feat: auto-regenerate super-linter version mapping on Renovate bumps#102
zeitlinger wants to merge 25 commits intomainfrom
feat/auto-regenerate-versions

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

@zeitlinger zeitlinger commented Mar 11, 2026

Will likely close in favor of #139

Summary

Depends on #93 being merged first.

Blocked on grafana/deployment_tools#521751.

Test plan

- Add --native flag to super-linter.sh for fast local dev feedback
  (subset of linters, changed files only, same env file config)
- Add --full flag to lint all files instead of only changed files
- Add lint hint on failure suggesting `mise run fix`
- Add setup tasks for installing native lint tools (mise -E)
- Add version extraction script for super-linter tool versions
- Switch flint's own super-linter.env to allow-list pattern
- Cache file list per native run to avoid repeated git commands
- Warn about unsupported VALIDATE_* flags in native mode
Signed-off-by: Gregor Zeitlinger <[email protected]>
Add pre-commit and setup:pre-commit-hook tasks that use native
linting with autofix for fast pre-commit feedback. Document
setup for both flint and consuming repos.
Signed-off-by: Gregor Zeitlinger <[email protected]>
Previously skipped tools were only shown when another linter
failed, making it easy to miss that tools like shfmt weren't
installed.
Signed-off-by: Gregor Zeitlinger <[email protected]>
- Use mapfile for cached file list (robust for edge cases)
- Wire golangci-lint to diff mode via --new-from-rev
- Document --full flag in README and AGENTS.md
Signed-off-by: Gregor Zeitlinger <[email protected]>
The config change detection in links.sh treated any mise.toml
modification as a config change, triggering a full link check.
This caused unnecessary 429 rate limiting on Renovate branches
that only bump tool versions.

Now mise.toml is checked content-aware: only lychee-related
lines (version or task config) trigger a full check. Also
lower max_concurrency from 4 to 1 to reduce GitHub rate
limiting on legitimate full checks.
Signed-off-by: Gregor Zeitlinger <[email protected]>
- Convert supported native linters to bullet list (README.md)
- Add workflow to regenerate version mapping on Renovate bumps
- Refactor _find_files to use array params, eliminating 2 SC2086 suppressions
- Add comment explaining why FLINT_REF defaults to main
Signed-off-by: Gregor Zeitlinger <[email protected]>
Instead of defaulting to main, extract the flint commit SHA
from task file URLs in the consuming repo's mise.toml. Falls
back to main for flint itself where tasks are local paths.
Signed-off-by: Gregor Zeitlinger <[email protected]>
Copilot AI review requested due to automatic review settings March 11, 2026 12:18
Pull out generate-super-linter-versions.yml into a follow-up PR.
Until Renovate postUpgradeTasks support lands, document the manual
step for regenerating version mappings after super-linter bumps.
Signed-off-by: Gregor Zeitlinger <[email protected]>
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

Adds automation and developer tooling around the pinned SUPER_LINTER_VERSION, so version mappings and (optionally) local native linting stay aligned with Renovate-driven bumps.

Changes:

  • Add a GitHub Actions workflow that regenerates super-linter-versions/*.toml on Renovate branch pushes when SUPER_LINTER_VERSION changes.
  • Add/extend mise tasks and scripts for native linting and for generating/installing native tool version mappings.
  • Update documentation and lint configuration to support native mode and pre-commit usage.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tasks/setup/update-super-linter-versions.sh Generates TOML tool-version mappings by scraping the super-linter repo.
tasks/setup/native-lint-tools.sh Installs native toolchain via mise using the generated version mapping.
tasks/lint/super-linter.sh Adds --native and --full; implements native lint execution and container VALIDATE_ALL_CODEBASE wiring.
super-linter-versions/v8.4.0.toml Adds the version mapping file for the pinned super-linter release.
mise.toml Adds tasks for native linting, mapping generation, and a pre-commit hook generator.
README.md Documents native mode, pre-commit hook setup, and auto-regeneration behavior.
AGENTS.md Updates contributor guidance to describe native mode and pre-commit workflow.
.gitignore Ignores generated .mise.super-linter-*.toml files.
.github/workflows/generate-super-linter-versions.yml New workflow to regenerate and commit version mappings on Renovate bumps.
.github/renovate-tracked-deps.json Tracks the new workflow for Renovate dependency updates.
.github/config/super-linter.env Switches to an allow-list style set of VALIDATE_* flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tasks/setup/native-lint-tools.sh Outdated
Comment thread tasks/setup/update-super-linter-versions.sh
Comment thread .github/config/super-linter.env
Comment thread .github/workflows/generate-super-linter-versions.yml Outdated
Comment thread tasks/lint/super-linter.sh
Comment thread tasks/lint/super-linter.sh
Comment thread tasks/lint/super-linter.sh
The global remap of all GitHub /blob/ URLs to raw.githubusercontent.com
breaks when the URL points to a directory (GitHub serves these fine
via redirect, but raw returns 404).

Keep same-repo remaps (build_remap_args) which are safe because those
paths exist in the checkout. Remove cross-repo blob remaps from
build_global_github_args, keeping only the issue/PR comment anchor
stripping.
Signed-off-by: Gregor Zeitlinger <[email protected]>
Pull out generate-super-linter-versions.yml into a follow-up PR.
Until Renovate postUpgradeTasks support lands, document the manual
step for regenerating version mappings after super-linter bumps.
Signed-off-by: Gregor Zeitlinger <[email protected]>
Add a GitHub Actions workflow that triggers on Renovate branches
when mise.toml changes. If SUPER_LINTER_VERSION was bumped, it
runs setup:update-super-linter-versions and commits the updated
TOML to the same branch.
Signed-off-by: Gregor Zeitlinger <[email protected]>
@zeitlinger zeitlinger force-pushed the feat/auto-regenerate-versions branch from 5462a5f to 7f302cf Compare March 11, 2026 12:50
@zeitlinger zeitlinger marked this pull request as draft March 13, 2026 13:36
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Mar 19, 2026

CLA assistant check
All committers have signed the CLA.

Resolve conflicts after #93 merge, taking main's evolved versions
for native linting (env var propagation, mise env activation,
stricter missing-tool handling) while keeping the automation
workflow description in RELEASING.md.
- Use git status --porcelain instead of git diff --quiet in workflow
  so untracked files (first-time TOML generation) are detected
- Remove VALIDATE_PYTHON_ISORT (Ruff handles import sorting)
- Add --cached to _list_files so staged files are linted in pre-commit
- Replace grep -oP (PCRE) with sed for macOS compatibility
- Break long line in workflow to satisfy editorconfig max_line_length
- Remove extra blank lines flagged by shfmt
- Auto-create .mise.super-linter-*.toml from tracked version mapping
  when it doesn't exist (e.g., in git worktrees)
- Fail with a clear error message when mise env activation fails
  instead of silently skipping tools
@zeitlinger zeitlinger marked this pull request as ready for review March 31, 2026 12:40
@zeitlinger zeitlinger requested a review from a team as a code owner March 31, 2026 12:40
@zeitlinger zeitlinger marked this pull request as draft March 31, 2026 12:41
…iles change

links.sh: faulty merge conflict resolution accidentally dropped the
cross-repo blob→raw remap logic. Reset to match main.

super-linter.sh: move --cached staged-files fix to a separate PR.
@zeitlinger zeitlinger marked this pull request as ready for review March 31, 2026 13:48
Comment on lines +16 to +17
permissions:
contents: write
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CI won't run using the default token - we'd need to use a GitHub app.

Comment on lines +31 to +32
git fetch origin main
if git diff origin/main -- mise.toml | grep -q 'SUPER_LINTER_VERSION'; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can avoid hard-coding the branch name by using github.event.repository.default_branch from the workflow.

Comment on lines +55 to +56
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These can be derived from the GitHub API for the current PAT, rather than hard-coded.

For example:

app_name="YOUR_GITHUB_APP_NAME"
echo "Git user name: ${app_name}[bot]"
echo "Git user email: $(gh api "/users/${app_name}[bot]" --jq ".id")+${app_name}[bot]@users.noreply.github.com"

@zeitlinger zeitlinger marked this pull request as draft April 2, 2026 14:11
@zeitlinger
Copy link
Copy Markdown
Member Author

close in favor of #139

@zeitlinger zeitlinger closed this Apr 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