Skip to content

feat: add succeeded to retentionPolicy Fixes #12135#14475

Open
antbbn wants to merge 2 commits intoargoproj:mainfrom
antbbn:fix-retention
Open

feat: add succeeded to retentionPolicy Fixes #12135#14475
antbbn wants to merge 2 commits intoargoproj:mainfrom
antbbn:fix-retention

Conversation

@antbbn
Copy link

@antbbn antbbn commented May 18, 2025

Retention of Completed workflows to delete from the other three phases
adds secondsAfterError to TTLStrategy to align with retentionPolicy

Fixes #12135

Motivation

Previous naming was not aligned with the behaviour.

Modifications

Separated retention policy check for completed workflows.
Added secondsAfterError to TTLStrategy because the Error phase was not considered in the TTL but was considered in the retention and I found this a bit confusing.

Verification

Tested in DevContainer by submittion various workflows that ended in all the phases involved in the retention.

Documentation

Added a more detailed explanation of retention to the workflow controller configmap yaml.

@antbbn
Copy link
Author

antbbn commented May 18, 2025

Not sure about these test failures, test-executor passes in my devcontainer, test-corefunctional was not failing before the last commit not sure if that's just a temporary issue..

@blkperl
Copy link
Member

blkperl commented May 29, 2025

/retest

1 similar comment
@blkperl
Copy link
Member

blkperl commented May 30, 2025

/retest

@antbbn
Copy link
Author

antbbn commented Jun 13, 2025

@Joibel I saw you added some comments to retention_policy.go is this PR still relevant?

@Joibel
Copy link
Member

Joibel commented Jun 13, 2025

@Joibel I saw you added some comments to retention_policy.go is this PR still relevant?

Yes, the PR is still relevant. The comments were added as part of generating full docs for the workflow-controller-configmap. I'm sorry no-one has reviewed it yet. I'm busy on other things at the moment.

@antbbn
Copy link
Author

antbbn commented Jun 13, 2025

@Joibel I saw you added some comments to retention_policy.go is this PR still relevant?

Yes, the PR is still relevant. The comments were added as part of generating full docs for the workflow-controller-configmap. I'm sorry no-one has reviewed it yet. I'm busy on other things at the moment.

No worries, I totally understand, i'll fix the conflicts in the meanwhile :)

Signed-off-by: Antonio Bibiano <antbbn@gmail.com>
Signed-off-by: Antonio Bibiano <antbbn@gmail.com>
switch phase {
case wfv1.WorkflowSucceeded:
maxWorkflows = c.retentionPolicy.Completed
maxWorkflows = c.retentionPolicy.Succeeded
Copy link
Member

Choose a reason for hiding this comment

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

Although I applaud the idea of maintaining backwards compatibility I think I'd rather this was a breaking change and we just document it as such:

  • It's a feature so only going out in a minor or major release
  • It's trivial to update your configuration to make it work the new way.

To that end think there should be a little more documentation in this PR in the docs/upgrading.md, but drop this compatibility block.
If we keep this we need to document this unexpected behaviour, and live with it "forever"

return x
}

func (h *gcHeap) PeekPopTimestamp() (time.Time, error) {
Copy link
Member

Choose a reason for hiding this comment

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

PeekHeadTimestamp? This function doesn't appear to actually Pop which I'd assumed from it's name

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.

retentionPolicy.completed actually means succeeded

3 participants