-
Notifications
You must be signed in to change notification settings - Fork 152
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 github_branch_protection #301
Conversation
Codecov Report
@@ Coverage Diff @@
## main #301 +/- ##
==========================================
+ Coverage 68.92% 69.03% +0.11%
==========================================
Files 269 273 +4
Lines 5724 5796 +72
==========================================
+ Hits 3945 4001 +56
- Misses 1436 1447 +11
- Partials 343 348 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~LGTM
if repoId == "" { | ||
return fmt.Sprintf("Branch: %s (Id: %s)", *r.Pattern, r.Id) | ||
} | ||
return fmt.Sprintf("Branch: %s, RepoId: %s", *r.Pattern, repoId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't missing parenthesis for RepoId ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be consistent then. But I'm fine with one or the other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Maybe we could add a warning when we find unmanaged repository only ? Saying that this might be a false positive as we don't support v3 ? |
We cannot make the difference between a false positive drift and a real drift with this approach. WDYT @moadibfr @wbeuil ? Is it worth it ? I can totally do this in a couple of hours. |
7ba90c4
to
a19ec7e
Compare
a19ec7e
to
cb6c58f
Compare
I'm not sure it's worth your time to do it. Are we sure that we can create a non-v3 resource with a v3 resource ? Can't we just warn the user if we find a v3 resource in its state ? |
468a5e6
to
ca6c9cc
Compare
7f5cbdf
to
7d0a28c
Compare
Description
github_branch_protection_v3
, we should create a resource, a deserializer and a finally a middleware to check if there is anygithub_branch_protection_v3
resource in state just to send an alert and remove theses resources. Do we really want to do that ? Maybe a line in LIMITATIONS.md may be enough.Attentive review required please @moadibfr @wbeuil