Fix vendor path leak in source file resolution#22
Merged
LeahArmstrong merged 1 commit intomainfrom Feb 28, 2026
Merged
Conversation
In Docker environments where Rails.root is /app, the start_with?(app_root) check incorrectly accepted vendor bundle paths like /app/vendor/bundle/... because they start with /app. This caused wrong file_path and source_code for models, controllers, GraphQL types, and other extracted units. Adds app_source? and resolve_source_location shared helpers to SharedUtilityMethods, then standardizes all 9 extractors to use convention-path-first with vendor/node_modules filtering.
a512fa0 to
44a4166
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.
Summary
app_source?andresolve_source_locationshared helpers toSharedUtilityMethodsthat filter out vendor bundle and node_modules pathscondition_labelfrom ModelExtractor (identical to SharedUtilityMethods version)Problem
In Docker environments where
Rails.root = /app, thestart_with?(app_root)check incorrectly accepted vendor bundle paths like/app/vendor/bundle/ruby/3.x/gems/activerecord-7.0.8.7/lib/active_record/base.rbbecause they start with/app. This caused ~50% of models, ~27% of controllers, and ~40% of GraphQL types to get wrongfile_pathandsource_code.Test plan
app_source?filtering covers expected exclusion patternsresolve_source_locationtier ordering (const_source_location > instance methods > class methods)