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 Request] Update the benchmark comment, don't create a new one #8

Open
HalidOdat opened this issue Jun 12, 2020 · 4 comments · May be fixed by #81
Open

[Feature Request] Update the benchmark comment, don't create a new one #8

HalidOdat opened this issue Jun 12, 2020 · 4 comments · May be fixed by #81
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@HalidOdat
Copy link
Member

It can sometimes be really frustrating to navigate in a PR with a lot of comments, and adding a new benchmark comment every time you push something does not make it easier.

So I propose the following feature we get the first comment with the benchmarks and every time we push code after that it should update/edit the previous comment so we only have one comment with the benchmark and it will be on the top of the PR (the first benchmark comment).

Question: what if I want to see previous snapshots benchmarks of the code I pushed?
Github allows us to see previous revisions to the comments.

Question: how can we implement this?
I have no idea.

BTW: codecov github action does this (it's possible at least 😃 )

What do you think? @Razican @jasonwilliams

@HalidOdat HalidOdat added enhancement New feature or request help wanted Extra attention is needed labels Jun 12, 2020
@HalidOdat HalidOdat pinned this issue Jun 12, 2020
@jasonwilliams jasonwilliams changed the title Update the benchmark comment, don't create a new one [Feature Request] Update the benchmark comment, don't create a new one Jun 12, 2020
@jasonwilliams
Copy link
Member

I personally don’t know how that’s done but not against the idea.
It can be useful sometimes to see the progress in your commits though.

@Razican
Copy link
Member

Razican commented Jun 13, 2020

I think this would be great, yes, but we need to investigate how to do it. I guess we can somehow retrieve the list of comments and get the first one with a benchmark and update it.

@HalidOdat
Copy link
Member Author

HalidOdat commented Jun 13, 2020

I think this would be great, yes, but we need to investigate how to do it. I guess we can somehow retrieve the list of comments and get the first one with a benchmark and update it.

Here is the github rest API that is used in this project to create new issues comments, we create it here , looking further I saw a get an issue comment here and a update an issue comment here

I'm not experienced with github rest API so my aproach may be completely wrong 🙃

@milesj
Copy link

milesj commented Oct 22, 2022

I do this exact thing in my own GitHub action, here's the code: https://github.com/moonrepo/run-report-action/blob/master/index.ts#L27

Basically, just insert an html comment with a unique hash (<!-- hash -->), and then find the comment with the hash and update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants