Skip to content

Conversation

juliev0
Copy link
Contributor

@juliev0 juliev0 commented Oct 26, 2024

For Numaplane Resources, makes the following changes to health status scripts:

  • includes more cases that would result in "Progressing"

  • refactors a bit such that if no cases match, then the result is "Unknown", not "Progressing"

  • removes the check for observedGeneration from the Conditions, as it is already in the overall Status, which tells us if the reconciliation is still "Progressing". What the Condition says is considered valid regardless of its ObservedGeneration.

  • changes to Tests:
    -- adds a directory in each testdata directory to identify which CRD it is - otherwise, it's hard to tell when a test fails which CRD the failure refers to since all that's output is the local path to the directory
    -- adds new tests for new cases of "Progressing"
    -- updates Message associated with some of the existing tests (however, the "status" returned is the same)

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).

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Copy link

bunnyshell bot commented Oct 26, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Copy link

codecov bot commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@745f1cc). Learn more about missing BASE report.
Report is 393 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #20544   +/-   ##
=========================================
  Coverage          ?   55.11%           
=========================================
  Files             ?      324           
  Lines             ?    55112           
  Branches          ?        0           
=========================================
  Hits              ?    30375           
  Misses            ?    22127           
  Partials          ?     2610           

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

@juliev0 juliev0 marked this pull request as ready for review October 26, 2024 21:59
@juliev0 juliev0 requested a review from a team as a code owner October 26, 2024 21:59
Copy link
Member

@dpadhiar dpadhiar left a comment

Choose a reason for hiding this comment

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

LGTM

@crenshaw-dev
Copy link
Member

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Code Redundancy
There is significant redundancy in the health status checks across different resources. Consider abstracting common logic into shared functions to reduce code duplication and improve maintainability.

Error Handling
The script lacks comprehensive error handling for potential nil values in the nested properties of obj.status. This could lead to runtime errors if any of these nested properties are nil.

Logical Error
The condition checks might not correctly handle all edge cases, particularly with complex nested conditions. Review the logic to ensure all scenarios are correctly handled.

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

One small refactor request for each, otherwise lgtm.

Comment on lines 57 to 59
hs.status = "Progressing"
hs.message = "Not yet reconciled"
return hs
Copy link
Member

Choose a reason for hiding this comment

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

Move to top, un-nest non-nil block?

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Copy link
Member

@dpadhiar dpadhiar left a comment

Choose a reason for hiding this comment

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

Moved nil check LGTM!

@crenshaw-dev crenshaw-dev merged commit 9687619 into argoproj:master Oct 29, 2024
27 checks passed
adriananeci pushed a commit to adriananeci/argo-cd that referenced this pull request Dec 4, 2024
* fix: updates to health status for Numaplane resources

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* health checks

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* fix testdata path

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* additional health check tests

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* temporary file removal

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* add file renamed

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* fix: empty commit

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* move check for no status

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* fix: empty commit

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

* fix: empty commit

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>

---------

Signed-off-by: Julie Vogelman <julievogelman0@gmail.com>
Signed-off-by: Adrian Aneci <aneci@adobe.com>
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.

4 participants