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

Prune pipelines / pipeline runs #429

Merged
merged 1 commit into from
Feb 9, 2022
Merged

Conversation

michaelsauter
Copy link
Member

@michaelsauter michaelsauter commented Feb 2, 2022

Closes #153.

Tasks:

  • Updated design documents in docs/design directory or not applicable
  • Updated user-facing documentation in docs directory or not applicable
  • Ran tests (e.g. make test) or not applicable
  • Updated changelog or not applicable

@michaelsauter michaelsauter self-assigned this Feb 2, 2022
@michaelsauter michaelsauter marked this pull request as ready for review February 8, 2022 08:52
@michaelsauter michaelsauter force-pushed the feature/pr-cleanup branch 2 times, most recently from 0ea735f to 5083f2f Compare February 8, 2022 16:16
Copy link
Member

@gerardcl gerardcl left a comment

Choose a reason for hiding this comment

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

so far it LGTM! If I got it right, old pipelines already existing prior upgrading to a new ods-pipeline release (that includes this PR) will need manual cleanup, right?

I added some small comments and questions and maybe I would go for adding another test with changing to different edge/expected cases with the params minKeepHours and maxKeepRuns in pruner_test.go?

but approving for now! this is looking good!! 🚀

internal/interceptor/pruner.go Outdated Show resolved Hide resolved
internal/interceptor/pruner.go Outdated Show resolved Hide resolved
cmd/start/main.go Show resolved Hide resolved
@michaelsauter
Copy link
Member Author

michaelsauter commented Feb 9, 2022

If I got it right, old pipelines already existing prior upgrading to a new ods-pipeline release (that includes this PR) will need manual cleanup, right?

Correct, I added a comment in the changelog regarding this.

I added some small comments and questions and maybe I would go for adding another test with changing to different edge/expected cases with the params minKeepHours and maxKeepRuns in pruner_test.go?

Good point! I added some validation to ensure minKeepHours>=1 and maxKeepRuns>=1. The logic would work also for minKeepHours=0 and maxKeepRuns=0, but I think that is unlikely to be what the user actually wanted to do, so better to prevent it.

@michaelsauter michaelsauter merged commit 7ee2e95 into master Feb 9, 2022
@michaelsauter michaelsauter deleted the feature/pr-cleanup branch February 9, 2022 10:18
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.

Clean up pipelines associated with old / merged branches
2 participants