Skip to content

Commit 94be493

Browse files
authored
Merge branch 'main' into dependabot/github_actions/aws-actions/configure-aws-credentials-5
2 parents c15c5e2 + 02531be commit 94be493

32 files changed

+195
-631
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"python.testing.pytestEnabled": true,
5555
"python.testing.pytestArgs": [
5656
"packages/slackBotFunction",
57-
"packages/createIndexFunction"
5857
],
5958
"python.linting.pylintEnabled": false,
6059
"python.linting.flake8Enabled": true,

.gitallowed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ token: props\.slackBotToken
2929
secretValue: JSON\.stringify\(\{token: props\.slackBotToken\}\)
3030
token = slack_event_data\["bot_token"\]
3131
client = WebClient\(token=token\)
32+
client = WebClient\(token=slack_event_data\["bot_token"\]\)
33+
context accountId=123456789012

.github/scripts/fix_cdk_json.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ fix_boolean_number_key() {
3535
mv .build/cdk.new.json .build/cdk.json
3636
}
3737

38+
CFN_DRIFT_DETECTION_GROUP="epsam"
39+
if [[ "$STACK_NAME" =~ -pr-[0-9]+$ ]]; then
40+
CFN_DRIFT_DETECTION_GROUP="epsam-pull-request"
41+
fi
42+
3843
# go through all the key values we need to set
3944
fix_string_key accountId "${ACCOUNT_ID}"
4045
fix_string_key stackName "${STACK_NAME}"
@@ -44,3 +49,4 @@ fix_string_key logRetentionInDays "${LOG_RETENTION_IN_DAYS}"
4449
fix_string_key logLevel "${LOG_LEVEL}"
4550
fix_string_key slackBotToken "${SLACK_BOT_TOKEN}"
4651
fix_string_key slackSigningSecret "${SLACK_SIGNING_SECRET}"
52+
fix_string_key cfnDriftDetectionGroup "${CFN_DRIFT_DETECTION_GROUP}"

.github/workflows/cdk_package_code.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
- name: Build Python Lambda Functions
6363
run: |
6464
pip3 install -r packages/slackBotFunction/requirements.txt -t packages/slackBotFunction
65-
pip3 install -r packages/createIndexFunction/requirements.txt -t packages/createIndexFunction
6665
pip3 install -r packages/syncKnowledgeBaseFunction/requirements.txt -t packages/syncKnowledgeBaseFunction
6766
6867
- name: 'Tar files'

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ repos:
4848
types_or: [sh, shell]
4949
pass_filenames: false
5050

51+
- id: lint-cdk
52+
name: Lint cdk
53+
entry: npm
54+
args: ["run", "--prefix=packages/cdk", "lint"]
55+
language: system
56+
files: ^packages\/cdk
57+
types_or: [ts, tsx, javascript, jsx, json]
58+
pass_filenames: false
59+
5160
- repo: local
5261
hooks:
5362
- id: git-secrets

.vscode/eps-assist-me.code-workspace

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
"name": "packages/cdk",
99
"path": "../packages/cdk"
1010
},
11-
{
12-
"name": "packages/createIndexFunction",
13-
"path": "../packages/createIndexFunction"
14-
},
1511
{
1612
"name": "packages/slackBotFunction",
1713
"path": "../packages/slackBotFunction"

Makefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ install: install-python install-hooks install-node
1010

1111
install-python:
1212
poetry install
13-
cd packages/createIndexFunction && pip install -r requirements.txt && pip install -r requirements-test.txt
1413
cd packages/slackBotFunction && pip install -r requirements.txt && pip install -r requirements-test.txt
1514
cd packages/syncKnowledgeBaseFunction && pip install -r requirements.txt && pip install -r requirements-test.txt
1615

@@ -30,7 +29,10 @@ git-secrets-docker-setup:
3029
export LOCAL_WORKSPACE_FOLDER=$(pwd)
3130
docker build -f https://raw.githubusercontent.com/NHSDigital/eps-workflow-quality-checks/refs/tags/v4.0.4/dockerfiles/nhsd-git-secrets.dockerfile -t git-secrets .
3231

33-
lint: lint-githubactions lint-githubaction-scripts lint-black lint-flake8
32+
lint: lint-githubactions lint-githubaction-scripts lint-black lint-flake8 lint-node
33+
34+
lint-node:
35+
npm run lint --workspace packages/cdk
3436

3537
lint-githubactions:
3638
actionlint
@@ -46,15 +48,12 @@ lint-flake8:
4648
poetry run flake8 .
4749

4850
test:
49-
cd packages/createIndexFunction && PYTHONPATH=. COVERAGE_FILE=coverage/.coverage python -m pytest
5051
cd packages/slackBotFunction && PYTHONPATH=. COVERAGE_FILE=coverage/.coverage python -m pytest
5152
cd packages/syncKnowledgeBaseFunction && PYTHONPATH=. COVERAGE_FILE=coverage/.coverage python -m pytest
5253

5354
clean:
5455
rm -rf packages/cdk/coverage
5556
rm -rf packages/cdk/lib
56-
rm -rf packages/createIndexFunction/coverage
57-
rm -rf packages/createIndexFunction/.coverage
5857
rm -rf packages/slackBotFunction/coverage
5958
rm -rf packages/slackBotFunction/.coverage
6059
rm -rf packages/syncKnowledgeBaseFunction/coverage
@@ -99,19 +98,18 @@ cdk-deploy: guard-STACK_NAME
9998
--context logRetentionInDays=$$LOG_RETENTION_IN_DAYS \
10099
--context slackBotToken=$$SLACK_BOT_TOKEN \
101100
--context slackSigningSecret=$$SLACK_SIGNING_SECRET
102-
103101
cdk-synth:
104102
npx cdk synth \
105103
--quiet \
106104
--app "npx ts-node --prefer-ts-exts packages/cdk/bin/EpsAssistMeApp.ts" \
107-
--context accountId=undefined \
105+
--context accountId=123456789012 \
108106
--context stackName=epsam \
109107
--context versionNumber=undefined \
110108
--context commitId=undefined \
111109
--context logRetentionInDays=30 \
112110
--context slackBotToken=dummy \
113-
--context slackSigningSecret=dummy
114-
./scripts/fix_cfn_guard.sh
111+
--context slackSigningSecret=dummy \
112+
--context cfnDriftDetectionGroup=dummy
115113

116114
cdk-diff:
117115
npx cdk diff \

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ packages/
2828
│ │ └── RestApiGateway/ # API Gateway specific constructs
2929
│ ├── resources/ # AWS resource definitions
3030
│ └── stacks/ # CDK stack definitions
31-
├── createIndexFunction/ # Lambda function for OpenSearch index management
32-
│ ├── app/ # Application code
33-
│ │ ├── config/ # Configuration and environment variables
34-
│ │ └── handler.py # Lambda handler
35-
│ └── tests/ # Unit tests
3631
├── slackBotFunction/ # Lambda function for Slack bot integration
3732
│ ├── app/ # Application code
3833
│ │ ├── config/ # Configuration and environment variables

package-lock.json

Lines changed: 47 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cdk/bin/EpsAssistMeApp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const accountId = app.node.tryGetContext("accountId")
1717
const stackName = app.node.tryGetContext("stackName")
1818
const version = app.node.tryGetContext("versionNumber")
1919
const commit = app.node.tryGetContext("commitId")
20+
const cfnDriftDetectionGroup = app.node.tryGetContext("cfnDriftDetectionGroup")
2021

2122
Aspects.of(app).add(new AwsSolutionsChecks({verbose: true}))
2223

@@ -25,6 +26,7 @@ Tags.of(app).add("accountId", accountId)
2526
Tags.of(app).add("stackName", stackName)
2627
Tags.of(app).add("version", version)
2728
Tags.of(app).add("commit", commit)
29+
Tags.of(app).add("cfnDriftDetectionGroup", cfnDriftDetectionGroup)
2830

2931
const EpsAssistMe = new EpsAssistMeStack(app, "EpsAssistMeStack", {
3032
env: {

0 commit comments

Comments
 (0)