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

KeepLatestNFilesInFolder not working properly when more than one repository is selected #69

Open
afolgado opened this issue Sep 15, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@afolgado
Copy link

Hi all,

When filtering by RepoByMask instead of Repo, multiple repositories could be selected.

In this case, the rule KeepLatestNFilesInFolder won't work properly because doesn't use the repository name for grouping the artifacts: https://github.com/devopshq/artifactory-cleanup/blob/master/artifactory_cleanup/rules/keep.py#L134

My proposal is to modify it to something like this:

        for artifact in result_artifact:
            path = '{repo}/{path}'.format(**artifact)
            artifacts_by_path[path].append(artifact)

It would be nice to add the repo name to this print too: https://github.com/devopshq/artifactory-cleanup/blob/master/artifactory_cleanup/rules/keep.py#L146

Thanks for this awesome tool!

@allburov
Copy link
Member

@afolgado hi, thank you for providing the feedback! Yep, it looks like a bug.

Feel free to create a PR for suggested changes and the solution for the bug!

@allburov allburov added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Development

No branches or pull requests

2 participants