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

version 1.0.0 - YAML support, new and stable Rule API #63

Merged
merged 37 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
712a7b3
The first major release - 1.0.0
allburov Sep 5, 2022
e1f3486
Rule API
allburov Sep 5, 2022
e4e5159
Add base url session object, remove artifactory_server\artifactory_ur…
allburov Sep 5, 2022
9fd5dda
Add ArtifactsList and ArtifactDict types
allburov Sep 5, 2022
e6821f4
Add separate 'check' method
allburov Sep 5, 2022
7de101d
Rename update_dict to filters, aql_add_find_filters
allburov Sep 5, 2022
8d73e7b
Fix docker images list query
allburov Sep 5, 2022
d329078
Rename `DeleteEmptyFolder` to `DeleteEmptyFolders`
allburov Sep 5, 2022
abdb3fc
Add types, rename loaders
allburov Sep 5, 2022
ec6a0e0
Fix type in password
allburov Sep 5, 2022
eb86902
rearrange changelog a little
allburov Sep 5, 2022
d509fcf
Check all attributes for old rules
allburov Sep 6, 2022
3a8532d
New yaml format - don't use rules' names as keys
allburov Sep 6, 2022
a74e111
Init basic yaml support
allburov Sep 6, 2022
0c14b5b
Rename `--policy-name` flag to `--policy`
allburov Sep 11, 2022
d47f849
Add explicit registry for rules
allburov Sep 11, 2022
7bcb26d
Validate config
allburov Sep 11, 2022
4bc0dba
Expand env variables in YAML config
allburov Sep 12, 2022
f4ddf19
Refactor docker rules
allburov Sep 12, 2022
2440330
Import rules from py files
allburov Sep 12, 2022
b757b8e
Add toc generate hook
allburov Sep 12, 2022
a6e21b2
Add yaml in readme
allburov Sep 12, 2022
b7b0d5f
Add version to cli
allburov Sep 12, 2022
bbbb0cc
Fix typos
allburov Sep 12, 2022
c358505
Remove long docstring from Repo rule
allburov Sep 12, 2022
b35c591
Remove old features - python config, cli flags, under_score names
allburov Sep 14, 2022
8315b9e
Add masks support for Include\Exclude rules, move docker rules to doc…
allburov Sep 14, 2022
911b387
Check keys in config file
allburov Sep 14, 2022
4bb91a2
Do not sort artifacts - some rule can sort them via AQL
allburov Sep 14, 2022
28f216c
Sort in memory to support JCR
allburov Sep 14, 2022
da0180f
Handle RuleForDocker for all rules
allburov Sep 14, 2022
f39e706
Fix KeepLatestNVersionImagesByProperty behavior
allburov Sep 14, 2022
ce344ba
Only examples folders
allburov Sep 15, 2022
0df0b82
Fix rules mask \ masks
allburov Sep 15, 2022
e92e1df
Log size of removed artifact
allburov Sep 16, 2022
6c5bf9c
Merge remote-tracking branch 'origin/yaml-configuration' into yaml-co…
allburov Sep 16, 2022
8f48d67
Rename FAQ to How to
allburov Sep 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ repos:
args:
- --in-place
- --remove-all-unused-imports
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: markdown-toc
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 1.0.0
- [BREAKING CHANGE] The version does not support python configuration anymore, use YAML `artifactory-cleanup.yaml` config file to specify policies and rules.
- [BREAKING CHANGE] No `under_score` names for rules, only `CamelCase`
- Support YAML configuration! #54 🎉
- Introduce new and stable (from this point) API for Rules #33
- Fix `KeepLatestNVersionImagesByProperty` wrong behaviour #60
- Rename `DeleteEmptyFolder` to `DeleteEmptyFolders`
- Rename `--policy-name` flag to `--policy`

### Backward incompatible changes
Keep these in mind if you create your own Rules and going to update from `0.4.1` to `1.0.0`.

In order to simplify API for Rule and CleanupPolicy and support some feature we have to introduce backward incompatible changes.

#### Rules API
- Methods have been changed:
- `_aql_add_filter(aql_query_list)` => `aql_add_filter(filters)`
- `_aql_add_text(aql_text)` => `aql_add_text(aql)`
- `_filter_result(result_artifact)` => `filter(artifacts)`
- `filter(artifacts)` must return `ArtifactsList` instance, not just a list
- Removed `artifactory_server`. Read below about new `self.session`, probably you don't need it anymore
- Renamed `self.artifactory_session` to `self.session`.
- Call `self.session.get('/relative/path)` - it adds Artifactory URL at the start of `/relative/path` and calls `http://artifactory.example.com/relaive/path`.
- If you still need to get Artifactory URL in rules - get it with `self.session.base_url`.
- Instead of `self.filter_result(self, result_artifacts)` use `artifacts.remove(artifacts_to_keep)` method in `self.filter`

## 0.4.2
- Fix: Failed to run artifactory-cleanup-0.4.1 command #64

Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
copy-examples:
cp tests/data/cleanup.yaml examples/artifactory-cleanup.yaml
cp tests/data/myrule.py examples/myrule.py
cp tests/data/policies.py examples/python_style_config.py

build:
docker build . --file docker/Dockerfile --tag devopshq/artifactory-cleanup
Loading