Skip to content

Commit e93e296

Browse files
style: fix format issues
1 parent 0c026d7 commit e93e296

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

lambdas/functions/control-plane/src/scale-runners/scale-up.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -735,12 +735,7 @@ describe('scaleUp with GHES', () => {
735735
const testDataWithMultipleEc2Labels = [
736736
{
737737
...TEST_DATA_SINGLE,
738-
labels: [
739-
'regular-label',
740-
'ghr-ec2-instance-type:r5.2xlarge',
741-
'ghr-ec2-ami:custom-ami',
742-
'ghr-ec2-disk:200',
743-
],
738+
labels: ['regular-label', 'ghr-ec2-instance-type:r5.2xlarge', 'ghr-ec2-ami:custom-ami', 'ghr-ec2-disk:200'],
744739
messageId: 'test-8',
745740
},
746741
];

lambdas/functions/control-plane/src/scale-runners/scale-up.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
365365
continue;
366366
}
367367

368-
const runnerOwner = enableOrgLevel ? payload.repositoryOwner : `${payload.repositoryOwner}/${payload.repositoryName}`;
368+
const runnerOwner = enableOrgLevel
369+
? payload.repositoryOwner
370+
: `${payload.repositoryOwner}/${payload.repositoryName}`;
369371

370372
let key = runnerOwner;
371373
if (dynamicEc2ConfigEnabled && labels?.length) {
@@ -417,24 +419,19 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
417419
const queuedMessages: ActionRequestMessageSQS[] = [];
418420

419421
if (messages.length > 0 && dynamicEc2ConfigEnabled) {
420-
logger.debug('Dynamic EC2 config enabled, processing labels', {labels: messages[0].labels});
422+
logger.debug('Dynamic EC2 config enabled, processing labels', { labels: messages[0].labels });
421423

422-
const dynamicEC2Labels =
423-
messages[0].labels
424-
?.map(l => l.trim())
425-
.filter(l => l.startsWith('ghr-ec2-')) ?? [];
424+
const dynamicEC2Labels = messages[0].labels?.map((l) => l.trim()).filter((l) => l.startsWith('ghr-ec2-')) ?? [];
426425

427426
if (dynamicEC2Labels.length > 0) {
428427
// Append all EC2 labels to runnerLabels
429-
runnerLabels = runnerLabels
430-
? `${runnerLabels},${dynamicEC2Labels.join(',')}`
431-
: dynamicEC2Labels.join(',');
428+
runnerLabels = runnerLabels ? `${runnerLabels},${dynamicEC2Labels.join(',')}` : dynamicEC2Labels.join(',');
432429

433430
logger.debug('Updated runner labels', { runnerLabels });
434431

435432
// Extract instance type from EC2 labels
436433
const requestedInstanceType = dynamicEC2Labels
437-
.find(l => l.startsWith('ghr-ec2-instance-type:'))
434+
.find((l) => l.startsWith('ghr-ec2-instance-type:'))
438435
?.replace('ghr-ec2-instance-type:', '');
439436

440437
if (requestedInstanceType) {
@@ -450,7 +447,6 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
450447
}
451448
}
452449

453-
454450
for (const message of messages) {
455451
const messageLogger = logger.createChild({
456452
persistentKeys: {

lambdas/functions/webhook/src/runners/dispatch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('Dispatcher', () => {
103103
installationId: 0,
104104
queueId: runnerConfig[0].id,
105105
repoOwnerType: 'Organization',
106-
labels: ['self-hosted', 'Test']
106+
labels: ['self-hosted', 'Test'],
107107
});
108108
});
109109

0 commit comments

Comments
 (0)