Skip to content
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

Implement StatusCheck Reconciler #3037

Merged
merged 19 commits into from
Apr 15, 2022

Conversation

iguoyr
Copy link
Member

@iguoyr iguoyr commented Mar 17, 2022

What problem does this PR solve?

Close #2983

What's changed and how it works?

Proposal: Workflow Status Check

Related changes

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI
  • Need to cheery-pick to release branches
    • release-2.1
    • release-2.0

Checklist

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

Release note

Please add a release note.

You can safely ignore this section if you don't think this PR needs a release note.

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
…nciler

Signed-off-by: SiyuChen <ryougi201@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • STRRL
  • YangKeao

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@codecov
Copy link

codecov bot commented Mar 17, 2022

Codecov Report

Merging #3037 (7278858) into master (92c0311) will increase coverage by 1.54%.
The diff coverage is 69.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3037      +/-   ##
==========================================
+ Coverage   36.46%   38.01%   +1.54%     
==========================================
  Files         109      116       +7     
  Lines       10044    10535     +491     
==========================================
+ Hits         3663     4005     +342     
- Misses       6046     6184     +138     
- Partials      335      346      +11     
Impacted Files Coverage Δ
controllers/statuscheck/fx.go 0.00% <0.00%> (ø)
controllers/utils/recorder/statuscheck.go 18.18% <18.18%> (ø)
controllers/statuscheck/http/http.go 26.98% <26.98%> (ø)
controllers/statuscheck/manager.go 70.53% <70.53%> (ø)
controllers/statuscheck/controller.go 79.26% <79.26%> (ø)
controllers/statuscheck/worker.go 94.04% <94.04%> (ø)
controllers/statuscheck/conditions.go 96.84% <96.84%> (ø)
pkg/selector/generic/mode.go 28.20% <0.00%> (+2.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a3c204...7278858. Read the comment docs.

Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
@iguoyr iguoyr marked this pull request as ready for review March 23, 2022 14:15
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
@iguoyr iguoyr requested review from a team March 28, 2022 05:35
@iguoyr
Copy link
Member Author

iguoyr commented Mar 31, 2022

@chaos-mesh/committers @chaos-mesh/maintainers PTAL

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥰 that's a lot of great work! I have several questions about this PR; PTAL

api/v1alpha1/statuscheck_types.go Outdated Show resolved Hide resolved
api/v1alpha1/statuscheck_types.go Outdated Show resolved Hide resolved
controllers/utils/recorder/statuscheck.go Show resolved Hide resolved
controllers/statuscheck/worker.go Outdated Show resolved Hide resolved
controllers/statuscheck/worker.go Show resolved Hide resolved
controllers/statuscheck/controller.go Outdated Show resolved Hide resolved
controllers/statuscheck/controller.go Show resolved Hide resolved
controllers/statuscheck/controller.go Outdated Show resolved Hide resolved
controllers/statuscheck/fx.go Outdated Show resolved Hide resolved
controllers/statuscheck/http/http.go Outdated Show resolved Hide resolved
@STRRL
Copy link
Member

STRRL commented Apr 6, 2022

And tests in api/v1apha1 were not included by CI, there is no Http but HTTP exist:

@iguoyr
Copy link
Member Author

iguoyr commented Apr 11, 2022

@STRRL Updated, PTAL!

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, if the error is returned by other methods in the same package, and there are no other necessary context to be attached, the errors.Wrap could be omitted.

I forget where to introduce this rule, but it seems to be a rule of a linter. I would append the reference if I find it one day.

api/v1alpha1/statuscheck_types.go Outdated Show resolved Hide resolved
controllers/statuscheck/controller.go Outdated Show resolved Hide resolved
controllers/statuscheck/controller.go Outdated Show resolved Hide resolved
controllers/statuscheck/controller.go Outdated Show resolved Hide resolved
controllers/statuscheck/controller.go Outdated Show resolved Hide resolved
@STRRL
Copy link
Member

STRRL commented Apr 12, 2022

And the logic about FailureThreshold and SuccessThreshold appear twice, in worker sameResultCount and in condition isThresholdExceed

Please append comments for them, with the reference to another method like "if you changed the logic at [here], you must change the logic at [there] for keeping the logic consistent."

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM!

controllers/statuscheck/conditions_test.go Outdated Show resolved Hide resolved
func Test_isThresholdExceed(t *testing.T) {
type args struct {
records []v1alpha1.StatusCheckRecord
want v1alpha1.StatusCheckOutcome
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change a name other than want, it is a little ambiguous with following want in tests(out of args)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it was auto-generated by GoLand 😢, do you have any suggestions to instead want?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about outcome?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! (I found that I misunderstand your point before 😢)

controllers/statuscheck/controller.go Show resolved Hide resolved
controllers/statuscheck/controller_test.go Show resolved Hide resolved
controllers/statuscheck/worker.go Show resolved Hide resolved
Signed-off-by: SiyuChen <ryougi201@gmail.com>
@iguoyr
Copy link
Member Author

iguoyr commented Apr 13, 2022

@STRRL Updated! PTAL again ❤️

Signed-off-by: SiyuChen <ryougi201@gmail.com>
…nciler

Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Signed-off-by: SiyuChen <ryougi201@gmail.com>
Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@iguoyr
Copy link
Member Author

iguoyr commented Apr 15, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 34e3305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: StatusCheck in Workflow, Implement StatusCheck Reconciler
4 participants