Skip to content

Commit

Permalink
Merge pull request #12 from dvsa/revert-9-feature/CB2-10573
Browse files Browse the repository at this point in the history
Revert "feat(CB2-10573): Implement AWS AppConfig Feature Flagging"
  • Loading branch information
me-matt authored Mar 15, 2024
2 parents 7f74ec0 + a002c57 commit 9555ee3
Show file tree
Hide file tree
Showing 15 changed files with 7,288 additions and 16,111 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build_hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
jobs:
Build:
uses: dvsa/cvs-github-actions/.github/workflows/build-node-hash.yaml@develop
with:
mono_repo: true
secrets:
CVS_MGMT_AWS_ROLE: ${{ secrets.CVS_MGMT_AWS_ROLE }}
DVSA_AWS_REGION: ${{ secrets.DVSA_AWS_REGION }}
5 changes: 0 additions & 5 deletions .snyk

This file was deleted.

23,141 changes: 7,264 additions & 15,877 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
}
],
"license": "MIT",
"dependencies": {
"@aws-sdk/client-ssm": "^3.478.0"
},
"devDependencies": {
"@aws-lambda-powertools/parameters": "^1.18.1",
"@aws-sdk/client-appconfigdata": "^3.515.0",
"@aws-sdk/client-ssm": "^3.478.0",
"@dvsa/eslint-config-ts": "^3.0.0",
"@smithy/util-stream": "^2.1.3",
"@types/aws-lambda": "^8.10.114",
"@types/jest": "^28.1.8",
"@types/node": "^16.18.23",
Expand All @@ -40,8 +39,6 @@
"@typescript-eslint/parser": "^5.57.1",
"archiver": "^5.3.1",
"aws-sam-webpack-plugin": "^0.13.0",
"aws-sdk-client-mock": "^3.0.1",
"aws-sdk-client-mock-jest": "^3.0.1",
"copy-webpack-plugin": "^11.0.0",
"current-git-branch": "^1.1.0",
"dotenv": "^16.0.3",
Expand All @@ -64,8 +61,5 @@
},
"engines": {
"node": "^18.15.0"
},
"dependencies": {
"@dvsa/cvs-microservice-common": "^0.9.2"
}
}
43 changes: 0 additions & 43 deletions src/feature-flags/get.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/feature-flags/util/clients.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { GetParameterCommand, SSMClient } from '@aws-sdk/client-ssm';
import type { APIGatewayProxyResult } from 'aws-lambda';
import 'dotenv/config';
import logger from '../util/logger';
import { headers } from '../util/headers';

export const headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token',
'Access-Control-Allow-Methods': 'GET,OPTIONS',
};

export const handler = async (): Promise<APIGatewayProxyResult> => {
try {
Expand Down
5 changes: 0 additions & 5 deletions src/util/headers.ts

This file was deleted.

19 changes: 3 additions & 16 deletions template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'

Resources:
MinAppVersionLambdaFunction:
GetLambdaFunction:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: src/minimum-application-version/
CodeUri: src/handler/
Handler: get.handler
Runtime: nodejs18.x
Events:
Expand All @@ -15,23 +15,10 @@ Resources:
Path: /minimum-version
Method: get

FeatureFlagsLambdaFunction:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: src/feature-flags/
Handler: get.handler
Runtime: nodejs18.x
Events:
GetLambdaApi:
Type: Api
Properties:
Path: /feature-flags/{client}
Method: get

Outputs:
GetLambdaApi:
Description: "API Gateway endpoint URL for GetLambdaFunction on dev stage"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Dev/"
MinAppVersionLambdaFunction:
GetLambdaFunction:
Description: "Get Lambda Function ARN"
Value: !GetAtt GetLambdaFunction.Arn
62 changes: 0 additions & 62 deletions tests/feature-flags/get.test.ts

This file was deleted.

58 changes: 0 additions & 58 deletions tests/feature-flags/util/clients.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jest.mock('@aws-sdk/client-ssm', () => ({
GetParameterCommand: mockGetParameterCommand,
}));

import { handler } from '../../src/minimum-application-version/get';
import { headers } from '../../src/util/headers';
import { handler, headers } from '../../src/handler/get';

describe('get endpoint', () => {
it('should return for non-local endpoint with mocked functions', async () => {
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"compilerOptions": {
"target": "es2019",
"module": "Node16",
"module": "commonjs",
"allowJs": true,
"checkJs": true,
"sourceMap": true,
"esModuleInterop": true,
"strict": true,
"moduleResolution": "Node16"
"strict": true
},
"include": ["src/**/*.ts", "tests/**/*.ts"]
}
6 changes: 3 additions & 3 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ module.exports = {
// the size of your deployment package. If you want to always include it then comment out this line. It has
// been included conditionally because the node10.x docker image used by SAM local doesn't include it.
// externals: process.env.NODE_ENV === 'development' ? [] : ['aws-sdk'],
externals: [
/aws-sdk/,
],
externals: {
fsevents: 'require(\'fsevents\')',
},

// Add the TypeScript loader
module: {
Expand Down
12 changes: 6 additions & 6 deletions webpack/webpack.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('./webpack.common.js');
const archiver = require('archiver');
const branchName = require('current-git-branch');

const LAMBDA_NAMES = ['FeatureFlagsLambdaFunction', 'MinAppVersionLambdaFunction'];
const LAMBDA_NAME = 'GetLambdaFunction';
const OUTPUT_FOLDER = './'
const REPO_NAME = 'cvs-svc-minimum-application-version';
const BRANCH_NAME = branchName().replace(/\//g, "-");
Expand Down Expand Up @@ -62,13 +62,13 @@ module.exports = env => {
mode: 'production',
plugins: [
new BundlePlugin({
archives: LAMBDA_NAMES.map(ln => {
return {
inputPath: `.aws-sam/build/${ln}`,
archives: [
{
inputPath: `.aws-sam/build/${LAMBDA_NAME}`,
outputPath: `${OUTPUT_FOLDER}`,
outputName: `${COMMIT_HASH}-${ln}`
outputName: `${COMMIT_HASH}`,
}
})
],
}),
],
});
Expand Down

0 comments on commit 9555ee3

Please sign in to comment.