Skip to content

Skip untracked files - #76

Merged
perryqh merged 4 commits into
mainfrom
ph.different-approach-for-untracked-files-opt-in
Aug 20, 2025
Merged

Skip untracked files#76
perryqh merged 4 commits into
mainfrom
ph.different-approach-for-untracked-files-opt-in

Conversation

@perryqh

@perryqh perryqh commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

Skip untracked files by finding tracked files and only including them in CODEOWNER rules/validations

@github-project-automation github-project-automation Bot moved this to Triage in Modularity Aug 19, 2025
@perryqh perryqh changed the title Presence of .codeowners-skip-untracked-files skips untracked files .codeowners.yml for skipping untracked files Aug 19, 2025
@perryqh
perryqh force-pushed the ph.different-approach-for-untracked-files-opt-in branch from e3ae9d8 to 34ee191 Compare August 19, 2025 14:44
@perryqh
perryqh force-pushed the ph.different-approach-for-untracked-files-opt-in branch from 34ee191 to 1b87d0f Compare August 19, 2025 15:13
@perryqh
perryqh marked this pull request as draft August 19, 2025 15:59
@perryqh
perryqh marked this pull request as ready for review August 19, 2025 20:08
@perryqh perryqh changed the title .codeowners.yml for skipping untracked files Skip untracked files Aug 19, 2025

@jackboberg jackboberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Command Mean [s] Min [s] Max [s] Relative
../rubyatscale/codeowners-rs/target/release/codeowners gv 3.131 ± 0.055 3.098 3.194 1.00
bin/codeownership validate 3.347 ± 0.027 3.317 3.367 1.07 ± 0.02

@perryqh
perryqh merged commit 8734913 into main Aug 20, 2025
9 checks passed
@github-project-automation github-project-automation Bot moved this from Triage to Done in Modularity Aug 20, 2025
@perryqh
perryqh deleted the ph.different-approach-for-untracked-files-opt-in branch September 5, 2025 03:36
dduugg added a commit that referenced this pull request Jul 27, 2026
)

rubyatscale/code_ownership#149: adding a new team was silently ignored
until the new team.yml was `git add`-ed. The project walk deliberately
excludes untracked files (codeowners-rs#46/#74/#76 - so a developer can
keep scratch files around locally without validate forcing them to
assign an owner), but that exclusion also covered team config files,
which define real ownership rules the moment they exist rather than
being scratch work anyone would leave uncommitted on purpose.

Exempt files matching `team_file_glob` from the tracked-files check
specifically, leaving ordinary source files subject to it as before.
Reproduced the exact bug against a real build first (a new team owning
an already-tracked file, e.g. README.md, was reported unowned because
the team file disappeared from the walk while README.md - already
committed - did not), confirmed a fix, then found and preserved a
directly conflicting existing test (test_skip_untracked_files) that
relies on the untracked-scratch-file behavior on purpose, which a
first, broader attempt at this fix would have silently regressed.

Added two tests: one reproducing #149 end to end (new untracked team
+ existing tracked file -> validate succeeds), and one pinning that an
untracked *source* file (non-team) is still correctly ignored, so the
scoped nature of this fix doesn't regress by accident later.

Verified: full `cargo test` suite (all 83+ tests, including the
pre-existing test_skip_untracked_files), cargo clippy --all-targets,
and cargo fmt --check all clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants