Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion policy/base/sets.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@
"policy/**",
"README.md",
"third_party/**",
"vendor/**"
"vendor/**",
"**/mise.lock"
],
"exclude_cfg_test": false,
"include": [
Expand Down
7 changes: 6 additions & 1 deletion policy/base/unmanaged-pins.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ Use the package manager, or a manifest entry a dependency bot can read.
"""
regexp = 'releases/download/v?[0-9]'
files.include = ["."]
files.exclude = ["**/tests/**", "**/test/**", "**/*_test.go", "policy/**", "README.md", "third_party/**", "vendor/**"]
# mise.lock is the manifest this message asks for. `mise lock` writes each
# aqua or github tool's artifact as a releases/download URL beside a
# per-platform checksum that `mise install` verifies, and Renovate's mise
# manager rewrites the lock with the row it bumps. The URL there is the
# watched pin, rendered, not the unwatched one.
files.exclude = ["**/tests/**", "**/test/**", "**/*_test.go", "policy/**", "README.md", "third_party/**", "vendor/**", "**/mise.lock"]

[rule.no-pinned-versioned-fetch]
message = """
Expand Down
2 changes: 1 addition & 1 deletion policy/principles.toml
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ files.exclude = ["**/tests/**", "**/test/**", "**/*_test.go", "policy/**", "READ
# line is its rendering. The set's exclude list is repeated for the reason the
# override above gives.
[override.no-pinned-release-download]
files.exclude = ["**/tests/**", "**/test/**", "**/*_test.go", "policy/**", "README.md", "third_party/**", "vendor/**", ".github/workflows/release.yml"]
files.exclude = ["**/tests/**", "**/test/**", "**/*_test.go", "policy/**", "README.md", "third_party/**", "vendor/**", "**/mise.lock", ".github/workflows/release.yml"]

[override.no-pinned-versioned-fetch]
files.exclude = ["**/tests/**", "**/test/**", "**/*_test.go", "policy/**", "README.md", "third_party/**", "vendor/**", ".github/workflows/release.yml"]
25 changes: 25 additions & 0 deletions tests/base_set_corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,31 @@ fn tracker_references_are_refused_in_configuration_and_source() {
}
}

#[test]
fn a_mise_lockfile_is_not_read_by_the_release_download_rule() {
// `mise lock` records each tool's artifact as a releases/download URL
// beside a checksum mise verifies, so the lock is the manifest the rule
// asks for. The script path is the control: the same line is refused
// where nothing watches it.
let line = "url = \"https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_arm64.tar.gz\"\n";
for (path, refused) in [
("install.sh", 1),
("mise.lock", 0),
(".config/mise/mise.lock", 0),
("tools/mise.lock", 0),
] {
let case = Case {
set: "unmanaged-pins",
rule: "no-pinned-release-download",
path,
refuses: &[],
allows: &[],
};
let (code, report) = verdict(&case, line);
assert_eq!(code, refused, "{path}: {report}");
}
}

#[test]
fn a_stylesheet_is_not_read_by_the_code_tracker_rule() {
// `solid #000` is the prose-word arm's shape, and no pattern that keeps
Expand Down
Loading