github / issue-metrics

Gather metrics on issues/prs/discussions such as time to first response, count of issues opened, closed, etc.
https://github.blog/2023-07-19-metrics-for-issues-pull-requests-and-discussions/
MIT License
400 stars 50 forks source link

How to list columns to be included in reports? #198

Closed dtrezubSV closed 7 months ago

dtrezubSV commented 7 months ago

Hi! Sorry if this is a dumb question, but I cannot get the action to give me any values for the time spent in columns.

I have columns labeled "In Progress", "In Review", "Blocked", "Ready to Merge".

I tried passing the arg as LABELS_TO_MEASURE: 'in-progress,blocked,code-review,ready-to-merge' as per the examples. No deal.

I tried also LABELS_TO_MEASURE: 'In Progress,Blocked,Code Review,Ready to Merge', to no avail either.

Using double quotes didn't work either: LABELS_TO_MEASURE: '"In Progress","Blocked","Code Review","Ready to Merge"'

The only metric I can get is Time to Close.

What should be the correct way to list the column labels? Thansk!

zkoppert commented 7 months ago

Are you talking about project columns? The action is designed to use issue labels and measure the time spent with those labels. Does that make sense?

dtrezubSV commented 7 months ago

Thanks for the quick response! Yes, I'm talking about the columns. I'm sorry, I'm new to GitHub and the naming is still a bit confusing to me.

It does make sense, yes. I got confused by these two points in the read.me:

As an OSPO, I want to see how many open source repository requests are open/closed, and metrics for how long it takes to get through the open source process. As a product development team, I want to see metrics around how long pull request reviews are taking, so that we can reflect on that data during retrospectives.

So the workflow for you guys is to remove/assign labels as the issues progress through the process? If that's the case, do you even use a kanban board?

zkoppert commented 7 months ago

Great question! For some processes we do use labels (particularly our security related processes. There common labels we like to measure such as "Waiting for manager approval".

Then on processes like engineering work that shows up in pull requests or open source repository requests, we like to pay attention to "Time to first response" and "Time to close".

We do utilize kanban boards but unfortunately the GitHub API doesn't currently allow for us to measure time spent in a board column. See https://github.com/github/issue-metrics/issues/57 for more info on that.

dtrezubSV commented 7 months ago

Thanks for taking the time to reply. If we could at least auto-assign a label when an issue changes columns, #57 could become a reality, but it's not possible yet with projects v2. Funny how GitHub releases features but Github itself doesn't use them :P

zkoppert commented 7 months ago

Yeah we are in an in between right now because the current version of projects can't trigger anything in order to cause an auto-label event. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#project_column I'll mark this as blocked and we can revisit when the projects API is improved.