Skip to content

Anchor solargraph GIT-block regex to the exact repo name - #470

Merged
apiology merged 1 commit into
mainfrom
fix-solargraph-regex-anchor
Aug 7, 2026
Merged

Anchor solargraph GIT-block regex to the exact repo name#470
apiology merged 1 commit into
mainfrom
fix-solargraph-regex-anchor

Conversation

@apiology

@apiology apiology commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #469 (merged). The awk pattern used to detect solargraph's pinned git revision (.envrc, fix.sh, .circleci/config.yml) matched remote ~ /solargraph/ -- a substring match, not an exact one. Found while porting the same guard to apiology/plate-spinner-rails, which pins a different git-sourced gem (iftheshoefritz/solargraph-rails) whose remote also matches that pattern. Harmless in this repo today only because no other git-pinned gem here happens to contain "solargraph" as a substring.

Anchored to match only a remote URL path ending in exactly solargraph (optionally .git), so a future git-pinned gem name containing "solargraph" as a substring can't trigger a false match.

Test plan

  • direnv exec . env | grep SOLARGRAPH_FORCE_VERSION still resolves the correct forced version for the currently-pinned revision
  • bundle check still reports satisfied
  • bash -n fix.sh / yamllint .circleci/config.yml clean
  • CircleCI build/quality green

🤖 Generated with Claude Code

https://claude.ai/code/session_01S3YDrArZm1e4DQ3MnFCSZk

The awk pattern `remote ~ /solargraph/` matches any remote URL
containing "solargraph" as a substring, not just the apiology/solargraph
repo itself. Found while porting this same guard to
apiology/plate-spinner-rails, which pins a *different* git-sourced gem
(iftheshoefritz/solargraph-rails) whose remote also matches that
pattern -- the loose regex picked up solargraph-rails's revision and
would have forced SOLARGRAPH_FORCE_VERSION/BUNDLE_PATH based on the
wrong gem. Harmless here today only because no other git-pinned gem in
this repo happens to contain "solargraph" as a substring in its remote.

Anchored to match only a remote URL path ending in exactly "solargraph"
(optionally ".git"), so a future git-pinned gem like "solargraph-foo"
can't trigger a false match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3YDrArZm1e4DQ3MnFCSZk
@apiology
apiology merged commit ca51484 into main Aug 7, 2026
2 checks passed
@apiology
apiology deleted the fix-solargraph-regex-anchor branch August 7, 2026 22:49
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