devopshq / devopshq/artifactory-cleanup

KeepLatestNFilesInFolder not working properly when more than one repository is selected

Open
#69 1 comment 0 reactions 0 assignees View on GitHub
bug good first issue hacktoberfest help wanted
Dominant language
Python
Stars
160
Forks
87
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.