Wire file path filtering through to the refactored commit list
## Summary When visiting the commit list for a specific file path (e.g. `/<project>/-/commits/<branch>/<file-path>`), the refactored Vue commit list (`project_commits_refactor` feature flag) ignores the file path and shows all commits for the branch instead of only commits that touched the specified file. The router (`router.js`) correctly captures `:path*` from the URL, but the path is never read by the component or passed to the GraphQL query. ## Root Cause The Gitaly `ListCommits` RPC already supports a `path` parameter (added in [gitaly!8154](https://gitlab.com/gitlab-org/gitaly/-/merge_requests/8154), tracked in [gitaly#6917](https://gitlab.com/gitlab-org/gitaly/-/issues/6917)). However, the GitLab application layers between the frontend and Gitaly never thread it through. ## What needs to be done Six touch points need to be updated to thread `path` from the URL to Gitaly: ### Backend (4 changes) 1. **`lib/gitlab/gitaly_client/commit_service.rb`** — In the `list_commits` method, set `request.path` on the `Gitaly::ListCommitsRequest` when a `path` param is provided. Similar to how `request.author` is set. 2. **`lib/gitlab/git/repository.rb`** — Add a `path: nil` keyword argument to `list_commits` and pass it through to `gitaly_commit_client.list_commits`. 3. **`app/models/repository.rb`** — Add a `path: nil` keyword argument to `list_commits` and pass it through to `raw_repository.list_commits`. 4. **`app/graphql/resolvers/repositories/commits_resolver.rb`** — Add a `path` GraphQL argument: ```ruby argument :path, GraphQL::Types::String, required: false, description: 'File path to filter commits by.' ``` Pass it through to `repository.list_commits(path: arguments[:path], ...)`. ### Frontend (2 changes) 5. **`app/assets/javascripts/projects/commits/graphql/queries/commits.query.graphql`** — Add `$path: String` variable and pass it to `commits(path: $path, ...)`. 6. **`app/assets/javascripts/projects/commits/components/commit_list_app.vue`** — Read `this.$route.params.path` (joining segments with `/` since `:path*` is an array in vue-router) and include it in the Apollo query variables. ### Tests - Add a spec in `spec/graphql/resolvers/repositories/commits_resolver_spec.rb` for the `path` argument. - Update `spec/frontend/projects/commits/components/commit_list_app_spec.js` to verify the path variable is passed when the route has a file path. ## Verification 1. Enable `project_commits_refactor` feature flag. 2. Navigate to `/<project>/-/commits/<branch>/<file-path>` (e.g. the "History" button on a file view). 3. Verify only commits that touched the specified file are shown. 4. Navigate to `/<project>/-/commits/<branch>` (no file path). 5. Verify all commits for the branch are shown (no regression). ## References - Gitaly RPC support: https://gitlab.com/gitlab-org/gitaly/-/issues/6917 - Gitaly MR: https://gitlab.com/gitlab-org/gitaly/-/merge_requests/8154 - Original integration issue: https://gitlab.com/gitlab-org/gitlab/-/issues/550474 - Epic: https://gitlab.com/groups/gitlab-org/-/epics/17482
issue