Skip to content

Conversation

crenshaw-dev
Copy link
Member

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

Copy link

bunnyshell bot commented May 16, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

codecov bot commented May 17, 2025

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.00%. Comparing base (797f1d6) to head (d190760).
⚠️ Report is 471 commits behind head on master.

Files with missing lines Patch % Lines
controller/state.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #23018      +/-   ##
==========================================
- Coverage   60.00%   60.00%   -0.01%     
==========================================
  Files         343      343              
  Lines       57848    57847       -1     
==========================================
- Hits        34714    34710       -4     
- Misses      20358    20362       +4     
+ Partials     2776     2775       -1     

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

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

fix tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

fix tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

fix tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

fix tests, lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev crenshaw-dev force-pushed the do-not-reuse-structs branch from 3494413 to 8233906 Compare May 17, 2025 17:27
@agaudreault agaudreault marked this pull request as ready for review May 19, 2025 15:32
@agaudreault agaudreault requested a review from a team as a code owner May 19, 2025 15:32
Comment on lines 1793 to 1794
// Message is a human-readable informational message describing the health status
Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
Copy link
Member

Choose a reason for hiding this comment

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

Add back the field as deprecated just so the protobuf byte is reserved.

@@ -1787,15 +1787,20 @@ type SyncStatus struct {
}

// HealthStatus contains information about the currently observed health state of an application or resource
Copy link
Member

Choose a reason for hiding this comment

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

super nit

Suggested change
// HealthStatus contains information about the currently observed health state of an application or resource
// AppHealthStatus contains information about the currently observed health state of an application or resource

@rumstead
Copy link
Member

From my understanding, you are breaking HealthResource struct by app and resource. I guess that caused some issues when normalizing?

@crenshaw-dev crenshaw-dev marked this pull request as draft May 19, 2025 16:08
@crenshaw-dev
Copy link
Member Author

@rumstead sharing a single field just made the code very confusing. The actual bug is that we update lastTransitionTime when we shouldn't.

I'm going to update the PR to make the changes minimal and backwards-compatible. Then I'm going to make an even more minimal 2.14 cherry-pick to just solve the bug with no other changes.

@crenshaw-dev crenshaw-dev force-pushed the do-not-reuse-structs branch 2 times, most recently from f8dcda3 to 39968f9 Compare May 19, 2025 20:01
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

comment

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

simplify, better test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

e2e test

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

remove unnecessary test - covered elsewhere'

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev crenshaw-dev force-pushed the do-not-reuse-structs branch from 39968f9 to d190760 Compare May 19, 2025 21:03
@crenshaw-dev crenshaw-dev marked this pull request as ready for review May 20, 2025 14:47
Copy link
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

LGTM. From my understanding, the change to the protobuf should be backward compatible too.

@crenshaw-dev crenshaw-dev merged commit 45a8c68 into argoproj:master May 20, 2025
40 of 41 checks passed
LyhengTep pushed a commit to LyhengTep/argo-cd that referenced this pull request May 24, 2025
…#23018)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Lyheng <lyhengtep@gmail.com>
tylerrosnett pushed a commit to StateFarmIns/argo-cd that referenced this pull request May 27, 2025
…#23018)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
chansuke pushed a commit to chansuke/argo-cd that referenced this pull request Jun 4, 2025
…#23018)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
dsuhinin pushed a commit to dsuhinin/argo-cd that referenced this pull request Jun 16, 2025
…#23018)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
dsuhinin pushed a commit to dsuhinin/argo-cd that referenced this pull request Jun 16, 2025
…#23018)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
dsuhinin pushed a commit to dsuhinin/argo-cd that referenced this pull request Jun 16, 2025
…#23018)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
@krancour
Copy link
Contributor

Sorry to be commenting on something closed since May, but I'm trying to understand... since this basically undoes #18660 and #21120 is not yet merged, doesn't the deprecation of lastTransitionTime leave us once again in a spot where there is no available (reliable and non-deprecated) indicator of how fresh observations about App health may be?

@crenshaw-dev
Copy link
Member Author

crenshaw-dev commented Jul 23, 2025

@krancour I don't think this change reverts #18660, I think it brings the implementation in line with the intent of that PR. lastTransitionTime was always intended to only be updated when the health status changed. Prior to this PR, it was updated at times even when there was no transition.

This PR deprecates two Application CR status fields, but neither of them is a deprecation of any existing behavior. The app health and resource health status fields previously shared a single struct. That struct contained a lastTransitionTime field, used only for app health, and a message field, used only for resource health. This PR split the shared struct into two specific structs for the two specific use cases. Both structs retained all fields not because all the fields were actually used, but because as a policy we don't remove fields in the v1alpha1 spec. The fields were marked as deprecated to ensure that no future changes erroneously start using those fields that, up to this point, have been unused.

We never had a reliable indicator of how fresh observations about app health are, unless by mistake as part of a buggy implementation of #18660. observedAt, which hasn't been merged yet, was always meant to be the feature to satisfy that use case.

@krancour
Copy link
Contributor

@crenshaw-dev thanks. I follow.

"Reliable indicator of health freshness" (paraphrasing) was a very poor word choice on my part. I agree lastTransitionTime didn't at all (unless by accident of a buggy implementation) achieve that.

Unreliable as it was, lastTransitionTime was the only thing we had to go on to, heuristically, guess at freshness, so I suppose my previous comment really boiled down to surprise at seeing it deprecated without the superior observedAt field from #21120 having yet replaced it.

Thanks for the response. Much appreciated.

@crenshaw-dev
Copy link
Member Author

You bet! Thanks for following up for clarification, I didn't make very clear on this PR what it was doing.

I wouldn't think of observedAt as superior to lastTransitionTime necessarily... they both serve valid purposes and can make a great combo. I wasn't a fan of observedAt early on, but I think it's useful and fine as an opt-in. I don't have bandwidth to push that PR right now, but I'll be happy to support getting it merged.

And just to be extra clear, this PR didn't deprecate anything meaningful. It deprecated a couple struct fields that were never used in the first place. The only change in behavior in this PR was to limit lastTransitionTime updates to moments when there was actually a health status transition.

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