gogoair / lavatory

Tooling to define repository specific retention policies in Artifactory.
Apache License 2.0
21 stars 14 forks source link

Use/party #8

Closed bazimov closed 6 years ago

ndcampbell commented 6 years ago

@bazimov last thing to point out, lavatory purge isnt working right now with the default policy since things were changed. I think that should be updated in this PR too.

My opinion is that at https://github.com/gogoair/lavatory/blob/master/src/lavatory/commands/purge.py#L28 you create another artifactory object with repo_name=repo, and then you pass that to the policy.purgelist(art_repo)

The policy then would look like:

def purgelist(artifactory):
    return artifactory.retain(None, depth=2, terms=[
            { "$or": [
                ]}
        ])

That None is still the project setting, which I think should be abstracted out later

bazimov commented 6 years ago

@ndcampbell did you mean like last commit? I still cannot make that find_by_aql work. Looking into it.

ndcampbell commented 6 years ago

@bazimov yup! Looks good. I'll poke around at the find_by_aql issue too.

ndcampbell commented 6 years ago

@bazimov figured it out. Couple of issues. That find_by_aql expects a dict, we are sending a string. We need to just remove the json.dumps from find_expr and then set find_by_aql(criteria=find_expr)

you can delete the sort, offset, and limit parts too, those are all in the party function: https://github.com/tedops/party/blob/master/party/aql.py

ndcampbell commented 6 years ago

@bazimov this looks good to me, are you planning on adding anything else or is this still WIP?