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

S3: Multiple Transitions in lifecycle configuration #6439

Merged

Conversation

ccatterina
Copy link
Contributor

Hi @bblommers,
Some points about the implementation:

  • I noticed that also NoncurrentVersionTransitions could be a list of multiple transitions so I made some changes to allow also multiple NoncurrentVersionTransitions.
  • I added the property NewerNoncurrentVersions to NoncurrentVersionTransitions. https://docs.aws.amazon.com/AmazonS3/latest/API/API_NoncurrentVersionTransition.html
  • I've created 2 new classes LifecycleTransition and LifeCycleNoncurrentVersionTransition along the lines of LifecycleRule but I didn't understand exactly the purpose of BaseModel class. Is this approach ok?
  • I added also Transitions and NoncurrentVersionTransitions to the dict returned by LifecyleRule.to_config_dict but I don't understand if I need to respect some structure or properties should have predefined names.

Handle multiple Transitions/NoncurrentVersionTranstions in bucket
lifecycle configuration.

Fixes getmoto#6388
@bblommers
Copy link
Collaborator

I've created 2 new classes LifecycleTransition and LifeCycleNoncurrentVersionTransition along the lines of LifecycleRule but I didn't understand exactly the purpose of BaseModel class. Is this approach ok?

Inheriting BaseModel ensures that the classes show up on the Moto Dashboard, for people that are using the MotoServer. So it makes a lot of sense to use it here.

I added also Transitions and NoncurrentVersionTransitions to the dict returned by LifecyleRule.to_config_dict but I don't understand if I need to respect some structure or properties should have predefined names.

Me neither! But if it's wrong, I'm sure somebody will complain. :)

@bblommers bblommers added this to the 4.1.12 milestone Jun 24, 2023
@bblommers bblommers linked an issue Jun 24, 2023 that may be closed by this pull request
Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

LGTM - thank you for fixing this @ccatterina!

@bblommers bblommers merged commit 9b8e249 into getmoto:master Jun 24, 2023
@bblommers
Copy link
Collaborator

The payment-approved label should've created this comment automatically, but considering it didn't, I'll do it manually:

Thank you for contributing to Moto!

To show our thanks, we'd like to share some of the donations that we've received with you. PR's like this are the big reason that Moto is as successful as it is - so it's only fair that you, as a contributor, gets to share the spoils.

We've created a companion website with more information:
https://payments.getmoto.org/

Feel free to open a bug or discussion if you run into any problems:
https://github.com/getmoto/payments`

@github-actions
Copy link
Contributor

This is now part of moto >= 4.1.12.dev62

@ccatterina
Copy link
Contributor Author

Thank you for contributing to Moto!

To show our thanks, we'd like to share some of the donations that we've received with you. PR's like this are the big reason that Moto is as successful as it is - so it's only fair that you, as a contributor, gets to share the spoils.

We've created a companion website with more information:
https://payments.getmoto.org/

Feel free to open a bug or discussion if you run into any problems:
https://github.com/getmoto/payments`

@bblommers Thank you, I appreciate it!

@bblommers
Copy link
Collaborator

FYI @ccatterina, I just noticed a bug in our login-flow for https://payments.getmoto.org. I don't know if you encountered this, but if you did - apologies! This should now be fixed.

@ccatterina
Copy link
Contributor Author

@bblommers yes, I encountered it and I thought it was a temporary problem. Thank you! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3: put_bucket_lifecyle with multiple Transitions
2 participants