View all articles

When should deployments.setPullServices be called in a monorepo setup?

Use deployments.setPullServices after code merges and before calling deployments.create. This tells DX which services each pull request changed before later deployment events are attributed.

This step is required when pull requests in a monorepo can affect multiple services. Without it, a service deployment can pick up unrelated pull requests that merged since the previous deployment.

For best practices on how to structure deployments and use DX APIs effectively, see Setting up DORA metrics in DX.