green-coding-solutions / eco-ci-energy-estimation

Eco CI Energy estimation for Github Actions Runner VMs
MIT License
48 stars 10 forks source link

Energy consumption mertrics as a GitHub PR Comment or Issue #23

Closed ibakshay closed 11 months ago

ibakshay commented 1 year ago

I got to know about your project today, I have to say that your work is impressive and I really appreciate it :clap:.

I would like to integrate this GitHub Action to my open source project and it will be great if this energy consumption information and the energy graph is also posted as a pull request comment in the pull request.

Screenshot 2023-06-07 at 20 09 54

Do you have any plans to add this feature?

ArneTR commented 1 year ago

thx for the nice words :)

You mean like when Dependabot makes a PR for you? that sounds actually quite interesting.

Just let me re-iterate if I understood it correctly: Your repo is configured that way, that when a new PR is made automatically a Github Actions Workflow is triggered that runs a test. Then, inside the Pull-Request conversation you want after the result if the workflow failed / succeeded also a comment that contains the energy, right?

@dan-mm Also pulling you in this conversation here.

dan-mm commented 1 year ago

That's an interesting idea, I like it. It seems like you can create comments using the github API, so I should be able to add a feature to support this optionally via a flag. I will add it to the list :-)

This is good feedback, thanks. I'm quite interested in knowing how people intend to use Eco-CI and specifically how people want the information displayed in their workflows.

ibakshay commented 1 year ago

Your repo is configured that way, that when a new PR is made automatically a Github Actions Workflow is triggered that runs a test.

Yes, exactly.

Then, inside the Pull-Request conversation you want after the result if the workflow failed / succeeded also a comment that contains the energy, right?

Yep! I would like to have the energy consumption information directly displayed in the Pull Request conversation as it makes it transparent for the contributors who create a Pull Request.

For example: PR comment from dependabot.

Screenshot 2023-06-08 at 13 42 18
ArneTR commented 1 year ago

That sounds like a great feature and we will most likely schedule that in. Probably something like end of the month I guess.

If you @ibakshay are however interested in doing a contribution we are also happy to take a PR and provide some guidance :)

ibakshay commented 1 year ago

That's an interesting idea, I like it. It seems like you can create comments using the github API, so I should be able to add a feature to support this optionally via a flag. I will add it to the list :-)

Sounds great! GitHub APIs to create a PR comment or issue comment is easy to consume and well documented. You can use this GitHub Actions token authentication to post a PR comment. With this approach, you don't need to ask for a personal access token from the end-user.

dan-mm commented 11 months ago

This feature has been added in the 2.1 release: https://github.com/green-coding-berlin/eco-ci-energy-estimation/releases/tag/v2.1