Skip to content

Commit 60c4cc8

Browse files
committed
chore: remove released feature flag for future state v2
1 parent ef92c48 commit 60c4cc8

File tree

1 file changed

+6
-44
lines changed

1 file changed

+6
-44
lines changed

packages/config/src/api/site_info.ts

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -35,53 +35,20 @@ export const getSiteInfo = async function ({
3535
context,
3636
offline = false,
3737
testOpts = {},
38-
featureFlags = {},
3938
siteFeatureFlagPrefix,
4039
}: GetSiteInfoOpts) {
4140
const { env: testEnv = false } = testOpts
4241

43-
const useV2Endpoint = !!accountId && featureFlags.cli_integration_installations_meta
44-
45-
if (useV2Endpoint) {
46-
if (api === undefined || mode === 'buildbot' || testEnv) {
47-
const siteInfo: { id?: string; account_id?: string } = {}
48-
49-
if (siteId !== undefined) siteInfo.id = siteId
50-
if (accountId !== undefined) siteInfo.account_id = accountId
51-
52-
const integrations =
53-
mode === 'buildbot' && !offline
54-
? await getIntegrations({ siteId, testOpts, offline, useV2Endpoint, accountId })
55-
: []
56-
57-
return { siteInfo, accounts: [], addons: [], integrations }
58-
}
59-
60-
const promises = [
61-
getSite(api, siteId, siteFeatureFlagPrefix),
62-
getAccounts(api),
63-
getAddons(api, siteId),
64-
getIntegrations({ siteId, testOpts, offline, useV2Endpoint, accountId }),
65-
]
66-
67-
const [siteInfo, accounts, addons, integrations] = await Promise.all(promises)
68-
69-
if (siteInfo.use_envelope) {
70-
const envelope = await getEnvelope({ api, accountId: siteInfo.account_slug, siteId, context })
71-
72-
siteInfo.build_settings.env = envelope
73-
}
74-
75-
return { siteInfo, accounts, addons, integrations }
76-
}
77-
7842
if (api === undefined || mode === 'buildbot' || testEnv) {
7943
const siteInfo: { id?: string; account_id?: string } = {}
8044

8145
if (siteId !== undefined) siteInfo.id = siteId
8246
if (accountId !== undefined) siteInfo.account_id = accountId
8347

84-
const integrations = mode === 'buildbot' && !offline ? await getIntegrations({ siteId, testOpts, offline }) : []
48+
const integrations =
49+
mode === 'buildbot' && !offline
50+
? await getIntegrations({ siteId, testOpts, offline, accountId })
51+
: []
8552

8653
return { siteInfo, accounts: [], addons: [], integrations }
8754
}
@@ -90,7 +57,7 @@ export const getSiteInfo = async function ({
9057
getSite(api, siteId, siteFeatureFlagPrefix),
9158
getAccounts(api),
9259
getAddons(api, siteId),
93-
getIntegrations({ siteId, testOpts, offline }),
60+
getIntegrations({ siteId, testOpts, offline, accountId }),
9461
]
9562

9663
const [siteInfo, accounts, addons, integrations] = await Promise.all(promises)
@@ -144,15 +111,13 @@ type GetIntegrationsOpts = {
144111
accountId?: string
145112
testOpts: TestOptions
146113
offline: boolean
147-
useV2Endpoint?: boolean
148114
}
149115

150116
const getIntegrations = async function ({
151117
siteId,
152118
accountId,
153119
testOpts,
154120
offline,
155-
useV2Endpoint,
156121
}: GetIntegrationsOpts): Promise<IntegrationResponse[]> {
157122
if (!siteId || offline) {
158123
return []
@@ -162,10 +127,7 @@ const getIntegrations = async function ({
162127

163128
const baseUrl = new URL(host ? `http://${host}` : `https://api.netlifysdk.com`)
164129

165-
// use future state feature flag
166-
const url = useV2Endpoint
167-
? `${baseUrl}team/${accountId}/integrations/installations/meta/${siteId}`
168-
: `${baseUrl}site/${siteId}/integrations/safe`
130+
const url = `${baseUrl}team/${accountId}/integrations/installations/meta/${siteId}`
169131

170132
try {
171133
const response = await fetch(url)

0 commit comments

Comments
 (0)