Any way to get a timestamp of when a PR was ready for merge? #7715
bikram-agarwal
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
@bikram-agarwal As far as I am aware the platform does not expose/calculate that information in the API so it is unlikely we would be able to address this request here and would need platform changes to support a feature like that. Having said that, would retrieving the PR checks give you an accurate estimate of when the checks passed and the PR was mergable? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my team's GitHub repo, we require a few status checks to pass before a pull request is allowed to be merged. (Two are in-house custom built jenkins jobs, two are 3rd party CI jobs from Gearset and Codescan.)
Earlier, the merge was a manual process. Developers used to create the PR, go do their other tasks, return to the PR page after some time (10min, 30 min, or hours later) so that all required status checks have passed and then manually click the "merge pull request" button.
We've now enabled the "Allow Auto-merge" option in the repo. So now developers don't have to manually monitor their PR. They can click the "Enable auto-merge" button immediately after creating the PR. When all the status checks pass, it automatically merges the PR.
But we need to show the management how much time it is saving. And to show that, I need to calculate the how much time the PRs were sitting idle before we enabled the "auto merge" feature; i.e. time difference between when the PR was ready for merge (i.e. passed all required status checks) and when the PR was actually manually merged.
I know "time of merge" can be obtained via this command -
gh pr view $pr --json mergedAt --jq .mergedAt
But there's no similar command to find when a PR was ready for merge. "mergeable" option only return whether currently open PR is mergable or not. (and always returns "unknown" for PRs that are already merged.) Kinda same for "mergeStateStatus".
Is it possible to calculate exact time when a PR was ready for merge? If not possible with current gh, can I request this as a new feature in future versions?
Beta Was this translation helpful? Give feedback.
All reactions