Skip to content

Commit 571363e

Browse files
authored
Fixes foreach order when --topological isnt set (#6997)
## What's the problem this PR addresses? The traversal order when `--topological` isn't set can be unpredictable. ## How did you fix it? Workspaces are now sorted by their idents. To make them topological, the `--topological` flag must be set. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
1 parent 8452bc2 commit 571363e

File tree

5 files changed

+368
-418
lines changed

5 files changed

+368
-418
lines changed

.yarn/versions/d07cb1af.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
releases:
2+
"@yarnpkg/cli": patch
3+
"@yarnpkg/plugin-workspace-tools": patch
4+
5+
declined:
6+
- "@yarnpkg/plugin-compat"
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-init"
11+
- "@yarnpkg/plugin-interactive-tools"
12+
- "@yarnpkg/plugin-nm"
13+
- "@yarnpkg/plugin-npm-cli"
14+
- "@yarnpkg/plugin-pack"
15+
- "@yarnpkg/plugin-patch"
16+
- "@yarnpkg/plugin-pnp"
17+
- "@yarnpkg/plugin-pnpm"
18+
- "@yarnpkg/plugin-stage"
19+
- "@yarnpkg/plugin-typescript"
20+
- "@yarnpkg/plugin-version"
21+
- "@yarnpkg/builder"
22+
- "@yarnpkg/core"
23+
- "@yarnpkg/doctor"

packages/acceptance-tests/pkg-tests-core/sources/utils/tests.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ const staticServer = serveStatic(npath.fromPortablePath(require(`pkg-tests-fixtu
2929

3030
const TEST_MAJOR = process.env.TEST_MAJOR
3131
? parseInt(process.env.TEST_MAJOR, 10)
32-
: null;
32+
: 4;
3333

34-
function isAtLeastMajor(major: number) {
35-
return TEST_MAJOR !== null && TEST_MAJOR >= major;
34+
function majorCheck(test: (major: number) => boolean) {
35+
return TEST_MAJOR === null || test(TEST_MAJOR);
3636
}
3737

3838
export const FEATURE_CHECKS = {
39-
jsonLockfile: isAtLeastMajor(5),
40-
prologConstraints: !isAtLeastMajor(5),
41-
mergeConflictTheirs: isAtLeastMajor(5),
39+
forEachWorktree: majorCheck(major => major <= 4),
40+
forEachVerboseDone: majorCheck(major => major >= 5),
41+
jsonLockfile: majorCheck(major => major >= 5),
42+
prologConstraints: majorCheck(major => major <= 4),
43+
mergeConflictTheirs: majorCheck(major => major >= 5),
4244
} as const;
4345

4446
// Testing things inside a big-endian container takes forever

0 commit comments

Comments
 (0)