angular-cn/dev-infra
Paul Gschwendtner a8978ebf8e build: ts-circular-deps tool should normalize golden (#36505)
Currently the golden output of the circular-deps tool is purely
based on the order of source files passed to the tool, and on the
amount of imports inside source files.

This is actually resulting in deterministic output as running
the tool multiple times without any changes to source files,
results in the same output.

Though it seems like the tool is too strict and we can avoid
unnecessary golden changes if:

1. A source file that is part of a cycle is imported earlier (in terms
of how the analyzer visits them). This could result in the cycle path
starting with a different source file.

2. Source files which are not part of a cycle are imported earlier
(in terms of how the analyzer visits them). This could result in moved
items in the golden if re-approved (even though the cycles remain the same)

To fix this, we normalize the cycle path array that serves as
serializable data structure for the text-based goldens. Since
the paths represents a cycle, the path can be shifted in a
deterministic way so that cycles don't change unnecessarily
in the golden, and to simplify comparison of cycles.

Additionally, we sort the cycles in a deterministic way so
that the golden doesn't change unnecessarily (as explained above).

PR Close #36505
2020-04-08 12:12:58 -07:00
..
commit-message fix(dev-infra): use commit message validation from @angular/dev-infra-private (#36172) 2020-04-06 09:28:52 -07:00
pullapprove fix(dev-infra): correct pullapprove global approval regex (#36384) 2020-04-03 11:11:30 -07:00
ts-circular-dependencies build: ts-circular-deps tool should normalize golden (#36505) 2020-04-08 12:12:58 -07:00
utils feat(dev-infra): create commit-message validation script/tooling (#36117) 2020-03-20 10:20:12 -07:00
BUILD.bazel feat(dev-infra): standard CLI commands using yargs (#36326) 2020-04-01 15:24:28 -07:00
cli.ts feat(dev-infra): standard CLI commands using yargs (#36326) 2020-04-01 15:24:28 -07:00
ng-dev ci: use dev-infra cli from local sources (#36326) 2020-04-01 15:24:29 -07:00
tmpl-package.json build: remove rollup packaging from dev-infra (#35647) 2020-03-17 12:27:07 -07:00