Skip to content

Commit 1269dc6

Browse files
style: fix format issues
1 parent 392c33c commit 1269dc6

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
@@ -367,7 +367,9 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
367367
continue;
368368
}
369369

370-
const runnerOwner = enableOrgLevel ? payload.repositoryOwner : `${payload.repositoryOwner}/${payload.repositoryName}`;
370+
const runnerOwner = enableOrgLevel
371+
? payload.repositoryOwner
372+
: `${payload.repositoryOwner}/${payload.repositoryName}`;
371373

372374
let key = runnerOwner;
373375
if (dynamicEc2ConfigEnabled && labels?.length) {
@@ -419,24 +421,19 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
419421
const queuedMessages: ActionRequestMessageSQS[] = [];
420422

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

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

429428
if (dynamicEC2Labels.length > 0) {
430429
// Append all EC2 labels to runnerLabels
431-
runnerLabels = runnerLabels
432-
? `${runnerLabels},${dynamicEC2Labels.join(',')}`
433-
: dynamicEC2Labels.join(',');
430+
runnerLabels = runnerLabels ? `${runnerLabels},${dynamicEC2Labels.join(',')}` : dynamicEC2Labels.join(',');
434431

435432
logger.debug('Updated runner labels', { runnerLabels });
436433

437434
// Extract instance type from EC2 labels
438435
const requestedInstanceType = dynamicEC2Labels
439-
.find(l => l.startsWith('ghr-ec2-instance-type:'))
436+
.find((l) => l.startsWith('ghr-ec2-instance-type:'))
440437
?.replace('ghr-ec2-instance-type:', '');
441438

442439
if (requestedInstanceType) {
@@ -452,7 +449,6 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
452449
}
453450
}
454451

455-
456452
for (const message of messages) {
457453
const messageLogger = logger.createChild({
458454
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)