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
Project Audit Events are full of "Added protected branch" #178
Comments
Hello Greg |
This issue may actually break pipelines if they depend on protected variables and run at the same moment when protection was removed and not yet put back. |
We do it to change the file values if you use the |
Another place is in the branch processor: https://github.com/egnyte/gitlabform/blob/main/gitlabform/gitlabform/processors/project/branches_processor.py#L13 |
Interesting place: https://github.com/egnyte/gitlabform/blob/9908247e66b5c6cac47d1c147dbb9235e8aebd7a/gitlabform/gitlabform/processors/util/branch_protector.py#L37 Is it really required to unprotect first to change those values? |
It was when I wrote that code.. Or I am not aware of some GitLab API feature? Something sudo-like? But was always using an admin token, so it should not be necessary.. |
Thanks! It looks like still required, but in most cases those settings are already set so this part in the code means lets rewrite the same thing which already set. How about to check if settings are different first? I've tried to implement it via above MR but tests still require to be fixed. |
It'd be great if we could do that. Otherwise I find the audit events are becoming too noisy; not to mention the potential of CI breaking due to protected variables not being available when this is happening. |
Skip branch unprotect/protect if the same values are already set This will fix #178
Part of #178 Patch author: Robin Moss
As I can see this one is fixed in latest releases of 2.x . |
Yes, it should be completely fixed in v2.0.2+. Please reopen if anyone is still seeing this issue after GitLabForm upgrade. |
I am seeing this. :P |
So am I, but not sure when this started happening again 🤔 |
This should finally be fixed in the next release, with the above PR, to be released in a day or two. |
Probably because we unprotect and then protect branches again to perform some operations.
The text was updated successfully, but these errors were encountered: