flexion / devops-deployment-metrics

Generate DevOps deployment metrics from GitHub repositories using a GitHub Action workflow to deploy a product
MIT License
4 stars 1 forks source link

Automate collection of GitHub id by name from CI workflows #156

Open tomwillis608 opened 1 year ago

tomwillis608 commented 1 year ago

The current manual process for finding the workflow ID is cumbersome.

Make it so you just need the name or something easier.

See also @basiliskus comment in #134

tomwillis608 commented 2 weeks ago

This may be good news. We currently call gh.get_workflow(id) but it the docs suggest we can also pass in a filename instead of the integer id.

If the deployment action under stud is in .github/workflows/ci-cd-workflow.yaml we should be able to replace the numberic value with the string ci-cd-workflow.yaml.

Testing TBD

tomwillis608 commented 1 week ago

Validated that passing the workflow filename instead of the numeric id does yield the same results for a CDC TI workflow.

tomwillis608 commented 1 week ago

What I discovered is that there is a solution without a code change if the id value in the config file is given the name of the workflow file, e.g. cicd.yaml , instead of the numeric ID value. So the first refactor would just change the docs and maybe some comments to tell the user to put the filename of the workflow in the id value in the config file. But now we have a sloppy configuration variable, which should have a name like workflow_filename or filename , and refactoring by renaming the variable name throughout. Refactor 2.

Go with refactor 2 after discussion with CDC team

tomwillis608 commented 1 week ago

Implemented in #508