Skip to content

Commit 6ce285e

Browse files
lemusthelroynetlify-bot
andauthoredJun 26, 2024··
feat: pass accountId to resolveConfig (#6733)
* feat: pass accountId to * feat: pass accountId to resolveConfig * fix: revert package-lock change --------- Co-authored-by: Netlify Bot <bot@netlify.com>
1 parent 37d8193 commit 6ce285e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

Diff for: ‎src/commands/base-command.ts

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export default class BaseCommand extends Command {
177177

178178
featureFlags: FeatureFlags = {}
179179
siteId?: string
180+
accountId?: string
180181

181182
/**
182183
* IMPORTANT this function will be called for each command!
@@ -575,6 +576,7 @@ export default class BaseCommand extends Command {
575576
try {
576577
const site = await api.getSite({ siteId: actionCommand.siteId, feature_flags: 'cli' })
577578
actionCommand.featureFlags = site.feature_flags
579+
actionCommand.accountId = site.account_id
578580
} catch {
579581
// if the site is not found, that could mean that the user passed a site name, not an ID
580582
}
@@ -685,6 +687,7 @@ export default class BaseCommand extends Command {
685687

686688
try {
687689
return await resolveConfig({
690+
accountId: this.accountId,
688691
config: config.configFilePath,
689692
packagePath: config.packagePath,
690693
repositoryRoot: config.repositoryRoot,

Diff for: ‎tests/integration/commands/build/build-program.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ vi.mock('@netlify/config', async (importOriginal) => {
2222

2323
const siteInfo = {
2424
account_slug: 'test-account',
25+
account_id: 'account_id',
2526
id: 'site_id',
2627
name: 'site-name',
2728
feature_flags: { test_flag: true },
@@ -72,6 +73,7 @@ describe('command/build', () => {
7273

7374
await createBuildCommand(new BaseCommand('netlify')).parseAsync(['', '', 'build'])
7475
expect(configOptions.featureFlags).toEqual(siteInfo.feature_flags)
76+
expect(configOptions.accountId).toEqual(siteInfo.account_id)
7577

7678
await createBuildCommand(new BaseCommand('netlify')).parseAsync(['', '', 'build', '--offline'])
7779
expect(configOptions.featureFlags, 'should not call API in offline mode').toEqual({})

2 commit comments

Comments
 (2)

github-actions[bot] commented on Jun 26, 2024

@github-actions[bot]

📊 Benchmark results

  • Dependency count: 1,213
  • Package size: 313 MB
  • Number of ts-expect-error directives: 977

github-actions[bot] commented on Jun 26, 2024

@github-actions[bot]

📊 Benchmark results

  • Dependency count: 1,213
  • Package size: 313 MB
  • Number of ts-expect-error directives: 977
Please sign in to comment.