Skip to content

LIBTRACK-137 Resolve gemspec ownership from owned_globs, not CODEOWNERS#38

Merged
naarok merged 1 commit into
masterfrom
LIBTRACK-137-jobber-run-says-root-rather-than-gemfile-and-npm
Jun 12, 2026
Merged

LIBTRACK-137 Resolve gemspec ownership from owned_globs, not CODEOWNERS#38
naarok merged 1 commit into
masterfrom
LIBTRACK-137-jobber-run-says-root-rather-than-gemfile-and-npm

Conversation

@naarok

@naarok naarok commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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_gemspecs resolves a code owner for every gems/**/*.gemspec via CodeOwnership.for_file, then reads team.raw_hash. The call was returning nil, so nil.raw_hash raised undefined method 'raw_hash' for nil. Because this runs near the end of the gemfile pass, the exception bubbled up and killed the whole static_analysis:code_analyzer rake task before LibraryTracking.upload ran.

Root cause: code_ownership 2.x changed CodeOwnership.for_file to default to from_codeowners: true, resolving ownership from the generated .github/CODEOWNERS file. Jobber hand-curates CODEOWNERS (skip_codeowners_validation: true), so it has no gems/** entries — and for_file returned nil for every gemspec. The gemspecs themselves are correctly owned via team owned_globs.

This passes from_codeowners: false so ownership is resolved from the owned_globs config (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

  • With a hand-curated CODEOWNERS that omits gems/**, the gemfile analysis no longer crashes and assigns each gem dependency its gemspec owner's group (resolved from owned_globs).
  • A gemspec with no resolvable owner is skipped with a warning naming the file, rather than aborting the run.
  • After a nightly run, the Jobber gemfile project receives an update in Library Tracking.

References

  • LIBTRACK-137
  • Regression introduced by the code_ownership 2.x bump (GetJobber/Jobber#72435)

Co-Authored-By: Amplify 2.1.3 amplify@getjobber.com

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>
@naarok naarok force-pushed the LIBTRACK-137-jobber-run-says-root-rather-than-gemfile-and-npm branch from 6f8b403 to 8aae394 Compare June 12, 2026 16:42
@naarok naarok changed the title LIBTRACK-137 Skip gemspecs without a code owner during gemfile analysis LIBTRACK-137 Resolve gemspec ownership from owned_globs, not CODEOWNERS Jun 12, 2026
@naarok naarok marked this pull request as ready for review June 12, 2026 16:43
@naarok naarok merged commit 5795994 into master Jun 12, 2026
1 check passed
@naarok naarok deleted the LIBTRACK-137-jobber-run-says-root-rather-than-gemfile-and-npm branch June 12, 2026 16:43
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.

1 participant