feat: use Bazel target label as codeowners fallback path#1116
Open
dfrankland wants to merge 1 commit into
Open
feat: use Bazel target label as codeowners fallback path#1116dfrankland wants to merge 1 commit into
dfrankland wants to merge 1 commit into
Conversation
When a JUnit XML produced by Bazel has no `file` or `filepath` attribute, there's no source path to use for CODEOWNERS association. The Bazel label (e.g. `//pkg/path:target`) is available from the BEP and its package component (`pkg/path`) maps directly to a repo directory that CODEOWNERS patterns can match against. Adds `--use-bazel-target-for-codeowners` (env: `TRUNK_CODEOWNERS_USE_BAZEL_TARGET`, default false) to opt into this fallback. When enabled, `into_test_case_runs` derives the lookup path from the label if no file attr is present. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1116 +/- ##
==========================================
+ Coverage 82.14% 82.40% +0.25%
==========================================
Files 69 69
Lines 15243 15291 +48
==========================================
+ Hits 12522 12601 +79
+ Misses 2721 2690 -31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--use-bazel-target-for-codeownersflag (env:TRUNK_CODEOWNERS_USE_BAZEL_TARGET, defaultfalse) to opt into using the Bazel label as a fallback for CODEOWNERS associationfile/filepathXML attribute, the package portion of the Bazel label (//pkg/path:target→pkg/path) is used as the lookup path against CODEOWNERSbazel_label: Option<&str>parameter tointo_test_case_runs; abazel_label_to_package_pathhelper handles the conversion and returnsNonefor root-level targets (//:target)generate_internal_file_from_bepand the non-BEP path ingenerate_internal_filerespect the flagTest plan
bazel_label_to_package_pathcovering standard labels, root-level targets, and labels without//cli/tests/upload.rsusing a BEP fixture with nofileattributes:upload_bundle_using_bep_with_bazel_label_codeowners_fallback— flag on, asserts codeowners populated from label package pathupload_bundle_using_bep_without_bazel_label_codeowners_fallback— flag off (default), asserts codeowners empty🤖 Generated with Claude Code