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

Refactor: Events v2: Move existing provider code to v1 folder #10730

Merged
merged 4 commits into from May 8, 2024

Conversation

maxhoheiser
Copy link
Member

@maxhoheiser maxhoheiser commented Apr 26, 2024

Motivation

To improve the readability of events service folder by separating v1 and v2 providers not via file suffixes but dedicated folders.
There are also dependencies in ext that rely on v1 and v2 provider files, these are updated in a companion PR in ext: https://github.com/localstack/localstack-ext/pull/2907

Changes

Move existing (v1) provider and related files to v1 folder.
Remove suffix for v2 provider and related files.

@maxhoheiser maxhoheiser self-assigned this Apr 26, 2024
@maxhoheiser maxhoheiser added aws:events Amazon EventBridge semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases labels Apr 26, 2024
Copy link

github-actions bot commented Apr 26, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 38m 18s ⏱️ - 1m 44s
2 926 tests ±0  2 632 ✅ ±0  294 💤 ±0  0 ❌ ±0 
2 928 runs  ±0  2 632 ✅ ±0  296 💤 ±0  0 ❌ ±0 

Results for commit 0a4374e. ± Comparison against base commit 21b57ab.

♻️ This comment has been updated with latest results.

@maxhoheiser maxhoheiser force-pushed the refactor/events_v2-move-existing-to-v1-folder branch 2 times, most recently from c5b0427 to c5448c9 Compare April 26, 2024 14:23
@maxhoheiser maxhoheiser marked this pull request as ready for review April 26, 2024 14:24
from localstack.services.stores import AccountRegionBundle, BaseStore, LocalAttribute


class EventsStore(BaseStore):
Copy link
Member

Choose a reason for hiding this comment

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

💡 Please check whether persistence still works before merging after moving the model to a new location.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should be done by the persistency test in the companion branch in pro: https://github.com/localstack/localstack-ext/pull/2907
Since all the tests are green including the persistency tests, it should still work after moving.

@maxhoheiser maxhoheiser force-pushed the refactor/events_v2-move-existing-to-v1-folder branch 5 times, most recently from b958125 to 0a4374e Compare May 7, 2024 12:50
@maxhoheiser maxhoheiser force-pushed the refactor/events_v2-move-existing-to-v1-folder branch 2 times, most recently from 6d5b7f4 to 0ed692e Compare May 8, 2024 06:42
Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed the v1 folder should contain only code related to the legacy provider and nothing from the new provider should import from the v1 provider.
The v1 code is allowed to import from the v2 implementation.
This strict separation in one direction allows for potential easy deletion of the v1 provider in the future.

@maxhoheiser maxhoheiser force-pushed the refactor/events_v2-move-existing-to-v1-folder branch from 0ed692e to 0497c5a Compare May 8, 2024 09:31
@maxhoheiser maxhoheiser requested a review from joe4dev May 8, 2024 11:03
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

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

LGTM 👍 This will help a lot phasing out the old provider in the future and keep them separated 🚀

It might be worth checking out what's wrong with the test result publishing given that the artifact download failed repeatedly. Latest failure here: https://github.com/localstack/localstack/actions/runs/8999955477/job/24725298339?pr=10730

from localstack.services.events.packages import event_ruler_package
from localstack.services.events.utils import InvalidEventPatternException
from localstack.services.events.v1.packages import event_ruler_package
from localstack.services.events.v1.utils import InvalidEventPatternException
Copy link
Member

Choose a reason for hiding this comment

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

I suggest avoiding any imports into the legacy v1 package from the main codebase.

Copy link
Member

Choose a reason for hiding this comment

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

fixed as discussed 👍

@maxhoheiser maxhoheiser merged commit 1ab2f1c into master May 8, 2024
28 of 29 checks passed
@maxhoheiser maxhoheiser deleted the refactor/events_v2-move-existing-to-v1-folder branch May 8, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:events Amazon EventBridge semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants