LIBTRACK-137 Resolve gemspec ownership from owned_globs, not CODEOWNERS#38
Merged
naarok merged 1 commit intoJun 12, 2026
Conversation
The nightly gemfile analysis crashed in add_ownership_from_gemspecs with "undefined method 'raw_hash' for nil", aborting the static-analysis rake task before LibraryTracking.upload ran. That is why the Jobber gemfile project stopped updating. Root cause: code_ownership 2.x made CodeOwnership.for_file default to from_codeowners: true, which resolves ownership from the generated .github/CODEOWNERS file. Jobber hand-curates CODEOWNERS (skip_codeowners_validation: true), so it contains no gems/** entries and for_file returned nil for every gemspec. The code then called team.raw_hash on nil. Pass from_codeowners: false so ownership is resolved from the team owned_globs config (every Jobber gemspec is in fact owned). Also resolve the owner once per gemspec and skip with a warning if a gemspec ever genuinely has no owner, so a single unowned file can no longer crash the whole run. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Amplify 2.1.3 <amplify@getjobber.com>
6f8b403 to
8aae394
Compare
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.
What's in this PR?
The nightly gemfile analysis was crashing before it uploaded anything to Library Tracking, which is why the Jobber gemfile project stopped updating.
add_ownership_from_gemspecsresolves a code owner for everygems/**/*.gemspecviaCodeOwnership.for_file, then readsteam.raw_hash. The call was returningnil, sonil.raw_hashraisedundefined method 'raw_hash' for nil. Because this runs near the end of the gemfile pass, the exception bubbled up and killed the wholestatic_analysis:code_analyzerrake task beforeLibraryTracking.uploadran.Root cause:
code_ownership2.x changedCodeOwnership.for_fileto default tofrom_codeowners: true, resolving ownership from the generated.github/CODEOWNERSfile. Jobber hand-curates CODEOWNERS (skip_codeowners_validation: true), so it has nogems/**entries — andfor_filereturnednilfor every gemspec. The gemspecs themselves are correctly owned via teamowned_globs.This passes
from_codeowners: falseso ownership is resolved from theowned_globsconfig (all Jobber gemspecs resolve to a team). It also resolves the owner once per gemspec and skips with a warning if a gemspec ever genuinely has no owner, so a single unowned file can't crash the whole run again.QA Instructions
gems/**, the gemfile analysis no longer crashes and assigns each gem dependency its gemspec owner's group (resolved fromowned_globs).References
code_ownership2.x bump (GetJobber/Jobber#72435)Co-Authored-By: Amplify 2.1.3 amplify@getjobber.com