-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Combining multiple snippets into single comment #16
Comments
Hi!
This is exactly how it's supposed to work 🤔 if it doesn't, something's wrong.
At a first glance, your config looks 100% correct to me.
This sounds very suspicious! When the new comment is added, is the old comment removed or not? If it's removed, then it sounds like it uses the option "recreate" instead of "edit". If it doesn't get removed, then there is something broken with detecting an existing comment. I personally use I should have more time tomorrow to have a proper look at the problem. I'll take your config, put it in my test repository and see what happens. Meanwhile, you could use this debugging option for GitHub workflows to get debug logs from the action. It does provide logs about which files are being changed in the PR and the patterns it tries to match and on which files and what's the result. For example:
|
Thank you so much for your reply :) The previous comments are never removed, and a new one is added each time, and only contains the text from the first matching block. I tried setting Here's an example pull request which shows what it's doing: Lissy93/dashy#224 So using ACTIONS_STEP_DEBUG and ACTIONS_RUNNER_DEBUG gave me the following logs from the most recent run: logs_2449.zip And the text logs from the past few runs: Logs_3576429694.txt, Logs_3576417452.txt, Logs_3576336333.txt, Logs_3576334778.txt Thanks again for your help :) |
Problem 1: patterns not matching when expected to matchPossible reason 1: hidden files?To match hidden files with a simple https://github.com/exercism/pr-commenter-action#commentglob-options I am not sure if you're trying to match any hidden files with Possible reason 2: wrong patternsI just started my testing with your config and I did notice a problem with some of the file patterns. Those three:
They all start with
On top of that, the patterns would Would that be enough to explain the problem that you're only seeing a single snippet matched? In the logs in I noticed that while the PR Lissy93/dashy#224 was opened, you committed this Lissy93/dashy@a702fae#diff-a699cacf48dcc3f436415ea8807ce5d72029cb2eddf1b2eff4629bebe948d4e1 to
Unfortunately I am unable to access those files. I am getting the response Problem 2: existing comment not detectedAs for the second problem of the comment always being added anew and never deleted or edited, that's more tricky. I didn't do a great job of adding debug statements for this flow. I'll need to fix that. There could be multiple reasons. Possible reason 1: no permissions?I noticed that you're using a custom token ( Possible reason 2: something else is breaking the comment's metadataThe way pr-commenter detects its previous comments is by a HTML comment with metadata. You can see it if you try to edit the bot's comment: How does that look like in your case? Is it there? |
Oh no! I just figured out the second problem. I added this "safety" check here: pr-commenter-action/lib/run.js Line 100 in 1e8d6b5
When looking for existing comments made by this action, I made an assumption that the author of the comment is going to be of type This was a mistake on my part. I think I should just remove this check. |
@Lissy93 I just published v1.3.0 which should fix the second problem with the old comment never getting edited or deleted. |
You hero! Thank you so so much! 🙌 I also updated the file patterns, with your recommendation and that part now works perfectly- I was just being thick- thank you for explaining :) Will update to your new version and hopefully that will fix the recreation of my non-bot bot comments. Thank you so much for implementing that change, and for your help with explaining the first issue 💖 |
I'm glad to be of service and I'm happy somebody is using my action 🥰 |
Hey @angelikatyborska - Really enjoying your action :) I hadn't come across any similar actions, and this is a super useful task - awesome work!
Just a quick question, when multiple files patterns are matched, I would expect the comment to include all matching snippets between the header + footer, but instead it just includes the first one only. Am I missing something in my config maybe?
For reference, here's my config file and my action file.
Also I've noticed that the
on-update
option (recreate / edit /nothing) seems to do nothing. Each time whenever a new commit is pushed to the open PR, a new comment is always added.Thank you very much,
Alicia :)
The text was updated successfully, but these errors were encountered: