-
Notifications
You must be signed in to change notification settings - Fork 81
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
Adding support for removing branch #382
Adding support for removing branch #382
Conversation
/cc @akhilerm |
b5fddcb
to
f3a5dae
Compare
7d2353d
to
5239145
Compare
Adding support for removing branch
5239145
to
05a400d
Compare
@akhilerm Please Review |
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.
Provided a few comments.
@mohitsharma-in kubernetes/kubernetes#120822 has been merged. So now you wont see the diff in the rules related to the new field. |
936cee1
to
47b8753
Compare
@mohitsharma-in Is this ready for review ? |
@akhilerm |
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.
Given a few comments.
371aea9
to
69f351f
Compare
69f351f
to
b85412e
Compare
df5190e
to
02a4bf5
Compare
24490f5
to
aa70fd9
Compare
aa70fd9
to
906c4b3
Compare
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.
A few changes are needed on the test cases.
Sorry @mohitsharma-in I missed to review the test file during the last round of review.
cmd/update-rules/main_test.go
Outdated
"release-1.20", | ||
"release-1.XY", | ||
"1.17.1", |
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.
A few changes are needed on the tests.
- Can you give a proper name to the test?
- Since
release-1.XY
does not exist in thetestdata/rules.yaml
, if we try to delete that branch, the test will always pass. We need to add another case in which we try to delete a branch that already exists in the rules.yaml file and make sure that after the UpdateRules() func, the branch is properly deleted.
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 1 and 2
For 2 point we already have a loop which checks and returns error if branch is not deleted
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.
We need the inverse of that also, Like to make sure that there are no changes to any of the rules. see the below comment.
cmd/update-rules/main_test.go
Outdated
} | ||
UpdateRules(rules, tt.branch, tt.goVersion, true) | ||
|
||
for _, repoRule := range rules.Rules { |
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.
One more check needs to be done to make sure that, if the branch to be deleted was a non-existent branch, there are no changes to the rules that has been loaded from testdataRules
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.
we have the error logged in the below loop for the same if it failed to delete the branch do you mean should we check if branch exist or not instead before deleting?
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.
we have the error logged in the below loop for the same if it failed to delete the branch
this is correct.
do you mean should we check if branch exist or not instead before deleting?
no. The test should check that, if a non existent branch is tried for deletion, it doesnt affect rest of the rules.
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.
Do you have and recommendations around this
0f9b654
to
e6cc84a
Compare
/retest |
5bb3ffa
to
494bbe8
Compare
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.
@akhilerm: GitHub didn't allow me to assign the following users: for, approval. Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akhilerm, dims, mohitsharma-in The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adding support for removing branch
Fixes #377
Cc: @akhilerm