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

feat: Append previous workflow name as label to resubmitted workflow #3261

Merged
merged 5 commits into from Jun 20, 2020
Merged

feat: Append previous workflow name as label to resubmitted workflow #3261

merged 5 commits into from Jun 20, 2020

Conversation

terrytangyuan
Copy link
Member

Append an additional label so it's easy for user to see the name of the original workflow that has been resubmitted.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed the CLA.
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Copy link
Member

@simster7 simster7 left a comment

Choose a reason for hiding this comment

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

Minor change, then this should be good to merge. Thanks!

const letters = "abcdefghijklmnopqrstuvwxyz0123456789"
const (
letters = "abcdefghijklmnopqrstuvwxyz0123456789"
previousWorkflowNameLabelKey = "workflows.argoproj.io/previous-workflow-name"
Copy link
Member

Choose a reason for hiding this comment

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

This should be added in https://github.com/argoproj/argo/blob/master/workflow/common/common.go

Also I would suggest this be called

Suggested change
previousWorkflowNameLabelKey = "workflows.argoproj.io/previous-workflow-name"
previousWorkflowNameLabelKey = "workflows.argoproj.io/resubmitted-from-workflow"

Comment on lines +499 to +501
if newWF.ObjectMeta.Labels == nil {
newWF.ObjectMeta.Labels = make(map[string]string)
}
Copy link
Member

Choose a reason for hiding this comment

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

Huh, wonder why this didn't come up as an issue before

newWF.ObjectMeta.Labels[key] = val
}
// Append an additional label so it's easy for user to see the
// name of the original workflow that has been resubmitted.
newWF.ObjectMeta.Labels[previousWorkflowNameLabelKey] = wf.ObjectMeta.Name
Copy link
Member

Choose a reason for hiding this comment

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

👍

@terrytangyuan
Copy link
Member Author

@simster7 Thanks for the review! Just updated the PR to address your comments.

@simster7 simster7 merged commit 55e1370 into argoproj:master Jun 20, 2020
@terrytangyuan terrytangyuan deleted the append-previous-wf branch June 20, 2020 20:50
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.

None yet

2 participants