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

Support min max object size in s3_lifecycle module #2205

Conversation

leo4ever
Copy link
Contributor

SUMMARY

Support the S3 lifecycle settings of minimum and maximum object size to apply the lifecycle rules.

Fixes #861

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

s3_lifecycle

ADDITIONAL INFORMATION

@leo4ever leo4ever mentioned this pull request Dec 17, 2024
1 task
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/f08060c4c200444dafdd5919d421be14

✔️ ansible-galaxy-importer SUCCESS in 4m 13s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 28s
✔️ ansible-test-splitter SUCCESS in 4m 56s
✔️ integration-community.aws-1 SUCCESS in 32m 10s
Skipped 21 jobs

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to submit this, especially for including the new integration tests.

If you take a look at the output from the tests you'll see a couple of issues:

These boil down to

  • The typo on line 63 breaks the documentation (YAML)
  • We use the "black" formatting style, If you've got tox setup, then tox -m format it should fix the formatting.

WRT Unit tests:
Unit tests can be a PITA to implement (they live under tests/unit/plugins/modules/).
I'd really like to see some basic tests for filters_are_equal if possible. However, by moving filters_are_equal outside of compare_and_update_configuration you'll make it easier for someone (possibly me) to come along later and add them if you're not able to do so.

plugins/modules/s3_lifecycle.py Outdated Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Outdated Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Outdated Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Outdated Show resolved Hide resolved
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/f9dfd0268ea947d3a2ec58131bd81d4f

ansible-galaxy-importer FAILURE in 5m 44s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 32s
✔️ ansible-test-splitter SUCCESS in 3m 56s
✔️ integration-community.aws-1 SUCCESS in 26m 13s
Skipped 21 jobs

@tremble
Copy link
Contributor

tremble commented Dec 23, 2024

One other minor request: Please add a "minor_changes" changelog entry: https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/84444fcea3b1475cb8ac064ce60a2be6

✔️ ansible-galaxy-importer SUCCESS in 3m 13s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 11s
✔️ ansible-test-splitter SUCCESS in 3m 53s
✔️ integration-community.aws-1 SUCCESS in 27m 49s
Skipped 21 jobs

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

Thanks,

Just as an FYI, you're still falling foul of some of our linting checks (tox -m lint), however they're all whitespace related so I'll push fixes.

For the unit tests, rather than quite so much copy and paste it's also possible to use pytest's parameterize which creates lots of copy&paste versions of the tests and means that if they start failing, it'll list all of the failed tests rather than just one.

changelogs/fragments/2205-support-minmax-s3lifecycle.yml Outdated Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Outdated Show resolved Hide resolved
plugins/modules/s3_lifecycle.py Outdated Show resolved Hide resolved
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/830428faada749faacf118a615b5307c

ansible-galaxy-importer FAILURE in 5m 20s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 37s
✔️ ansible-test-splitter SUCCESS in 4m 20s
✔️ integration-community.aws-1 SUCCESS in 26m 55s
Skipped 21 jobs

JavidMinadathAlimohi and others added 7 commits December 28, 2024 14:23
2. Updated code based on the feedback from PR review
2. Included a changelog minor change fragment file.
3. Enclosed types within double quotes.
@tremble tremble force-pushed the support_min_max_objectsize_s3lifecycle branch from 0ca971a to 23dc3ec Compare December 28, 2024 13:37
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/53d1c4d960094714a4c73c670c590b3a

ansible-galaxy-importer FAILURE in 4m 07s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 39s
✔️ ansible-test-splitter SUCCESS in 4m 02s
✔️ integration-community.aws-1 SUCCESS in 25m 49s
Skipped 21 jobs

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/c28b4596ae2d4fd5a00ca22a4a9a7e4f

ansible-galaxy-importer FAILURE in 4m 18s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 26s
✔️ ansible-test-splitter SUCCESS in 4m 20s
✔️ integration-community.aws-1 SUCCESS in 26m 00s
Skipped 21 jobs

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Dec 29, 2024
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/f7856cc72c8a4b2eaf2fc19571b15d84

ansible-galaxy-importer FAILURE in 4m 28s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 56s
✔️ ansible-test-splitter SUCCESS in 4m 08s
✔️ integration-community.aws-1 SUCCESS in 26m 32s
Skipped 21 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit af56b7f into ansible-collections:main Dec 29, 2024
45 of 46 checks passed
Copy link

patchback bot commented Dec 29, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/af56b7f09f4d9ba8ad0d2e2ceee0630aaf9d35cd/pr-2205

Backported as #2207

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 29, 2024
SUMMARY

Support the S3 lifecycle settings of minimum and maximum object size to apply the lifecycle rules.

Fixes #861
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

s3_lifecycle
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
Reviewed-by: Javid Alimohideen
(cherry picked from commit af56b7f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

s3_lifecycle - Add size thresholds
2 participants