Skip to content

Commit

Permalink
fix(core): ensure project order in graph is deterministic (#19968)
Browse files Browse the repository at this point in the history
(cherry picked from commit c83afeb)
  • Loading branch information
AgentEnder authored and FrozenPandaz committed Nov 1, 2023
1 parent 0e9993f commit 83531de
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 83531de

Please # to comment.