Support merged pull requests for github and gitlab - #311
Conversation
|
Thanks for the pull request. Actually, the Not sure how exactly the query |
|
I'll say that I don't understand the logic behind "closed". When I use |
|
PR can be closed because of being merged or declined. This takes just the successful PRs. |
Pull requests authored by a user are covered by
Understood. It might make sense to separate closed (without merge) and merged pull requests. However, we need to make sure the stat is working as expected. As mentioned in the comment above, some of the pull requests merged by me in the given time frame are not reported by the new stat. Could you please, have a look into that? |
|
Hi @psss!
I think of the assignee as the reviewer*. I dig the idea of
Having worked on CLIs for more than 20y, I appreciate that you may not want to maintain a massive proliferation of flags. That said, I could envision the following non-mutually-exclusive options that could be used in conjunction with all/most of the
...where the default is I haven't thought through whether/how these could also apply to *I imagine different shops use different processes, so this may not apply universally, but this is how it's done at Red Hat, at least in the OpenShift org, so I know it's not just me :) |
Well, for reviewers there's a dedicated field, right? I would not suggest to duplicate the meaning.
Just to clarify, the existing
+1 for having
Your suggested name |
Mm, fair point. The difference being that any schmo can leave a review, whereas in our process the assignee's reviews are the "important" ones -- specifically the ones that the author expects to move the PR toward getting merged. I guess the subtleties of different processes come into play here... but empirically having separate flags for "assigned" vs "reviewed" PRs would give users the flexibility to report in whatever way is most appropriate for them.
If I could further filter by open/abandoned/merged, I would think so, yes. |
This is straightforward. The The I need the merged PR (authored by me), as I report the code I, personally, contributed. |
Isn't the credit for authoring a pull request covered by |
The |
|
Thanks much for the clarification and sorry for the late response. So it's about getting the work until the finish (merging) and the date is clearly different. Makes sense now. Let's do it as you suggest. Could you please rebase on the latest |
merged pull requests for github and gitlab
|
Can you please rebase? |
857b9f6 to
2c698a5
Compare
Done. Sorry for being inactive on this! |
sandrobonazzola
left a comment
There was a problem hiding this comment.
The GitHub part looks good for merging. Some questions on the GitLab one.
Other questions:
- Should we filter by merge date or update date? The PR discussion suggests merge date, but the implementation seems to use update date.
- Should we add unit tests similar to the existing GitLab tests?
2c698a5 to
c048fbb
Compare
|
In its current form this should close #371 |
That's right. I'll update the code to use the merge date. Those two dates are often the same, but the MR might be updated after it's merged, so yes.
Yep, I'll add those... |
c048fbb to
dd7c2d5
Compare
|
The readthedocs #30370221 failure was likely due to yesterday's Github outage: https://www.githubstatus.com/incidents/5q7nmlxz30sk |
8f5e5ee to
ae4b8d0
Compare
090cc09 to
eb49e39
Compare
eb49e39 to
7f4c282
Compare
|
Yes, please, it's a pretty useful stat. |
psss
left a comment
There was a problem hiding this comment.
Looks good to me and works nice! Thanks for implementing this. Just two minor suggestions.
|
@Felixoid, could you please have a look at the few last comments? We'll be releasing |
|
With my pleasure, but I don't have the right to apply them =) @cardil, could you make this last spurt, |
|
I addressed the review points in f7256c9, so if @psss or @sandrobonazzola has permissions to edit the branch, the following is possible: Hopefully, it will allow merging it soon |
|
I think I applied the review comments and rebased with the latest code. I hope it's now correct! |
Filter by merged_at timestamp (not updated_at) and add tests for both GitLab and GitHub merge-requests-merged functionality.
Transform MR data structure to include target_title and target_type fields expected by parent Issue class, eliminating the need for method overrides.
- Remove unnecessary iid() override in MergedRequest class - Fix 'Merge requests merged' name in gitlab stats - Fix 'Pull requests merged' name in github stats - Add available stats docs to github and gitlab plugin docstrings Assisted-by: 🤖 Claude Sonnet 4.6
- github: pull-requests-closed tracks PRs assigned to user (merged or declined) - gitlab: merge-requests-closed tracks when user pressed the Merge button Assisted-by: 🤖 Claude Sonnet 4.6
|
3 years. One of my longest PRs! 🎉 Thanks for merging. I really appreciate it! |
🫣 🫣 🫣 Oh... Sorry for that! And... well... congrats! 😁
Thanks for the patience / endurance! 👍 |
| pull-requests-merged | ||
| pull requests authored by the user that were merged (merged_at | ||
| timestamp falls within the reporting period) | ||
|
|
There was a problem hiding this comment.
Are all these stats enabled by default? If so, how to disable some of them?
There was a problem hiding this comment.
Yes, by default all stats are enabled. That applies in general for all plugins. If you need only selected stats, then you can explicitly list them on the command line, e.g.:
did --github-issues-created --github-pull-requests-created
As for now there is no better way. It could be a nice enhancement to make enabling/disabling individual stats configurable.
There was a problem hiding this comment.
@psss thanks for the reply. Do I understand correctly that explicitly enabling one of them (like --github-issues-created) also disables all the others?
There was a problem hiding this comment.
Yes, it's either shows all stats or only requested.
There was a problem hiding this comment.
Yes, only provided stats will be shown.
Changes
Fix #371.