-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ability to approve the changes to the bundle size #115
Comments
Hey,
If the target branch doesn't exist (meaning we are not in PR), BundleMon will compare your current commit to a previous commit in the same branch you currently are. This was implemented to show the correct message at the end of the run and in the commit status. What do you think about adding a new flag to ignore fails in the same branch?
The flag will only change the result to success
This is a really cool idea, I will need to do some investigation and think about how to do that, your references are great and I will check them. Thank you for your suggestions (: |
Super! Thank you so much for the response. Just jotting down the progression of my thoughts here..... An alternative setting name could be: or even or even this could be in the
I think I like the configurable aspect of the last one. Obviously whether or not we can do warnings would affect the design. Haha, really over-engineering now, Imagine if we could even have |
PS. This might be the simplest of the ideas around approving a bundle change in a PR:
It would also, as a side effect, show previous approvals in the PR comment history, and would only apply the approval to the check immediately prior to the comment in the PR. |
In addition to what @markwhitfeld is asking, I think it would also be great to have a way to report the output differently in case of "failures". That would also play very nicely with the approval comment |
I created separate issues to keep this one only about the "approve changes" feature (: |
I started to look for a possible solution. With the current BundleMon GitHub App permissions I can fetch all PR comments, each comment has
So if I detect a comment with something like What do you think? |
Another solution is to look for a label in a PR |
I think an approval from anyone with write access to the repo is good enough, indeed :) |
According to the github docs, anyone with Triage access can apply or dismiss labels: This could be a reasonable mechanism to achieve what we are looking for. Bundlemon would need to dismiss any approval labels if there is a subsequent commit that causes another failure. Then the approver would have to apply the "Approved Bundle Size" (or similar) label again to re-approve. That being said, I think that the comment mechanism might provide more control. With respect to limiting the PR Author, I don't think that restriction is necessary if the PR Owner already has one of the write access permissions. In that case, if the organisation is looking for control over PRs then they would enable the setting that there needs to be a separate approver of the PR. That approver would be responsible for checking that the failure has not needlessly been ignored by the PR Author. Using comments does also make this action more visible. PS. on a side note, what happens if someone adds an approve comment and then deletes it. Then there is no trace of the approval. Maybe the deletion of an applicable |
Currently, I search for the approve comment when creating Github output, so only after you get a failed status you will need to add a comment and rerun the job or create a new commit. So I'm not sure I can make something that will last only for one commit. ideally, I would use webhooks to get updates on the comments, but because I'm using a free server I can't handle a lot of requests right now. Maybe a better solution, for now, is to add a GitHub action that gets triggered by adding/removing a comment if the comment starts with The downside of this solution is that you need to create a workflow just to use this feature. |
I honestly think that requiring people to create a workflow is a great option. It gives you less to maintain and provides more flexibility for the user to implement what they want.
and when the approve comment is deleted, you would call:
The second one would reset the bundlemon status back to whatever the original result of the commit run was. I'm not sure if you would have access to that commit's status for the |
PS. I'm wondering what the security of exposing a command like this would be. For example if someone just copies those keys and runs it from their local machine then they can force the approval. I don't know if there is anything else that you can do to check permissions when the command is run. |
Using this workflow I'd assume. Having a workflow to approve Bundlemon could be valid. The security concern would be limited as you'd still require the api key for such commands. But overall, I think that if you use the BundleMon github app already, this should be set automatically by the app instead of having a custom workflow on top of it. |
Feature available in bundlemon@2.0.0-rc.1 |
Fantastic! Thank you so much! |
Is there an |
Oh sorry, I forgot to write about the new solution. I started implementing it as a GitHub workflow, but I had issues with how to handle editing or deleting comments that had a command in them. So I went in a bit different direction, to approve a limit:
approve-commit-record.mp4It's more stuff that the user needs to do if he wants to approve, but it makes the installation process of BundleMon easier. For a long time, I wanted to implement user login with GitHub, so I figured it was a good opportunity. It opens more options like showing all the user's repositories in BundleMon, some statistics, project settings, and more... Currently, I didn't implement disapprove, but I will do that soon. #141 What do you think? (: |
I think that that is a good solution. Well done and thank you!
Potentially these could also cause Bundlemon to post a message on the PR (if it is a PR) to state the explicit action taken for the record. PS. I do think that it would be valuable to have each of these actions invocable from the command line too in case the user would like to integrate some sort of other workflow (like using the PR comments). Then that complexity would be entirely for them to handle and not your lib. |
The current "disapprove" is to undo your approve action. I love your suggestion to separate it to Also, I agree that it would be good to have these actions in the CLI, then you will probably need to use the project API key |
I started to work on review.mp4For simplicity the final report status will only check the last review, probably later we can add multiple approvers and stuff like that... |
This s fantastic @LironEr. Thank you so much for all of this. I'll be testing it real soon :) |
Can you describe what permissions we need to give when generating a github token for Bundlemon? Could be interesting to add this to the readme file |
You will need to generate access token with I will add it to the readme file. I'm testing a way to generate a token without any permission, just to verify the user and his relation to the repo, then use the Github app to create outputs, but I have security concerns.. So if anything will change I will post about it. |
I find Can I also ask the github comments to contain the history of approvals/rejects so it's easy to see without going on the report page? |
Is your feature request related to a problem? Please describe.
Firstly, thank you so much for this awesome tool!!!
I have gone through a few similar tools and this is definitely exactly what I needed.
The issue I am facing:
master
/main
branch, which makes it look like the build is failingDescribe the solution you'd like
Potentially some sort of "Approve" or "Accept" facility on the check (or on the page that it leads to) that would allow for the status of
the check to no longer be marked as failing. This would be very useful for the case that I mentioned for a master commit, and for reviewing a PR.
I guess that this would only be available to a CODEOWNER or a moderator of the target repository.
Hopefully this auth aspect doesn't make things too difficult. One potential simple option here could be a configured approver list in the github app config, or some sort of secret key that could be shared with the relevant parties and they just copy paste after clicking the approve button.
I have seen this type of thing in CodeClimate: https://docs.codeclimate.com/docs/workflow#what-to-do-when-issues-are-found
Describe alternatives you've considered
I tried to use the github actions
continue-on-error
feature with the approvals feature to facilitate this workflow, but the check still marks the build as failing. (See: ngxs/store#1886)Potentially also the "Approve" could be done using a comment in the PR by a moderator using the comment
/bundlemon approve
, but this doesn't solve the issue with the commit on master.Additional context
Here is an example of a commit on master that fails after merging a PR with a bundle size change outside of the tolerances:
ngxs/store@80a3014
The text was updated successfully, but these errors were encountered: