Replies: 1 comment 2 replies
-
Could |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Repro: https://github.com/rafaeltab/multi-service-repro-turbo
Goals
Non-goals
Background
I ran into an issue where when building microservices a change in one microservice, would cause a rebuild in many other microservices, despite the change only needing to impact the microservice it occured in.
This is caused by the fact that I generate a
swagger.json
file based on every API, and then depend on thatswagger.json
file in an SDK package, which is then used by other microservices.In reality, the change in the
service_a_infra
workspace, only really needed to cause theservice_a_api:build
, andservice_a_sdk:generate_sdk
tasks to run (as long as theswagger.json
file does not change). After theservice_a_sdk:generate_sdk
is run, the generated sdk would be the same as a previous run, and theservice_a_sdk:build
task can have the same hash:service_a_sdk:generate_sdk
task is ignoredImportant
When the input of the
service-a-sdk:build
task is changed as result of theservice-a-sdk:generate_sdk
task, theservice-a-sdk:build
task does have to be rerun. This also means that whenservice-a-sdk:build
is run,service-a-sdk:generate_sdk
has to be run first (the hash of theservice-a-sdk:build
is only reliable after theservice-a-sdk:generate_sdk
task is run).This feature is only related to the hash of the task, ordering is not changed
Example using more services, with only a change in one package
service_a_infra
You can see how the one change goes down the list of 5 services, while only one api really needed to be rebuilt, and one sdk regenerated.
Proposal
My suggested solution to this is to add
shallowDependsOn
, a shallow dependency only includes the input files, and environment variables in the hash but not the dependencies of the task. An example configuration for the services described in the background section could look like this:The tasks before this feature would look like this:
I'm not completely sure I managed to explain this well, I tried my best, but feel free to ask questions if it's unclear.
Beta Was this translation helpful? Give feedback.
All reactions