Skip to content

Commit

Permalink
Revert "APIGW: disable all APIGW features" #127
Browse files Browse the repository at this point in the history
APIGW was disabled temporarily on main branch for scheduling reasons,
but must be enabled for Cloud9.

Reverts commit 6b4f1f0.
  • Loading branch information
justinmk3 authored Oct 20, 2020
1 parent cfc54a4 commit 3dcfbd4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 19 deletions.
5 changes: 0 additions & 5 deletions src/apigateway/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { RestApiNode } from './explorer/apiNodes'
import { invokeRemoteRestApi } from './commands/invokeRemoteRestApi'
import { copyUrlCommand } from './commands/copyUrl'
import { ExtContext } from '../shared/extensions'
import * as featureToggle from '../shared/featureToggle'

/**
* Activate API Gateway functionality for the extension.
Expand All @@ -17,10 +16,6 @@ export async function activate(activateArguments: {
extContext: ExtContext
outputChannel: vscode.OutputChannel
}): Promise<void> {
if (featureToggle.disableApigw) {
return
}

const extensionContext = activateArguments.extContext.extensionContext
const regionProvider = activateArguments.extContext.regionProvider
extensionContext.subscriptions.push(
Expand Down
5 changes: 1 addition & 4 deletions src/awsexplorer/regionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { AWSTreeNodeBase } from '../shared/treeview/nodes/awsTreeNodeBase'
import { StepFunctionsNode } from '../stepFunctions/explorer/stepFunctionsNodes'
import { DEFAULT_PARTITION } from '../shared/regions/regionUtilities'
import { SsmDocumentNode } from '../ssmDocument/explorer/ssmDocumentNode'
import * as featureToggle from '../shared/featureToggle'

/**
* An AWS Explorer node representing a region.
Expand Down Expand Up @@ -49,9 +48,7 @@ export class RegionNode extends AWSTreeNodeBase {
// This interface exists so we can add additional nodes to the array (otherwise Typescript types the array to what's already in the array at creation)
const partitionId = regionProvider.getPartitionId(this.regionCode) ?? DEFAULT_PARTITION
const serviceCandidates = [
...(featureToggle.disableApigw
? []
: [{ serviceId: 'apigateway', createFn: () => new ApiGatewayNode(partitionId, this.regionCode) }]),
{ serviceId: 'apigateway', createFn: () => new ApiGatewayNode(partitionId, this.regionCode) },
{ serviceId: 'cloudformation', createFn: () => new CloudFormationNode(this.regionCode) },
{ serviceId: 'lambda', createFn: () => new LambdaNode(this.regionCode) },
...(isCloud9() ? [] : [{ serviceId: 'logs', createFn: () => new CloudWatchLogsNode(this.regionCode) }]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { SamTemplateCodeLensProvider } from '../../../shared/codelens/samTemplat
import { LaunchConfiguration } from '../../../shared/debug/launchConfiguration'
import { API_TARGET_TYPE, TEMPLATE_TARGET_TYPE } from '../../../shared/sam/debugger/awsSamDebugConfiguration'
import * as workspaceUtils from '../../../shared/utilities/workspaceUtils'
import * as featureToggle from '../../../shared/featureToggle'

describe('SamTemplateCodeLensProvider', async () => {
let codeLensProvider: SamTemplateCodeLensProvider = new SamTemplateCodeLensProvider()
Expand All @@ -29,9 +28,6 @@ describe('SamTemplateCodeLensProvider', async () => {
})

it('provides a CodeLens for a file with a new resource', async () => {
if (featureToggle.disableApigw) {
return
}
const codeLenses = await codeLensProvider.provideCodeLenses(
document,
instance(mockCancellationToken),
Expand Down
4 changes: 0 additions & 4 deletions src/shared/cloudformation/templateSymbolResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { safeLoad } from 'js-yaml'
import * as vscode from 'vscode'
import { CloudFormation } from './cloudformation'
import { waitUntil } from '../utilities/timeoutUtils'
import * as featureToggle from '../featureToggle'

/**
* SAM template Lambda resource or API Gateway resource.
Expand Down Expand Up @@ -47,9 +46,6 @@ export class TemplateSymbolResolver {
if (kind === 'function') {
return funSymbols.map(r => ({ name: r.name, range: r.range, kind: kind }))
}
if (featureToggle.disableApigw) {
return []
}
// Api symbols:
//
// For each Function symbol, find its Api descendants, keeping
Expand Down
2 changes: 0 additions & 2 deletions src/shared/featureToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { SettingsConfiguration, DefaultSettingsConfiguration } from './settingsC
*/
export enum ActiveFeatureKeys {}

export const disableApigw = true

/**
* This class handles feature access for unreleased or gated features.
* Example: adding a feature called `NewFeature1`:
Expand Down

0 comments on commit 3dcfbd4

Please sign in to comment.