Anchor solargraph GIT-block regex to the exact repo name - #470
Merged
Conversation
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
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
Follow-up to #469 (merged). The
awkpattern used to detect solargraph's pinned git revision (.envrc,fix.sh,.circleci/config.yml) matchedremote ~ /solargraph/-- a substring match, not an exact one. Found while porting the same guard toapiology/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_VERSIONstill resolves the correct forced version for the currently-pinned revisionbundle checkstill reports satisfiedbash -n fix.sh/yamllint .circleci/config.ymlcleanbuild/qualitygreen🤖 Generated with Claude Code
https://claude.ai/code/session_01S3YDrArZm1e4DQ3MnFCSZk