WIP: Show commits by author
What does this MR do?
Allows the projects commit history to be filtered by commit author when clicking on the authors name
Are there points in the code the reviewer needs to double check?
Currently this feature has not been implemented in Gitaly, as a result this MR only has code that would work for the old way of searching/filtering commits.
Why was this MR needed?
To resolve https://gitlab.com/gitlab-org/gitlab-ce/issues/12760
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Closes #12760 (moved)
Merge request reports
Activity
added Community Contribution Platform repository labels
Right now we support
author=Full Name
, but since multiple people can have the same name, I think it would be better to match by email (author=douwe@gitlab.com
), or by GitLab username (author=DouweM
). When searching by GitLab username, we should look up the user in question, and return all commits byuser.all_emails
.
Right now, we always have the name in
app/views/projects/commits/_commit.html.haml
link to the list of commits by that author, but we also use that partial at the top of blob (file) pages, like https://gitlab.com/gitlab-org/gitlab-ce/blob/master/Gemfile. There, I think we would expect it to link to the user's profile, not their list of commits.
Have you tested going to the History for a specific file (like https://gitlab.com/gitlab-org/gitlab-ce/commits/master/Gemfile), and then adding an
author
param to the URL? I think that may not currently work. It does work as expected with thesearch
param: https://gitlab.com/gitlab-org/gitlab-ce/commits/master/Gemfile?search=bump
assigned to @DouweM
@nadiavu thanks for taking this on! I agree with all of @DouweM's comments above, particularly https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14468#note_41283821, but the code here looks pretty good!
Could you take a look at our comments above, please?
assigned to @nadiavu
Thank you @smcgivern and @DouweM for your feedback. I will make all the necessary changes.
added 60 commits
- b08eb5ce...cfccb278 - 57 commits from branch
gitlab-org:master
- d1b26ada - Delete empty line and fix typo
- 5f3dff8d - Merge branch 'master' of https://gitlab.com/nadiavu/gitlab-ce into 12760-filter-commits-by-author
- 4712945d - Make #find_commits_by_message_or_author take in named params
Toggle commit list- b08eb5ce...cfccb278 - 57 commits from branch
@nadiavu just wanted to check in on this
I see you pushed some more changes; should we take another look?Hi @smcgivern ,Sorry, been full on at work since I have started a new gig. Think I need a few more days. Also Im having some issues trying to flip the switch on Gitaly. Any tips?
@nadiavu no worries, feel free to take your time - I just wanted to check!
For the Gitaly thing, I'm not sure exactly what you're looking for, but I think there are two things here:
- To disable Gitaly for this method, you can do
Feature.disable(:gitaly_commits_by_message)
in a Rails console. To enable it, doFeature.enable
. - I think for this MR right now, we don't need to worry about implementing the feature in Gitaly. We should, however, ensure that when searching by author, we don't go to Gitaly (even if the feature is enabled), as Gitaly doesn't support it.
Does that help?
- To disable Gitaly for this method, you can do