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

fix: check err before use schedule and duration (#20043) #20371

Conversation

daengdaengLee
Copy link
Member

@daengdaengLee daengdaengLee commented Oct 14, 2024

Cherry-picked fix: check err before use schedule and duration (#20043)

fix: check err before use schedule and duration
Signed-off-by: daengdaengLee gunho1020@gmail.com

test: add tests for invalid schedule and duration
Signed-off-by: daengdaengLee gunho1020@gmail.com

feat: change to return error when sync window is invalid
Signed-off-by: daengdaengLee gunho1020@gmail.com

fix: use assert.Error or assert.NoError
Signed-off-by: daengdaengLee gunho1020@gmail.com

fix: use require instead of assert
Signed-off-by: daengdaengLee gunho1020@gmail.com


Signed-off-by: daengdaengLee gunho1020@gmail.com


Hello, @crenshaw-dev.

It's my first try to cherry-pick to release branch.
There could be some mistakes. Please let me know if you find something I missed.

If there are no errors and the PR is merged, then I'll do same things to release 2.11 and 2.10.

Thanks!

ref : #20043 (comment)

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

* fix: check err before use schedule and duration

Signed-off-by: daengdaengLee <gunho1020@gmail.com>

* test: add tests for invalid schedule and duration

Signed-off-by: daengdaengLee <gunho1020@gmail.com>

* feat: change to return error when sync window is invalid

Signed-off-by: daengdaengLee <gunho1020@gmail.com>

* fix: use assert.Error or assert.NoError

Signed-off-by: daengdaengLee <gunho1020@gmail.com>

* fix: use require instead of assert

Signed-off-by: daengdaengLee <gunho1020@gmail.com>

---------

Signed-off-by: daengdaengLee <gunho1020@gmail.com>
@daengdaengLee daengdaengLee requested a review from a team as a code owner October 14, 2024 13:12
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 74.68354% with 20 lines in your changes missing coverage. Please review.

Project coverage is 50.37%. Comparing base (e2eb54c) to head (703a1ea).
Report is 11 commits behind head on release-2.12.

Files with missing lines Patch % Lines
server/application/application.go 36.36% 3 Missing and 4 partials ⚠️
controller/sync.go 69.23% 2 Missing and 2 partials ⚠️
pkg/apis/application/v1alpha1/types.go 92.85% 2 Missing and 1 partial ⚠️
cmd/argocd/commands/app.go 66.66% 0 Missing and 2 partials ⚠️
cmd/argocd/commands/projectwindows.go 0.00% 2 Missing ⚠️
server/project/project.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release-2.12   #20371      +/-   ##
================================================
- Coverage         50.37%   50.37%   -0.01%     
================================================
  Files               313      313              
  Lines             43167    43203      +36     
================================================
+ Hits              21747    21764      +17     
- Misses            18939    18946       +7     
- Partials           2481     2493      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daengdaengLee
Copy link
Member Author

Hello, @crenshaw-dev!
Could you review this PR, please?
Thanks!

Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

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

The change looks good @daengdaengLee

@ishitasequeira ishitasequeira merged commit cacb06a into argoproj:release-2.12 Oct 24, 2024
23 of 24 checks passed
@daengdaengLee daengdaengLee deleted the manual-cherry-pick-9b11b21-release-2.12 branch October 26, 2024 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants