Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement ASF S3 operations in provider #6859

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

Merged
merged 13 commits into from
Sep 14, 2022
Merged

Implement ASF S3 operations in provider #6859

merged 13 commits into from
Sep 14, 2022

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Sep 12, 2022

This PR starts the implementation of S3 actions. Simple behaviour is implemented first, reducing the number of test failure. Additional behaviour will be added later in those actions implementation, for example S3 notifications.
All these actions are based on Moto and no additional logic is involved, except adding/fixing some fields.
Patching of the specs was very needed and will continued to be.

This also introduces the S3Store for the provider, but it doesn't have a use case yet (will surely have importance with notifications).

Actions implemented:

  • CreateBucket (very simple one, missing features)
  • ListObjects
  • ListObjectsV2
  • HeadObject
  • GetObject
  • PutObject
  • GetBucketLifecycle
  • GetBucketLifecycleConfiguration
  • PutBucketLifecycleConfiguration
  • DeleteBucketLifecycleConfiguration

This also add patching of moto for some actions: some headers were returned lower-cased ("last-modified") when their location in the specs was "Last-Modified". I fixed what they return in Moto, but no sure if this should be handled in the parser.

This PR is based on #6827 for testing against ASF provider, and will be rebased on master for a test run before being merged.
Once rebased on master, I will regenerate the specs without the docs to match the auto generated ones. (Already done because of merge conflict)

For an easier review, those files should be ignored and are part of #6827:

  • .github/workflows/terraform-tests.yml
  • localstack/config.py
  • localstack/aws/protocol/service_router.py

Local tests results for the TestS3 class:

/ Before After
✅ Passed 18 38
🙈 Ignored 6 6
❗ Failed 31 14
Total 55 58

I will mark with conditions in the next PR some skip_snapshot_verify paths that are already parts of the new provider and not the legacy one.

Edit: thanks to Alex commit,
there's one less xfail test, but it will be counted once we introduce condition for tests.

@bentsku bentsku temporarily deployed to localstack-ext-tests September 12, 2022 12:34 Inactive
@bentsku bentsku temporarily deployed to localstack-ext-tests September 12, 2022 13:16 Inactive
@bentsku bentsku temporarily deployed to localstack-ext-tests September 12, 2022 13:18 Inactive
@alexrashed alexrashed temporarily deployed to localstack-ext-tests September 12, 2022 14:38 Inactive
@github-actions
Copy link

github-actions bot commented Sep 12, 2022

LocalStack integration with Pro

       3 files  ±0         3 suites  ±0   1h 20m 32s ⏱️ + 11m 50s
1 239 tests +2  1 175 ✔️ +3    64 💤  - 1  0 ±0 
1 635 runs  +2  1 517 ✔️ +3  118 💤  - 1  0 ±0 

Results for commit e029a93. ± Comparison against base commit dad1868.

♻️ This comment has been updated with latest results.

@bentsku bentsku temporarily deployed to localstack-ext-tests September 12, 2022 17:48 Inactive
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Nice! There's already quite some progress on the migration! 🥳
I just added some comments, mostly about things we should implement / fix generally. :)
However, you could also address these things in the next iteration if you would prefer continuing with the current state. :)

@bentsku bentsku temporarily deployed to localstack-ext-tests September 13, 2022 14:17 Inactive
@bentsku bentsku temporarily deployed to localstack-ext-tests September 13, 2022 14:23 Inactive
@bentsku
Copy link
Contributor Author

bentsku commented Sep 13, 2022

67 tests failing on docker-test-arm64 now. Going to rebase on master to see if I need to change some tests.
92 failing on #6827. Minus 25 tests with this PR.

@bentsku bentsku temporarily deployed to localstack-ext-tests September 13, 2022 17:56 Inactive
@bentsku bentsku temporarily deployed to localstack-ext-tests September 13, 2022 18:09 Inactive
@coveralls
Copy link

coveralls commented Sep 13, 2022

Coverage Status

Coverage decreased (-0.3%) to 80.861% when pulling e029a93 on s3-asf-basic-op into dad1868 on master.

@bentsku bentsku temporarily deployed to localstack-ext-tests September 13, 2022 23:11 Inactive
@bentsku
Copy link
Contributor Author

bentsku commented Sep 13, 2022

Tests were green before, rebased #6827 on latest master to see Terraform changes, then rebased here as well. Hopefully we can merge tomorrow!

Copy link
Member

@alexrashed alexrashed 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 addressing the comments! I'm really excited to see the ASF migration of S3 taking shape! 🚀

Concerning the failing Terraform tests: Please just deactivate all tests for the route53resolver for now which are failing. These tests are flaky and just cause issues, we need to make sure that we only have stable tests in the allowlist (tests/terraform/terraform-tests.yaml).
(see #6855).

@bentsku bentsku temporarily deployed to localstack-ext-tests September 14, 2022 12:13 Inactive
@bentsku bentsku merged commit 862bd5b into master Sep 14, 2022
@bentsku bentsku deleted the s3-asf-basic-op branch September 14, 2022 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants