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

Closes #797: Comment output of cachegrind in PR #932

Merged
merged 79 commits into from
Dec 30, 2023

Conversation

0x0elliot
Copy link
Contributor

@0x0elliot 0x0elliot commented Dec 27, 2023

Tried a bunch of things. Dealing with file uploads didn't seem so simple in comments. There is a character limit (~65k characters), so the simplest thing to do was to comment the first 65k characters :)

Let me know if that's not good enough and we can make the experience with PRs better. I am toying around with adding in pastebin API there to make dev UX better but I don't want you guys to deal with it.

cli/cli#4465 (comment) Sadly this restricted me further. I am open to using third party APIs if you're comfortable to make it simple for us. Open to suggestions and feedback :)

Screenshot 2023-12-27 at 10 23 10 AM

Another solution is using -- Auto-annotated source: as a delimiter and commenting every time we see it in the output. That might lead to a spam of comments however!

@0x0elliot
Copy link
Contributor Author

Please review this PR @rakita :)

valgrind --tool=cachegrind target/release/snailtracer

# Extract relevant information from cachegrind.out file
cg_annotate cachegrind.out.* > cachegrind_results.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this file but just the output of the Valgrind.

Something like this:
valgrind --tool=cachegrind target/release/snailtracer 2>&1 | tail -n 1 | tee cachegrind_results.txt

Otherwise it looks nice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why just the first line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more resonable then 64k and most important, but i like what you did in the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just the first 64k characters not lines!

looks less spammy :P


- name: Comment on PR
env:
GH_TOKEN: ${{ github.token }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@0x0elliot 0x0elliot Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works perfectly on my fork. i wonder if it would continue to work on another PR post merge?

Copy link
Contributor Author

@0x0elliot 0x0elliot Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x0elliot#1 (comment) here is the comment from my test PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap we can check after it is merged.

There is --edit-last flag that could stop the spam. Did you check it out?
https://cli.github.com/manual/gh_pr_comment

@0x0elliot 0x0elliot force-pushed the 0x0elliot/output-cachegrind branch 2 times, most recently from 320cc6c to acd1553 Compare December 27, 2023 13:32
@0x0elliot
Copy link
Contributor Author

amending on my commit to avoid commit spam as i try to test this :)

@0x0elliot
Copy link
Contributor Author

This looks pretty neat now

Screenshot 2023-12-27 at 7 07 22 PM

@0x0elliot
Copy link
Contributor Author

@rakita done. we can debug post merge.

Screenshot 2023-12-29 at 11 21 12 PM

@0x0elliot
Copy link
Contributor Author

0x0elliot commented Dec 29, 2023

ah yeah --edit-last fails if a comment hasn't already been made. let me fix that.
Screenshot 2023-12-29 at 11 42 23 PM

@0x0elliot
Copy link
Contributor Author

0x0elliot commented Dec 29, 2023

should be fine now. let me test with user permissions on my fork further so that we don't have to debug.

@0x0elliot 0x0elliot force-pushed the 0x0elliot/output-cachegrind branch 2 times, most recently from bafc712 to e68ad97 Compare December 29, 2023 18:51
@0x0elliot
Copy link
Contributor Author

okay, maybe try adding a PAT post merge? @rakita my fork also encounters a same error when my friend makes a PR with his account. my PRs work fine with this workflow.

https://stackoverflow.com/questions/76008141/resource-not-accessible-by-integration-when-trying-to-enforce-admin-protection

this person has the same bug.

@rakita
Copy link
Member

rakita commented Dec 30, 2023

okay, maybe try adding a PAT post merge? @rakita my fork also encounters a same error when my friend makes a PR with his account. my PRs work fine with this workflow.

https://stackoverflow.com/questions/76008141/resource-not-accessible-by-integration-when-trying-to-enforce-admin-protection

this person has the same bug.

Okay, will merge this, and check if permissions work. If not, will add PAT

@rakita rakita merged commit e317532 into bluealloy:main Dec 30, 2023
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants