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

Retention: Implement Filter: Keep Latest K #8255

Merged

Conversation

nlowe
Copy link
Contributor

@nlowe nlowe commented Jul 10, 2019

This ports my WIP implementation to match the updated proposal.

Fixes #6660

Signed-off-by: Nathan Lowe public@nlowe.me

Signed-off-by: Nathan Lowe <public@nlowe.me>
@nlowe nlowe added the area/tag-retention Issues relating to the tag retention policies features label Jul 10, 2019
@nlowe nlowe requested a review from steven-zou July 10, 2019 03:27
@nlowe nlowe added this to In progress in Tag Retention Policies via automation Jul 10, 2019
@nlowe nlowe moved this from In progress to Needs review in Tag Retention Policies Jul 10, 2019
@coveralls
Copy link

coveralls commented Jul 10, 2019

Pull Request Test Coverage Report for Build 13562

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • 162 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.6%) to 64.434%

Files with Coverage Reduction New Missed Lines %
src/pkg/retention/policy/alg/or/processor.go 25 81.51%
src/common/api/base.go 32 66.23%
src/core/api/chart_repository.go 105 33.43%
Totals Coverage Status
Change from base Build 13474: -0.6%
Covered Lines: 17262
Relevant Lines: 26790

💛 - Coveralls

Copy link
Contributor

@steven-zou steven-zou left a comment

Choose a reason for hiding this comment

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

Commented

"github.com/stretchr/testify/require"
)

func TestEvaluator_New(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the github.com/stretchr/testify testing framework to drive the test cases as I did in the or/processor_test.go?

i = len(artifacts)
}

return artifacts[:i], nil
Copy link
Contributor

Choose a reason for hiding this comment

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

The input list does not guarantee the order. I think you need to do sort first and then return the k ones.

…r/testify/suite

Signed-off-by: Nathan Lowe <public@nlowe.me>
@nlowe nlowe moved this from Needs review to In progress in Tag Retention Policies Jul 15, 2019
Copy link
Contributor

@steven-zou steven-zou left a comment

Choose a reason for hiding this comment

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

LGTM

Tag Retention Policies automation moved this from In progress to Reviewer approved Jul 16, 2019
@steven-zou steven-zou merged commit 3243d5b into feature/tag_retention Jul 16, 2019
Tag Retention Policies automation moved this from Reviewer approved to Done Jul 16, 2019
@steven-zou steven-zou deleted the feat/retention/GH-6660-keep-most-recent-n branch July 16, 2019 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tag-retention Issues relating to the tag retention policies features
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants