Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: A Metric for 'Dev Cycle Time' #171

Open
kuritz opened this issue Dec 16, 2021 · 3 comments
Open

Feature: A Metric for 'Dev Cycle Time' #171

kuritz opened this issue Dec 16, 2021 · 3 comments

Comments

@kuritz
Copy link

kuritz commented Dec 16, 2021

Hello, my team is using this action and find it useful. Thanks for creating this!

Many of these are useful to us, but particularly the github.actions.pull_request_closed.since_opened_seconds metric is shedding light on our current PR process. We'd love to also be able to measure what someone might refer to as 'Dev Cycle Time' or 'Pull Request Lead Time', which would measure the time from first commit on a feature branch, until the PR is closed.

Is this something you would be willing to add to the action? I imagine this feature might require passing a github token with more permission than the one provided by actions to use the API and get the start time (time of first commit, or head branch creation event) to calculate this metric. I would be happy to put together a PR to implement this.

@int128
Copy link
Owner

int128 commented Dec 19, 2021

Thank you for your proposal. That's interesting.

It is possible to get the timestamp of first commit by pulls.listCommits API https://octokit.github.io/rest.js/v18#pulls-list-commits. For example, https://api.github.com/repos/int128/datadog-actions-metrics/pulls/175/commits. I think author.date is suitable for the cycle time because committer.date is updated by rebase operation.

@int128
Copy link
Owner

int128 commented Dec 29, 2021

I added the following metrics. Can you check them?

github.actions.pull_request_closed.since_first_authored_seconds
Time from the authored time of the first commit until closed

github.actions.pull_request_closed.since_first_committed_seconds
Time from the committed time of the first commit until closed

@kuritz
Copy link
Author

kuritz commented Dec 29, 2021

I am seeing data for both of these metrics. Thanks so much for adding them, @int128!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants