Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
"cSpell.words": ["fhir", "Formik", "pino", "serialisation"],
"editor.defaultFormatter": "dbaeumer.vscode-eslint"

}
},
"eslint.useFlatConfig": true,
"eslint.format.enable": true
}
},
"postCreateCommand": "rm -f ~/.docker/config.json; git config --global --add safe.directory /workspaces/eps-prescription-tracker-ui; make install; direnv allow ."
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/fix_cdk_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if [ -z "${GITHUB_ACTIONS_RUNNER_IPV6}" ]; then
fi

CFN_DRIFT_DETECTION_GROUP="cpt-ui"
if [[ "$SERVICE_NAME" =~ -pr-[0-9]+$ ]]; then
if [[ "$IS_PULL_REQUEST" = "true" ]]; then
CFN_DRIFT_DETECTION_GROUP="cpt-ui-pull-request"
fi

Expand All @@ -176,6 +176,7 @@ fix_string_key COMMIT_ID "${COMMIT_ID}"
fix_string_key logRetentionInDays "${LOG_RETENTION_IN_DAYS}"
fix_string_key logLevel "${LOG_LEVEL}"
fix_string_key cfnDriftDetectionGroup "${CFN_DRIFT_DETECTION_GROUP}"
fix_boolean_number_key isPullRequest "${IS_PULL_REQUEST}"

if [ "$CDK_APP_NAME" == "StatefulResourcesApp" ]; then
fix_string_key primaryOidcClientId "${PRIMARY_OIDC_CLIENT_ID}"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ jobs:
CREATE_INT_RELEASE_NOTES: true
CREATE_PROD_RELEASE_NOTES: true
MARK_JIRA_RELEASED: false
CREATE_INT_RC_RELEASE_NOTES: false
CREATE_INT_RC_RELEASE_NOTES: false
IS_PULL_REQUEST: false
secrets: inherit

release_qa:
Expand Down Expand Up @@ -168,4 +169,5 @@ jobs:
ROUTE53_EXPORT_NAME: EPS
REACT_LOG_LEVEL: "debug"
LOG_RETENTION_IN_DAYS: 30
IS_PULL_REQUEST: false
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ jobs:
ROUTE53_EXPORT_NAME: EPS
REACT_LOG_LEVEL: "debug"
LOG_RETENTION_IN_DAYS: 30
IS_PULL_REQUEST: true
secrets: inherit
report_deployed_url:
needs: [release_code, get_issue_number]
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ jobs:
CREATE_INT_RELEASE_NOTES: true
CREATE_PROD_RELEASE_NOTES: true
MARK_JIRA_RELEASED: false
CREATE_INT_RC_RELEASE_NOTES: false
CREATE_INT_RC_RELEASE_NOTES: false
IS_PULL_REQUEST: false
secrets: inherit

release_ref:
Expand Down Expand Up @@ -187,6 +188,7 @@ jobs:
ROUTE53_EXPORT_NAME: EPS
REACT_LOG_LEVEL: "debug"
LOG_RETENTION_IN_DAYS: 30
IS_PULL_REQUEST: false
secrets: inherit

release_qa:
Expand Down Expand Up @@ -223,6 +225,7 @@ jobs:
ROUTE53_EXPORT_NAME: EPS
REACT_LOG_LEVEL: "debug"
LOG_RETENTION_IN_DAYS: 30
IS_PULL_REQUEST: false
secrets: inherit
release_int:
needs: [tag_release, package_code, get_commit_id, release_qa]
Expand Down Expand Up @@ -257,7 +260,8 @@ jobs:
CREATE_INT_RELEASE_NOTES: true
CREATE_PROD_RELEASE_NOTES: true
MARK_JIRA_RELEASED: false
CREATE_INT_RC_RELEASE_NOTES: true
CREATE_INT_RC_RELEASE_NOTES: true
IS_PULL_REQUEST: false
secrets: inherit
release_prod:
needs: [tag_release, package_code, get_commit_id, release_int]
Expand Down Expand Up @@ -292,5 +296,6 @@ jobs:
CREATE_INT_RELEASE_NOTES: true
CREATE_PROD_RELEASE_NOTES: true
MARK_JIRA_RELEASED: false
CREATE_INT_RC_RELEASE_NOTES: false
CREATE_INT_RC_RELEASE_NOTES: false
IS_PULL_REQUEST: false
secrets: inherit
10 changes: 8 additions & 2 deletions .github/workflows/release_all_stacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ on:
CREATE_INT_RC_RELEASE_NOTES:
type: boolean
default: false
IS_PULL_REQUEST:
type: boolean
required: true
jobs:
release_all_code:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -241,6 +244,7 @@ jobs:
ROUTE53_EXPORT_NAME: ${{ inputs.ROUTE53_EXPORT_NAME }}
WAF_ALLOW_GA_RUNNER_CONNECTIVITY: ${{ inputs.WAF_ALLOW_GA_RUNNER_CONNECTIVITY }}
CLOUDFRONT_ORIGIN_CUSTOM_HEADER: ${{secrets.CLOUDFRONT_ORIGIN_CUSTOM_HEADER }}
IS_PULL_REQUEST: ${{inputs.IS_PULL_REQUEST}}

- name: Show diff for stateful stack
run: |
Expand Down Expand Up @@ -375,6 +379,7 @@ jobs:
ROUTE53_EXPORT_NAME: ${{ inputs.ROUTE53_EXPORT_NAME }}
WAF_ALLOW_GA_RUNNER_CONNECTIVITY: ${{ inputs.WAF_ALLOW_GA_RUNNER_CONNECTIVITY }}
CLOUDFRONT_ORIGIN_CUSTOM_HEADER: ${{secrets.CLOUDFRONT_ORIGIN_CUSTOM_HEADER }}
IS_PULL_REQUEST: ${{inputs.IS_PULL_REQUEST}}

- name: Show diff for stateless stack
run: |
Expand Down Expand Up @@ -501,6 +506,7 @@ jobs:
ROUTE53_EXPORT_NAME: ${{ inputs.ROUTE53_EXPORT_NAME }}
WAF_ALLOW_GA_RUNNER_CONNECTIVITY: ${{ inputs.WAF_ALLOW_GA_RUNNER_CONNECTIVITY }}
CLOUDFRONT_ORIGIN_CUSTOM_HEADER: ${{secrets.CLOUDFRONT_ORIGIN_CUSTOM_HEADER }}
IS_PULL_REQUEST: ${{inputs.IS_PULL_REQUEST}}

- name: Show diff for stateful stack redeployment
if: ${{ steps.check_redeploy_stateful_stack.outputs.REDEPLOY_STATEFUL_STACK == 'true' }}
Expand Down Expand Up @@ -573,14 +579,14 @@ jobs:
contents: write
steps:
- name: Checkout gh-pages
if: ${{ !startsWith(inputs.SERVICE_NAME, 'cpt-ui-pr-') }}
if: ${{ inputs.IS_PULL_REQUEST == false }}
uses: actions/checkout@v5
with:
ref: gh-pages
path: gh-pages

- name: update release tag in github pages
if: ${{ !startsWith(inputs.SERVICE_NAME, 'cpt-ui-pr-') }}
if: ${{ inputs.IS_PULL_REQUEST == false }}
run: |
cd gh-pages
NOW=$(date +'%Y-%m-%dT%H:%M:%S')
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ cdk-synth-stateful-resources-no-mock:
SPLUNK_DELIVERY_STREAM=foo \
SPLUNK_SUBSCRIPTION_FILTER_ROLE=foo \
DO_NOT_GET_AWS_EXPORT=true \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
./.github/scripts/fix_cdk_json.sh .local_config/stateful_app.config.json
CONFIG_FILE_NAME=.local_config/stateful_app.config.json npx cdk synth \
Expand Down Expand Up @@ -264,6 +265,7 @@ cdk-synth-stateless-resources-no-mock:
CLOUDFRONT_CERT_ARN=arn:aws:acm:us-east-1:444455556666:certificate/certificate_ID \
DO_NOT_GET_AWS_EXPORT=true \
CLOUDFRONT_ORIGIN_CUSTOM_HEADER=foo \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
./.github/scripts/fix_cdk_json.sh .local_config/stateless_app.config.json
CONFIG_FILE_NAME=.local_config/stateless_app.config.json npx cdk synth \
Expand Down Expand Up @@ -309,6 +311,7 @@ cdk-synth-stateful-resources-mock:
SPLUNK_DELIVERY_STREAM=foo \
SPLUNK_SUBSCRIPTION_FILTER_ROLE=foo \
DO_NOT_GET_AWS_EXPORT=true \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
./.github/scripts/fix_cdk_json.sh .local_config/stateful_app.config.json
CONFIG_FILE_NAME=.local_config/stateful_app.config.json npx cdk synth \
Expand Down Expand Up @@ -363,6 +366,7 @@ cdk-synth-stateless-resources-mock:
GITHUB_ACTIONS_RUNNER_IPV6='["::1"]' \
DO_NOT_GET_AWS_EXPORT=true \
CLOUDFRONT_ORIGIN_CUSTOM_HEADER=foo \
IS_PULL_REQUEST=false \
USE_ZONE_APEX=false \
./.github/scripts/fix_cdk_json.sh .local_config/stateless_app.config.json
CONFIG_FILE_NAME=.local_config/stateless_app.config.json npx cdk synth \
Expand Down
112 changes: 57 additions & 55 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import globals from "globals";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import eslintJsPlugin from "@eslint/js";
import importNewlines from "eslint-plugin-import-newlines";
import typescriptParser from "@typescript-eslint/parser";
import globals from "globals"
import tsPlugin from "@typescript-eslint/eslint-plugin"
import eslintJsPlugin from "@eslint/js"
import importNewlines from "eslint-plugin-import-newlines"
import typescriptParser from "@typescript-eslint/parser"
import react from "eslint-plugin-react"

const commonConfig = {
Expand All @@ -17,16 +17,16 @@ const commonConfig = {
"@typescript-eslint/array-type": [
"error",
{
default: "generic",
},
default: "generic"
}
],

"@typescript-eslint/consistent-type-assertions": [
"error",
{
assertionStyle: "as",
objectLiteralTypeAssertions: "never",
},
objectLiteralTypeAssertions: "never"
}
],

"block-spacing": "error",
Expand All @@ -37,8 +37,8 @@ const commonConfig = {
"error",
{
before: false,
after: true,
},
after: true
}
],

"dot-location": ["error", "property"],
Expand All @@ -50,37 +50,39 @@ const commonConfig = {
"error",
"declaration",
{
allowArrowFunctions: true,
},
allowArrowFunctions: true
}
],

"import-newlines/enforce": [
"error",
{
items: 3,
"max-len": 120,
semi: false,
},
semi: false
}
],

// TEMPORARY: Disabled due to ESLint indent rule stack overflow bug with Layout.tsx
// Issue tracked across ESLint 8.x and 9.x versions - re-enable when fixed upstream
// "indent": [
// "error",
// 2,
// {
// SwitchCase: 1,
// },
// ],
//see: https://github.com/eslint-stylistic/eslint-stylistic/issues/915
// Re-enabled for now, issue is still present but can be avoided by using explicit react <Fragment> elements
"indent": [
"error",
2,
{
SwitchCase: 1
}
],

"max-len": ["error", 120],
"no-multi-spaces": "error",

"no-multiple-empty-lines": [
"error",
{
max: 1,
},
max: 1
}
],

"no-trailing-spaces": "error",
Expand All @@ -91,13 +93,13 @@ const commonConfig = {
"double",
{
allowTemplateLiterals: true,
avoidEscape: true,
},
avoidEscape: true
}
],

semi: ["error", "never"],
},
};
semi: ["error", "never"]
}
}

export default [
{
Expand All @@ -109,31 +111,31 @@ export default [
"**/node_modules/**",
"**/.next/**",
"**/.tsconfig.tsbuildinfo/**"
],
]
},
{
rules: eslintJsPlugin.configs.recommended.rules,
rules: eslintJsPlugin.configs.recommended.rules
},
{
files: ["**/*.ts"],

languageOptions: {
parser: typescriptParser,
globals: {
...globals.node,
},
...globals.node
}
},
...commonConfig,
...commonConfig
},
{
files: ["**/*.js",],
files: ["**/*.js"],

languageOptions: {
globals: {
...globals.node,
},
...globals.node
}
},
...commonConfig,
...commonConfig
},
{
files: [ "**/*.{jsx,mjs,cjs,ts,tsx}" ],
Expand All @@ -144,14 +146,14 @@ export default [
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
jsx: true
}
},
globals: {
...globals.browser
}
},
...commonConfig,
...commonConfig
},
{
files: [ "**/__tests__/*.{jsx,mjs,cjs,ts,tsx}" ],
Expand All @@ -162,15 +164,15 @@ export default [
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
jsx: true
}
},
globals: {
...globals.browser,
...globals.jest
},
}
},
...commonConfig,
...commonConfig
},
{
files: ["**/tests/**/*.ts"],
Expand All @@ -179,9 +181,9 @@ export default [
parser: typescriptParser,
globals: {
...globals.jest,
...globals.node,
},
...globals.node
}
},
...commonConfig,
},
];
...commonConfig
}
]
Loading
Loading