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
add opt. service deps, opt-in services to test selection #10458
Conversation
5d90342
to
ec15a18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice, that looks really neat now, thank you so much for updating it. Can I still push SNS to the list of opt-in, even though it's ready for review?
Also, thanks for updating the PR description, it's really clear 👍
Of course, please feel free to add your opt-ins, I'll merge this PR early next week with all the added opt-ins. :) |
This is not exactly related to this PR, but to the previous which added the test selection. I think we have a recursion problem when expending the list, I've tried to add SNS and related services, and we can't resolve the list anymore. If we imagine we have the following (real) optional dependencies: API_DEPENDENCIES_OPTIONAL = {
"firehose": ["opensearch", "es", "s3"],
"lambda": ["logs", "cloudwatch"],
"ses": ["sns"],
"sns": ["sqs", "lambda", "firehose", "ses", "logs"],
"sqs": ["cloudwatch"],
"logs": ["lambda", "kinesis", "firehose"]
} We will forever be trying to resolve the To solve this, I believe we might not need to actually do a recursive call, because we would trigger more tests that would not be needed. Let's take the same list as above. Let's say I'm doing a change in Maybe I am missing something, but do you think this is necessary? Should we just reverse-resolve the I have a commit ready I could push that fixes this issue, if you'd like. I could also open a different PR, as the scope is creeping a little 😅 |
I agree with @bentsku. We should for now avoid testing the full transitive relation here and just consider the first level of dependencies. Doing this fully recursively with all the potential service integrations is going to kinda defeat the whole purpose here. I'd also suggest we separate the opt-in gathering and the introduction of the optional dependencies into a separate PR, but I'm also not opposed to just bundle it here if that's ok with @alexrashed. |
Please just go ahead and push it directly in this PR, @bentsku :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for jumping onto fixing issues with the dependencies and test selection @alexrashed and @bentsku 🙏 🚀
localstack/utils/bootstrap.py
Outdated
|
||
# Optional dependencies of services on other services | ||
# - maps from API names to list of other API names that they _optionally_ depend on: <service>:<dependent-services> | ||
# - an optional service dependency is a service without which a service's basic functionality breaks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# - an optional service dependency is a service without which a service's basic functionality breaks, | |
# - an optional service dependency is a service without which a service's basic functionality doesn't break, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think the sentence is good, because it states without the service will break, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I thought the point is that the basic functionality of a service does not break if the service it optionally depends on is disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are totally right 😄
localstack/utils/bootstrap.py
Outdated
# - only add optional dependencies of services here, use API_DEPENDENCIES for mandatory dependencies | ||
API_DEPENDENCIES_OPTIONAL = { | ||
"firehose": ["opensearch", "es", "s3"], | ||
"lambda": ["cloudwatch", "dynamodbstreams", "logs", "kafka", "kinesis", "msk"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not super urgent here, but should we maybe try add a reasoning for the specific dependencies as well? E.g. separating these on different lines for event source mappings vs. internal service dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I also thought of it. It's kinda related to "upstream" vs "downstream". With event source mapping, it's a bit tricky... not many services are like this I believe?
Most of the current dependencies on these list are "targets" or external dependency like "global" services for telemetry / observability / events (events
, logs
, cloudwatch
) I believe. Except for event source mapping 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I'd treat these dependencies just like we do for testing. If it's configured via the Lambda API, it's a dependency of Lambda, no matter if it's a "source" or a "sink"/"destination".
Motivation
Now that we have the selective test execution for opt-in services introduced in #10301, we can onboard additional services to the test selection.
In this PR I added the services I own to the list (😻), but it might make sense to collect the first iteration of opt ins here and merge them together.
So please feel free to push to this PR if you want the tests of your service being selectively executed in PRs here.
In order to to so, just:
localstack/utils/bootstrap.py
are correct.API_DEPENDENCIES
firehose
depends onkinesis
to work:API_DEPENDENCIES_OPTIONAL
firehose
that would be at leastopensearch
andelasticsearch
, because these are potential targets forfirehose
streams.OPT_IN
. The list is alphabetically sorted, I expect it to grow quite fast (and then become obsolete).Changes
TODO
API_DEPENDENCIES
is used for strict service loading, where it is used as a mandatory service definition.lambda
cannot work withouts3
andsts
firehose
can work withoutopensearch
for as long as you don't use it as a target. However, it cannot work withoutkinesis
at all.