8000 Merge pull request #4686 from microsoft/octogonz/publish-rush-5.122.0 · nirshar/rushstack@e7e7f5e · GitHub
[go: up one dir, main page]

Skip to content

Commit e7e7f5e

Browse files
authored
Merge pull request microsoft#4686 from microsoft/octogonz/publish-rush-5.122.0
[rush] Fix publishing pipeline to publish Rush 5.122.0
2 parents 4bb48c3 + ca6eaea commit e7e7f5e

File tree

6 files changed

+39
-24
lines changed

6 files changed

+39
-24
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Improve the error message when the pnpm-sync version is outdated",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

common/config/azure-pipelines/templates/build.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ parameters:
22
- name: BuildParameters
33
type: string
44
default: ''
5-
- name: PerformValidation
6-
type: boolean
7-
default: true
85

96
steps:
107
- script: 'git config --local user.email rushbot@users.noreply.github.com'
@@ -27,13 +24,3 @@ steps:
2724

2825
- script: 'node common/scripts/install-run-rush.js retest --verbose --production ${{ parameters.BuildParameters }}'
2926
displayName: 'Rush retest (install-run-rush)'
30-
31-
- ${{ if eq(parameters.PerformValidation, true) }}:
32-
- script: 'node apps/rush/lib/start-dev.js install'
33-
displayName: 'Rush install (rush-lib)'
34-
35-
- script: 'node apps/rush/lib/start-dev.js test --verbose --production --timeline ${{ parameters.BuildParameters }}'
36-
displayName: 'Rush test (rush-lib)'
37-
38-
- script: 'node repo-scripts/repo-toolbox/lib/start.js readme --verify'
39-
displayName: 'Ensure repo README is up-to-date'

common/config/azure-pipelines/vscode-extension-publish.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ extends:
3232
parameters:
3333
BuildParameters: >
3434
--to rushstack
35-
PerformValidation: false
3635
3736
- script: node $(Build.SourcesDirectory)/common/scripts/install-run-rushx.js package
3837
workingDirectory: $(Build.SourcesDirectory)/vscode-extensions/rush-vscode-extension

libraries/rush-lib/src/logic/operations/OperationExecutionManager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ConsoleTerminalProvider
1010
} from '@rushstack/terminal';
1111
import { StreamCollator, type CollatedTerminal, type CollatedWriter } from '@rushstack/stream-collator';
12-
import { NewlineKind, Async, InternalError } from '@rushstack/node-core-library';
12+
import { NewlineKind, Async, InternalError, AlreadyReportedError } from '@rushstack/node-core-library';
1313

1414
import {
1515
AsyncOperationQueue,
@@ -313,7 +313,13 @@ export class OperationExecutionManager {
313313
case OperationStatus.Failure: {
314314
// Failed operations get reported, even if silent.
315315
// Generally speaking, silent operations shouldn't be able to fail, so this is a safety measure.
316-
const message: string | undefined = record.error?.message;
316+
let message: string | undefined = undefined;
317+
if (record.error) {
318+
if (!(record.error instanceof AlreadyReportedError)) {
319+
message = record.error.message;
320+
}
321+
}
322+
317323
// This creates the writer, so don't do this globally
318324
const { terminal } = record.collatedWriter;
319325
if (message) {

libraries/rush-lib/src/logic/operations/PnpmSyncCopyOperationPlugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ export class PnpmSyncCopyOperationPlugin implements IPhasedCommandPlugin {
3030
} = record;
3131

3232
//skip if the phase is skipped or no operation
33-
if (status === OperationStatus.Skipped || status === OperationStatus.NoOp) {
33+
if (
34+
status === OperationStatus.Skipped ||
35+
status === OperationStatus.NoOp ||
36+
status === OperationStatus.Failure
37+
) {
3438
return;
3539
}
3640

libraries/rush-lib/src/utilities/PnpmSyncUtilities.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,30 @@ export class PnpmSyncUtilities {
4646
case LogMessageIdentifier.PREPARE_REPLACING_FILE:
4747
{
4848
const customMessage: string =
49-
`excepted .pnpm-sync.json version: ${details.expectedVersion}; ` +
50-
`actual .pnpm-sync.json version: ${details.actualVersion}; `;
49+
`Expecting .pnpm-sync.json version ${details.expectedVersion}, ` +
50+
`but found version ${details.actualVersion}`;
5151

5252
terminal.writeVerboseLine(PnpmSyncUtilities._addLinePrefix(message));
5353
terminal.writeVerboseLine(PnpmSyncUtilities._addLinePrefix(customMessage));
5454
}
5555
return;
5656

57-
// don't return this error case, pass to default handler
5857
case LogMessageIdentifier.COPY_ERROR_INCOMPATIBLE_SYNC_FILE: {
59-
const customMessage: string =
60-
`excepted .pnpm-sync.json version: ${details.expectedVersion}; ` +
61-
`actual .pnpm-sync.json version: ${details.actualVersion}; `;
58+
terminal.writeErrorLine(
59+
PnpmSyncUtilities._addLinePrefix(
60+
`The workspace was installed using an incompatible version of pnpm-sync.\n` +
61+
`Please run "rush install" or "rush update" again.`
62+
)
63+
);
6264

63-
terminal.writeErrorLine(PnpmSyncUtilities._addLinePrefix(customMessage));
65+
terminal.writeLine(
66+
PnpmSyncUtilities._addLinePrefix(
67+
`Expecting .pnpm-sync.json version ${details.expectedVersion}, ` +
68+
`but found version ${details.actualVersion}\n` +
69+
`Affected folder: ${details.pnpmSyncJsonPath}`
70+
)
71+
);
72+
throw new AlreadyReportedError();
6473
}
6574
}
6675

0 commit comments

Comments
 (0)
0