Skip to content

Fix CD smoke test for platform gems#166

Merged
perryqh merged 1 commit intomainfrom
fix-cd-smoke-test
Apr 17, 2026
Merged

Fix CD smoke test for platform gems#166
perryqh merged 1 commit intomainfrom
fix-cd-smoke-test

Conversation

@perryqh
Copy link
Copy Markdown
Contributor

@perryqh perryqh commented Apr 17, 2026

Why

The x86_64-linux smoke test in the CD workflow has been failing since the most recent dispatch (run 24575979309) with:

Can't open config file: .../config/code_ownership.yml (No such file or directory (os error 2))
  from .../code_ownership/private/team_finder.rb:43:in 'RustCodeOwners.teams_for_files'

The step was calling CodeOwnership.for_file('lib/code_ownership.rb'), which transitively requires config/code_ownership.yml in the process's working directory. This repo intentionally does not ship that file — it was removed in e9f29ac back in 2023.

Why this only showed up now

#157 switched the smoke test from a non-existent method (CodeOwnership.file_owner_team_names) guarded with || true to the real for_file method, and dropped the || true. The pre-#157 version silently raised NoMethodError and exited 0, so it never actually exercised the native extension. Because the CD workflow only runs on workflow_dispatch/workflow_call, the regression didn't surface until the next real dispatch — which was this week's v2.1.2 push.

What changed

Replace the for_file call with CodeOwnership.version. That method calls ::RustCodeOwners.version, which:

  • Loads the platform-specific code_ownership.so (proving the cross-compile artifact is packaged and runnable for this ruby/platform).
  • Executes a Rust function and returns the codeowners-rs version string.
  • Requires no config file.

This is the right shape for a platform-gem smoke test: we care that the native extension loads and runs on the target platform. Ownership-lookup correctness is covered by the RSpec suite.

How to verify

After merge, dispatch the CD workflow again. The x86_64-linux build should print the code_ownership + codeowners-rs versions and exit 0 at the smoke step.

Checklist

  • I bumped the gem version (or don't need to) 💎 — CI-only change, no gem bump.

The x86_64-linux smoke test in CD called CodeOwnership.for_file, which
requires config/code_ownership.yml in the CWD. This repo intentionally
does not ship that config (removed in e9f29ac), so the step failed with
"Can't open config file" on the first real dispatch after #157.

Replace the call with CodeOwnership.version, which exercises the
cross-compiled Rust native extension (loads the .so, calls into Rust)
without depending on a project config — the right check for a
platform-gem smoke test.

Prior smoke test (pre-#157) called a non-existent method with `|| true`,
so it silently no-op'd. #157 switched to a real method and dropped the
suppression, exposing the latent missing-config problem once CD next
ran on workflow_dispatch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-project-automation github-project-automation bot moved this to Triage in Modularity Apr 17, 2026
@perryqh perryqh marked this pull request as ready for review April 17, 2026 22:49
@perryqh perryqh requested a review from a team as a code owner April 17, 2026 22:49
@perryqh perryqh merged commit 36433fa into main Apr 17, 2026
10 checks passed
@github-project-automation github-project-automation bot moved this from Triage to Done in Modularity Apr 17, 2026
@perryqh perryqh deleted the fix-cd-smoke-test branch April 17, 2026 23:33
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