Skip to content

Commit 901d6a2

Browse files
style: fix format issues
1 parent 7b659b7 commit 901d6a2

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

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
@@ -562,12 +562,7 @@ describe('scaleUp with GHES', () => {
562562
const testDataWithMultipleEc2Labels = [
563563
{
564564
...TEST_DATA_SINGLE,
565-
labels: [
566-
'regular-label',
567-
'ghr-ec2-instance-type:r5.2xlarge',
568-
'ghr-ec2-ami:custom-ami',
569-
'ghr-ec2-disk:200',
570-
],
565+
labels: ['regular-label', 'ghr-ec2-instance-type:r5.2xlarge', 'ghr-ec2-ami:custom-ami', 'ghr-ec2-disk:200'],
571566
messageId: 'test-8',
572567
},
573568
];

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

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

308-
const runnerOwner = enableOrgLevel ? payload.repositoryOwner : `${payload.repositoryOwner}/${payload.repositoryName}`;
308+
const runnerOwner = enableOrgLevel
309+
? payload.repositoryOwner
310+
: `${payload.repositoryOwner}/${payload.repositoryName}`;
309311

310312
let key = runnerOwner;
311313
if (dynamicEc2ConfigEnabled && labels?.length) {
@@ -356,24 +358,19 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
356358
let scaleUp = 0;
357359

358360
if (messages.length > 0 && dynamicEc2ConfigEnabled) {
359-
logger.debug('Dynamic EC2 config enabled, processing labels', {labels: messages[0].labels});
361+
logger.debug('Dynamic EC2 config enabled, processing labels', { labels: messages[0].labels });
360362

361-
const dynamicEC2Labels =
362-
messages[0].labels
363-
?.map(l => l.trim())
364-
.filter(l => l.startsWith('ghr-ec2-')) ?? [];
363+
const dynamicEC2Labels = messages[0].labels?.map((l) => l.trim()).filter((l) => l.startsWith('ghr-ec2-')) ?? [];
365364

366365
if (dynamicEC2Labels.length > 0) {
367366
// Append all EC2 labels to runnerLabels
368-
runnerLabels = runnerLabels
369-
? `${runnerLabels},${dynamicEC2Labels.join(',')}`
370-
: dynamicEC2Labels.join(',');
367+
runnerLabels = runnerLabels ? `${runnerLabels},${dynamicEC2Labels.join(',')}` : dynamicEC2Labels.join(',');
371368

372369
logger.debug('Updated runner labels', { runnerLabels });
373370

374371
// Extract instance type from EC2 labels
375372
const requestedInstanceType = dynamicEC2Labels
376-
.find(l => l.startsWith('ghr-ec2-instance-type:'))
373+
.find((l) => l.startsWith('ghr-ec2-instance-type:'))
377374
?.replace('ghr-ec2-instance-type:', '');
378375

379376
if (requestedInstanceType) {
@@ -389,7 +386,6 @@ export async function scaleUp(payloads: ActionRequestMessageSQS[]): Promise<stri
389386
}
390387
}
391388

392-
393389
for (const message of messages) {
394390
const messageLogger = logger.createChild({
395391
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)