Skip to content

Commit 3cfd6ed

Browse files
Copilotdmichon-msft
andcommitted
fix: scope PR to OperationExecutionRecord only; revert FileError changes; add @microsoft/rush patch change file
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/1bcedf3e-f266-4978-ad80-c7ccb325056a
1 parent 2de5738 commit 3cfd6ed

4 files changed

Lines changed: 28 additions & 18 deletions

File tree

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": "Fix ProblemCollector wiring in OperationExecutionRecord: add preventAutoclose, strip ANSI colors before matching, and always include problemCollector in the terminal pipeline",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

libraries/node-core-library/src/FileError.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const uuidFileError: string = '37a4c772-2dc8-4c66-89ae-262f8cc1f0c1';
5050
const baseFolderEnvVar: string = 'RUSHSTACK_FILE_ERROR_BASE_FOLDER';
5151

5252
const unixProblemMatcherPattern: IProblemPattern = {
53-
regexp: '^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^:]+):(\\d+)(?::(\\d+))?\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$',
53+
regexp: '^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^:]+):(\\d+):(\\d+)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$',
5454
severity: 1,
5555
file: 2,
5656
line: 3,
@@ -61,7 +61,7 @@ const unixProblemMatcherPattern: IProblemPattern = {
6161

6262
const vsProblemMatcherPattern: IProblemPattern = {
6363
regexp:
64-
'^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^\\(]+)\\((\\d+)(?:,(\\d+))?\\)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$',
64+
'^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^\\(]+)\\((\\d+),(\\d+)\\)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$',
6565
severity: 1,
6666
file: 2,
6767
line: 3,
@@ -145,7 +145,7 @@ export class FileError extends Error {
145145
baseFolder: this._evaluateBaseFolder(),
146146
pathToFormat: this.absolutePath,
147147
message: this.message,
148-
line: this.line ?? 1,
148+
line: this.line,
149149
column: this.column
150150
});
151151
}

libraries/node-core-library/src/test/FileError.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe(FileError.name, () => {
2929
absolutePath: `/path/to/project/path/to/file`,
3030
projectFolder: '/path/to/project'
3131
});
32-
expect(error1.toString()).toMatchInlineSnapshot(`"path/to/file:1 - message"`);
32+
expect(error1.toString()).toMatchInlineSnapshot(`"path/to/file - message"`);
3333
});
3434

3535
it('correctly performs Unix-style relative file path formatting', () => {
@@ -59,15 +59,15 @@ describe(FileError.name, () => {
5959
column: 12
6060
});
6161
expect(error3.getFormattedErrorMessage({ format: 'Unix' })).toMatchInlineSnapshot(
62-
`"path/to/file:1:12 - message"`
62+
`"path/to/file - message"`
6363
);
6464

6565
const error4: FileError = new FileError('message', {
6666
absolutePath: '/path/to/project/path/to/file',
6767
projectFolder: '/path/to/project'
6868
});
6969
expect(error4.getFormattedErrorMessage({ format: 'Unix' })).toMatchInlineSnapshot(
70-
`"path/to/file:1 - message"`
70+
`"path/to/file - message"`
7171
);
7272
});
7373

@@ -106,8 +106,8 @@ describe(FileError.name, () => {
106106
// Because the file path is resolved on disk, the output will vary based on platform.
107107
// Only check that it ends as expected and is an absolute path.
108108
const error3Message: string = error3.getFormattedErrorMessage({ format: 'Unix' });
109-
expect(error3Message).toMatch(/.+:1:12 - message$/);
110-
const error3Path: string = error3Message.slice(0, error3Message.length - ':1:12 - message'.length);
109+
expect(error3Message).toMatch(/.+ - message$/);
110+
const error3Path: string = error3Message.slice(0, error3Message.length - ' - message'.length);
111111
expect(path.isAbsolute(error3Path)).toEqual(true);
112112

113113
const error4: FileError = new FileError('message', {
@@ -117,8 +117,8 @@ describe(FileError.name, () => {
117117
// Because the file path is resolved on disk, the output will vary based on platform.
118118
// Only check that it ends as expected and is an absolute path.
119119
const error4Message: string = error4.getFormattedErrorMessage({ format: 'Unix' });
120-
expect(error4Message).toMatch(/.+:1 - message$/);
121-
const error4Path: string = error4Message.slice(0, error4Message.length - ':1 - message'.length);
120+
expect(error4Message).toMatch(/.+ - message$/);
121+
const error4Path: string = error4Message.slice(0, error4Message.length - ' - message'.length);
122122
expect(path.isAbsolute(error4Path)).toEqual(true);
123123
});
124124

@@ -149,15 +149,15 @@ describe(FileError.name, () => {
149149
column: 12
150150
});
151151
expect(error3.getFormattedErrorMessage({ format: 'VisualStudio' })).toMatchInlineSnapshot(
152-
`"path/to/file(1,12) - message"`
152+
`"path/to/file - message"`
153153
);
154154

155155
const error4: FileError = new FileError('message', {
156156
absolutePath: '/path/to/project/path/to/file',
157157
projectFolder: '/path/to/project'
158158
});
159159
expect(error4.getFormattedErrorMessage({ format: 'VisualStudio' })).toMatchInlineSnapshot(
160-
`"path/to/file(1) - message"`
160+
`"path/to/file - message"`
161161
);
162162
});
163163

@@ -196,8 +196,8 @@ describe(FileError.name, () => {
196196
// Because the file path is resolved on disk, the output will vary based on platform.
197197
// Only check that it ends as expected and is an absolute path.
198198
const error3Message: string = error3.getFormattedErrorMessage({ format: 'VisualStudio' });
199-
expect(error3Message).toMatch(/.+\(1,12\) - message$/);
200-
const error3Path: string = error3Message.slice(0, error3Message.length - '(1,12) - message'.length);
199+
expect(error3Message).toMatch(/.+ - message$/);
200+
const error3Path: string = error3Message.slice(0, error3Message.length - ' - message'.length);
201201
expect(path.isAbsolute(error3Path)).toEqual(true);
202202

203203
const error4: FileError = new FileError('message', {
@@ -207,8 +207,8 @@ describe(FileError.name, () => {
207207
// Because the file path is resolved on disk, the output will vary based on platform.
208208
// Only check that it ends as expected and is an absolute path.
209209
const error4Message: string = error4.getFormattedErrorMessage({ format: 'VisualStudio' });
210-
expect(error4Message).toMatch(/.+\(1\) - message$/);
211-
const error4Path: string = error4Message.slice(0, error4Message.length - '(1) - message'.length);
210+
expect(error4Message).toMatch(/.+ - message$/);
211+
const error4Path: string = error4Message.slice(0, error4Message.length - ' - message'.length);
212212
expect(path.isAbsolute(error4Path)).toEqual(true);
213213
});
214214
});

vscode-extensions/rush-vscode-extension/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
],
229229
"applyTo": "allDocuments",
230230
"pattern": {
231-
"regexp": "^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^:]+):(\\d+)(?::(\\d+))?\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$",
231+
"regexp": "^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^:]+):(\\d+):(\\d+)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$",
232232
"severity": 1,
233233
"file": 2,
234234
"line": 3,
@@ -247,7 +247,7 @@
247247
],
248248
"applyTo": "allDocuments",
249249
"pattern": {
250-
"regexp": "^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^\\(]+)\\((\\d+)(?:,(\\d+))?\\)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$",
250+
"regexp": "^\\[[^\\]]+\\]\\s+(Error|Warning):\\s+([^\\(]+)\\((\\d+),(\\d+)\\)\\s+-\\s+(?:\\(([^)]+)\\)\\s+)?(.*)$",
251251
"severity": 1,
252252
"file": 2,
253253
"line": 3,

0 commit comments

Comments
 (0)