Skip to content

Commit ad99c7e

Browse files
committed
refactor(ng-dev): remove the .group commands from logging
Remove the group commands from logging as we don't run commands in an environment that properly renders these groupings in a meaningful way
1 parent 701925f commit ad99c7e

File tree

17 files changed

+29
-81
lines changed

17 files changed

+29
-81
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 2 additions & 10 deletions
Large diffs are not rendered by default.

ng-dev/caretaker/check/ci.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class CiModule extends BaseModule<CiData> {
7676
override async printToTerminal() {
7777
const data = await this.data;
7878
const minLabelLength = Math.max(...data.map((result) => result.label.length));
79-
Log.info.group(bold(`CI`));
79+
Log.info(bold(`CI`));
8080
data.forEach((result) => {
8181
if (result.active === false) {
8282
Log.debug(`No active release train for ${result.name}`);
@@ -93,7 +93,6 @@ export class CiModule extends BaseModule<CiData> {
9393
Log.info(`${label} ${red('✘')}`);
9494
}
9595
});
96-
Log.info.groupEnd();
9796
Log.info();
9897
}
9998
}

ng-dev/caretaker/check/g3.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class G3Module extends BaseModule<G3StatsData | void> {
2121
if (!stats) {
2222
return;
2323
}
24-
Log.info.group(bold('g3 branch check'));
24+
Log.info(bold('g3 branch check'));
2525
if (stats.files === 0 && stats.separateFiles === 0) {
2626
Log.info(`${stats.commits} commits between g3 and ${this.git.mainBranchName}`);
2727
Log.info(` ${green('✔')} No sync is needed at this time`);
@@ -39,7 +39,6 @@ export class G3Module extends BaseModule<G3StatsData | void> {
3939
`deletions(-) from ${stats.commits} commits will be included in the next sync`,
4040
);
4141
}
42-
Log.info.groupEnd();
4342
Log.info();
4443
}
4544
}

ng-dev/caretaker/check/github.spec.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ import {GithubQueriesModule} from './github.js';
1616
describe('GithubQueriesModule', () => {
1717
let githubApiSpy: jasmine.Spy;
1818
let infoSpy: jasmine.Spy;
19-
let infoGroupSpy: jasmine.Spy;
2019
let git: AuthenticatedGitClient;
2120

2221
beforeEach(async () => {
2322
githubApiSpy = spyOn(AuthenticatedGithubClient.prototype, 'graphql').and.throwError(
2423
'The graphql query response must always be manually defined in a test.',
2524
);
2625
installVirtualGitClientSpies();
27-
infoGroupSpy = spyOn(Log.info, 'group');
2826
infoSpy = spyOn(Log, 'info');
2927
git = await AuthenticatedGitClient.get();
3028
});
@@ -108,7 +106,7 @@ describe('GithubQueriesModule', () => {
108106

109107
await module.printToTerminal();
110108

111-
expect(infoGroupSpy).toHaveBeenCalledWith('Github Tasks');
109+
expect(infoSpy).toHaveBeenCalledWith('Github Tasks');
112110
expect(infoSpy).toHaveBeenCalledWith('query1 0');
113111
expect(infoSpy).toHaveBeenCalledWith('query2 0');
114112
});
@@ -134,11 +132,9 @@ describe('GithubQueriesModule', () => {
134132

135133
await module.printToTerminal();
136134

137-
expect(infoGroupSpy).toHaveBeenCalledWith('Github Tasks');
135+
expect(infoSpy).toHaveBeenCalledWith('Github Tasks');
138136
expect(infoSpy).toHaveBeenCalledWith('query1 1');
139-
expect(infoGroupSpy).toHaveBeenCalledWith(
140-
'https://github.com/owner/name/issues?q=issue:%20yes',
141-
);
137+
expect(infoSpy).toHaveBeenCalledWith('https://github.com/owner/name/issues?q=issue:%20yes');
142138
expect(infoSpy).toHaveBeenCalledWith('- http://github.com/owner/name/issue/1');
143139
expect(infoSpy).toHaveBeenCalledWith('query2 0');
144140
});

ng-dev/caretaker/check/github.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,19 @@ export class GithubQueriesModule extends BaseModule<GithubQueryResults | void> {
107107
if (!queryResults) {
108108
return;
109109
}
110-
Log.info.group(bold('Github Tasks'));
110+
Log.info(bold('Github Tasks'));
111111
const minQueryNameLength = Math.max(...queryResults.map((result) => result.queryName.length));
112112
for (const queryResult of queryResults) {
113113
Log.info(`${queryResult.queryName.padEnd(minQueryNameLength)} ${queryResult.count}`);
114114

115115
if (queryResult.count > 0) {
116-
Log.info.group(queryResult.queryUrl);
116+
Log.info(queryResult.queryUrl);
117117
queryResult.matchedUrls.forEach((url) => Log.info(`- ${url}`));
118118
if (queryResult.count > MAX_RETURNED_ISSUES) {
119119
Log.info(`... ${queryResult.count - MAX_RETURNED_ISSUES} additional matches`);
120120
}
121-
Log.info.groupEnd();
122121
}
123122
}
124-
Log.info.groupEnd();
125123
Log.info();
126124
}
127125
}

ng-dev/caretaker/check/services.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {services, ServicesModule} from './services.js';
1515
describe('ServicesModule', () => {
1616
let getStatusFromStandardApiSpy: jasmine.Spy;
1717
let infoSpy: jasmine.Spy;
18-
let infoGroupSpy: jasmine.Spy;
1918
let git: AuthenticatedGitClient;
2019

2120
services.splice(0, Infinity, {
@@ -27,7 +26,6 @@ describe('ServicesModule', () => {
2726
beforeEach(async () => {
2827
getStatusFromStandardApiSpy = spyOn(ServicesModule.prototype, 'getStatusFromStandardApi');
2928
installVirtualGitClientSpies();
30-
infoGroupSpy = spyOn(Log.info, 'group');
3129
infoSpy = spyOn(Log, 'info');
3230
git = await AuthenticatedGitClient.get();
3331
});
@@ -67,9 +65,9 @@ describe('ServicesModule', () => {
6765
Object.defineProperty(module, 'data', {value: fakeData});
6866
await module.printToTerminal();
6967

70-
expect(infoGroupSpy).toHaveBeenCalledWith('Service Statuses');
68+
expect(infoSpy).toHaveBeenCalledWith('Service Statuses');
7169
expect(infoSpy).toHaveBeenCalledWith(`Service 1 ${green('✔')}`);
72-
expect(infoGroupSpy).toHaveBeenCalledWith(
70+
expect(infoSpy).toHaveBeenCalledWith(
7371
`Service 2 ${red('✘')} (Updated: ${new Date(0).toLocaleString()})`,
7472
);
7573
expect(infoSpy).toHaveBeenCalledWith(' Details: Literally everything is broken');

ng-dev/caretaker/check/services.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,17 @@ export class ServicesModule extends BaseModule<StatusCheckResult[]> {
6565
override async printToTerminal() {
6666
const statuses = await this.data;
6767
const serviceNameMinLength = Math.max(...statuses.map((service) => service.name.length));
68-
Log.info.group(bold('Service Statuses'));
68+
Log.info(bold('Service Statuses'));
6969
for (const status of statuses) {
7070
const name = status.name.padEnd(serviceNameMinLength);
7171
if (status.status === 'passing') {
7272
Log.info(`${name} ${green('✔')}`);
7373
} else {
74-
Log.info.group(`${name} ${red('✘')} (Updated: ${status.lastUpdated.toLocaleString()})`);
74+
Log.info(`${name} ${red('✘')} (Updated: ${status.lastUpdated.toLocaleString()})`);
7575
Log.info(` Details: ${status.description}`);
7676
Log.info(` Status URL: ${status.statusUrl}`);
77-
Log.info.groupEnd();
7877
}
7978
}
80-
Log.info.groupEnd();
8179
Log.info();
8280
}
8381

ng-dev/caretaker/handoff/update-github-team.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,10 @@ async function setCaretakerGroup(group: string, members: string[]) {
144144
});
145145
};
146146

147-
Log.debug.group(`Caretaker Group: ${fullSlug}`);
147+
Log.debug(`Caretaker Group: ${fullSlug}`);
148148
Log.debug(`Current Membership: ${current.join(', ')}`);
149149
Log.debug(`New Membership: ${members.join(', ')}`);
150150
Log.debug(`Removed: ${removed.join(', ')}`);
151-
Log.debug.groupEnd();
152151

153152
// Add members before removing to prevent the account performing the action from removing their
154153
// permissions to change the group membership early.

ng-dev/commit-message/validate-range/validate-range.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export async function validateCommitRange(from: string, to: string): Promise<voi
6060
} else {
6161
Log.error('✘ Invalid commit message');
6262
errors.forEach(([header, validationErrors]) => {
63-
Log.error.group(header);
63+
Log.error(header);
6464
printValidationErrors(validationErrors);
65-
Log.error.groupEnd();
6665
});
6766
// Exit with a non-zero exit code if invalid commit messages have
6867
// been discovered.

ng-dev/commit-message/validate.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,8 @@ export async function validateCommitMessage(
215215

216216
/** Print the error messages from the commit message validation to the console. */
217217
export function printValidationErrors(errors: string[], print = Log.error) {
218-
print.group(`Error${errors.length === 1 ? '' : 's'}:`);
218+
print(`Error${errors.length === 1 ? '' : 's'}:`);
219219
errors.forEach((line) => print(line));
220-
print.groupEnd();
221220
print();
222221
print('The expected format for a commit is: ');
223222
print('<type>(<scope>): <summary>');

0 commit comments

Comments
 (0)