-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add threshold option #16
Conversation
One possible tweak would be to use the threshold to calculate whether or not a file is "changed" rather than whether or not to post the comment. For example, if a file's delta was less than the threshold, the action would report that the file was unchanged, but still display the actual change delta. I think this would be a good compromise rather than simply not reporting, which has the issues you mentioned. |
All very good points, thanks for such a well-articulated explanation. At minimum we could definitely ship @dstaley's option - right now there is already a per-file threshold, it's just hard-coded as The comment creation paradox is a tough one for sure. Perhaps as a workaround in the time being, maybe updates below the threshold could fully collapse the comment? I believe that's doable via the API. If not, the whole comment could be updated to be wrapped in |
Thanks for the feedback, @dstaley and @developit ! To clarify, would the suggestion be to treat this similarly to the current "View Unchanged" collapsing (example)? Optionally as a separate (or renamed) grouping "View Below Threshold (##kB)" ? Incidentally there's been a bit of ongoing feedback about this action from contributors to our project, and various thoughts about problems (like |
Personally I'd just consider anything below the threshold as unchanged, and thus put it in the unchanged table. |
@dstaley same here. |
Sorry y'all for the delay. I've been meaning to revisit this one. I like the idea to consider threshold as treated similar to what exists already with the behavior of a change that amounts to zero difference. I see the approval. I'm not attached to getting this in in the current form. It might be an improvement, so if it's something you'd like to ship as-is, that's great. I'd also be interested to making the suggested changes. I've just yet failed to devote the time to seeing it through 😬 |
@developit I'm willing to jump in and take a stab at implementing this! Before I do though, I'd love to add tests for the |
@dstaley that would be really great. I had originally intended to move I'm fine with any test runner really. I mainly use Jest or Mocha. |
My hope for what we could do here would be basically this:
|
@aduth do you have plans to work on this? If not, I would be willing to jump in. |
Hey @DerekTBrown , I admit I totally forgot about this one. If you're keen to see it over the finish line, I'm more than happy to let you take the charge. Dunno how best to manage that logistically, but if it's easiest for me to close this out and you can open a new pull request with anything useful from the changes here, happy to do that. |
Having used
compressed-size-action
for some time in the WordPress/gutenberg project, I've come to the realization that more-often-than-not, I subconsciously ignore the bot's comments. This got me to thinking: What do I want from this bot? To which I consider the following use-cases:Both of these use-cases could be satisfied by adding an option to specify a threshold at which a comment should be created. This is what is proposed with these changes.
A couple extra notes: