-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Hi there,
I'm curious to know if there is a way (or if there may be interest) in delivering aggregated statistics for repository/organization-level energy use.
Context
You can imagine a use-case resembling:
- Three or four repositories in an organization;
- The
eco-ci-energy-estimationaction configured for two workflows on each; - The two workflows are run against both commits Pull Requests and on Push to
mainbranch.
It's easy enough to report statistics within Pull Requests and have a static reference to the energy/carbon statistic for the two workflows running against the main branch, but from what I can tell, the information on badges and in the summary dashboard requires three unique pieces of information:
- The repository name
- A workflow ID
- A specific branch
But let's say that I want to know the total energy for all runs of a specific (or multiple) workflow(s) within a repository or all runs within a specific repository, how would I get this information (besides parsing the JSON output from every run artifact)? What if I want to know these statistics across several repositories under my ownership?
Another issue I can imagine is what if someone forks a repository with this action? How can I ensure that their usage statistic are explicitly included/excluded from this calculation?
Potential Solution (user-side)
I can imagine that if the start-mesurement task could accept a few new variables, this could be simple on the user end:
- name: Start Measurement
uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0
with:
task: start-measurement
branch: ${{ github.head_ref || github.ref_name }}
organization: ${{ secrets.ORG_ID }}
# This could be set at the org level and would not be shared when creating forks
# If '', no association is made to an organization
workflow: ${{ secrets.WORKFLOW_ID || '' }}
# This would allow multiple YAML workflows to share the same ID
# If empty, eco-ci associates a Workflow-ID based on the nameDoes there already exist a way to gather this information?
Thanks!