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

fix(core): ensure project order in graph is deterministic #19968

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export async function normalizeProjectNodes(
nxJson: NxJsonConfiguration
) {
const toAdd = [];
const projects = Object.keys(ctx.projects);
// Sorting projects by name to make sure that the order of projects in the graph is deterministic.
// This is important to ensure that expanded properties referencing projects (e.g. implicit dependencies)
// are also deterministic, and thus don't cause the calculated project configuration hash to shift.
const projects = Object.keys(ctx.projects).sort();

// Used for expanding implicit dependencies (e.g. `@proj/*` or `tag:foo`)
const partialProjectGraphNodes = projects.reduce((graph, project) => {
Expand Down