Skip to content

Commit 6647031

Browse files
committed
Merge branch 'main-enterprise' into upgrade
2 parents 262af6f + 061bf84 commit 6647031

File tree

103 files changed

+18674
-17701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+18674
-17701
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/javascript-node/.devcontainer/base.Dockerfile
22
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
3-
ARG VARIANT=16-bullseye
4-
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
3+
ARG VARIANT=20-bookworm
4+
FROM mcr.microsoft.com/devcontainers/javascript-node:1-${VARIANT}
55

66
# [Optional] Uncomment this section to install additional OS packages.
77
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
8-
&& apt-get -y install --no-install-recommends python pip
8+
&& apt-get -y install --no-install-recommends python3 python3-pip
99

1010
# [Optional] Uncomment if you want to install an additional version of node using nvm
1111
# ARG EXTRA_NODE_VERSION=10
@@ -17,6 +17,14 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1717
# Update npm
1818
RUN npm install -g npm
1919
# Intall aws cli
20-
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install
20+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
21+
unzip awscliv2.zip && \
22+
sudo ./aws/install && \
23+
rm -rf ./aws && \
24+
rm awscliv2.zip
2125
# Install sam cli
22-
RUN pip install aws-sam-cli
26+
RUN curl -L "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-$(dpkg --print-architecture).zip" -o "aws-sam-cli.zip" && \
27+
unzip aws-sam-cli.zip -d sam-installation && \
28+
sudo ./sam-installation/install && \
29+
rm -rf ./sam-installation && \
30+
rm aws-sam-cli.zip

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
88
// Append -bullseye or -buster to pin to an OS version.
99
// Use -bullseye variants on local arm64/Apple Silicon.
10-
"args": { "VARIANT": "16-bullseye" }
10+
"args": { "VARIANT": "20-bookworm" }
1111
},
1212

1313
"settings": {},
@@ -34,4 +34,4 @@
3434

3535
"remoteUser": "node",
3636

37-
}
37+
}

.eslintrc.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88
"standard"
99
],
1010
"parserOptions": {
11-
"ecmaVersion": 12
11+
"ecmaVersion": 13
1212
},
1313
"rules": {
1414
},
15-
"ignorePatterns": ["test/**/*.js"]
15+
"overrides": [
16+
{
17+
"files": ["test/**/*.js"],
18+
"env": {
19+
"jest": true
20+
}
21+
}
22+
]
1623
}

.github/actions/codeql-analysis/action.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/create-pre-release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,34 @@ env:
3131
REGISTRY: ghcr.io
3232
IMAGE_NAME: ${{ github.repository }}
3333

34+
permissions:
35+
contents: write
36+
packages: write
37+
3438
jobs:
3539
build:
3640
if: ${{ github.actor != 'dependabot'}}
3741
runs-on: ubuntu-latest
3842
outputs:
3943
release: ${{ steps.prerelease.outputs.release }}
4044
steps:
41-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
4246
- name: Setup node
43-
uses: actions/setup-node@v3
47+
uses: actions/setup-node@v4
4448
with:
4549
node-version: 16.x
4650
cache: 'npm'
4751
- run: npm install
4852
- name: Set up Docker Buildx
49-
uses: docker/setup-buildx-action@v2
53+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
5054
- name: Log in to the Container registry
51-
uses: docker/login-action@v2
55+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
5256
with:
5357
registry: ${{ env.REGISTRY }}
5458
username: ${{ github.actor }}
5559
password: ${{ secrets.GITHUB_TOKEN }}
5660
- name: Build Docker Image Locally
57-
uses: docker/build-push-action@master
61+
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
5862
with:
5963
context: .
6064
file: ./Dockerfile
@@ -73,15 +77,15 @@ jobs:
7377
- run: echo "${{ github.ref }}"
7478
- name: Tag a final release
7579
id: prerelease
76-
uses: actionsdesk/semver@0.6.0-rc.10
80+
uses: actionsdesk/semver@82aa4310e4e21c59cd0020007a4278e733e81dcb
7781
with:
7882
bump: ${{ inputs.bump }}
7983
prerelease: ${{ inputs.prerelease }}
8084
prelabel: ${{ inputs.prelabel }}
8185
commitish: ${{ github.ref }}
8286
- name: Push Docker Image
8387
if: ${{ success() }}
84-
uses: docker/build-push-action@master
88+
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
8589
with:
8690
context: .
8791
file: ./Dockerfile

.github/workflows/create-release.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
11
name: Create a release
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch:
44
# push:
55
# branches:
66
# - main-enterprise
77

8-
9-
108
env:
119
REGISTRY: ghcr.io
1210
IMAGE_NAME: ${{ github.repository }}
1311

12+
permissions:
13+
contents: write
14+
packages: write
15+
1416
jobs:
1517
build:
1618
if: ${{ github.actor != 'dependabot'}}
1719
runs-on: ubuntu-latest
1820
outputs:
1921
release: ${{ steps.finalrelease.outputs.release }}
2022
steps:
21-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2224
- name: Setup node
23-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2426
with:
2527
node-version: 16.x
26-
cache: 'npm'
28+
cache: "npm"
2729
- run: npm install
2830
- name: Set up Docker Buildx
29-
uses: docker/setup-buildx-action@v2
31+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
3032
- name: Log in to the Container registry
31-
uses: docker/login-action@v2
33+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
3234
with:
3335
registry: ${{ env.REGISTRY }}
3436
username: ${{ github.actor }}
3537
password: ${{ secrets.GITHUB_TOKEN }}
3638
- name: Build Docker Image Locally
37-
uses: docker/build-push-action@master
39+
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
3840
with:
3941
context: .
4042
file: ./Dockerfile
4143
load: true
42-
tags: |
44+
tags: |
4345
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main-enterprise
4446
- name: Inspect the Docker Image
4547
run: |
@@ -50,14 +52,14 @@ jobs:
5052
docker run --env APP_ID=${{ secrets.APP_ID }} --env PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} --env WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }} -d -p 3000:3000 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main-enterprise
5153
sleep 10
5254
curl http://localhost:3000
53-
- name: Tag a final release
55+
- name: Tag a final release
5456
id: finalrelease
55-
uses: actionsdesk/semver@0.6.0-rc.10
57+
uses: actionsdesk/semver@82aa4310e4e21c59cd0020007a4278e733e81dcb
5658
with:
5759
bump: final
5860
- name: Push Docker Image
5961
if: ${{ success() }}
60-
uses: docker/build-push-action@master
62+
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
6163
with:
6264
context: .
6365
file: ./Dockerfile
@@ -68,6 +70,28 @@ jobs:
6870
provenance: false
6971
sbom: false
7072

73+
helm:
74+
runs-on: ubuntu-latest
75+
needs: build
76+
steps:
77+
- name: Clone repo
78+
uses: actions/checkout@v4
79+
80+
- name: Prepare
81+
run: |
82+
# OCI standard enforces lower-case paths
83+
GHCR_REPO=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
84+
HELM_REPO=$(echo "oci://ghcr.io/${{ github.repository_owner }}/helm-charts" | tr '[:upper:]' '[:lower:]')
85+
echo "GHCR_REPO=$GHCR_REPO" >> $GITHUB_ENV
86+
echo "HELM_REPO=$HELM_REPO" >> $GITHUB_ENV
87+
88+
- name: Publish Helm charts
89+
run: |
90+
cd helm
91+
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
92+
helm package --app-version ${{ needs.build.outputs.release }} --version ${{ needs.build.outputs.release }} safe-settings
93+
helm push safe-settings-${{ needs.build.outputs.release }}.tgz ${{ env.HELM_REPO }}
94+
7195
#trigger-deployment:
7296
# needs: build
7397
# runs-on: ubuntu-latest
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Delete old releases
2+
permissions: write-all
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
beforeDate:
8+
type: string
9+
required: true
10+
description: YYYY-MM-DD - All releases before this date are deleted.
11+
default: "2024-01-01"
12+
13+
jobs:
14+
delete-releases:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Delete releases
18+
run: |
19+
for i in $(gh release list --repo https://github.com/$GITHUB_REPOSITORY --json createdAt,tagName --limit 1000 | jq --arg date $BEFORE_DATE '.[] | select(.createdAt < $date ) | .tagName' | tr -d '"'); do gh release delete $i -y --cleanup-tag --repo https://github.com/$GITHUB_REPOSITORY ; done
20+
echo Deleted releases before $BEFORE_DATE in https://github.com/$GITHUB_REPOSITORY >> $GITHUB_STEP_SUMMARY
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
BEFORE_DATE: ${{ inputs.beforeDate }}
24+
25+

.github/workflows/deploy-k8s.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,36 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@v3
32-
- uses: azure/login@v1
31+
uses: actions/checkout@v4
32+
- uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5
3333
with:
3434
client-id: ${{ secrets.AZURE_CLIENT_ID }}
3535
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3636
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37-
- uses: azure/aks-set-context@v3
37+
- uses: azure/aks-set-context@c7eb093e5a5d47caa333f64974d5fd1cd4bf069d
3838
with:
3939
resource-group: ${{env.AZURE_RESOURCE_GROUP}}
4040
cluster-name: ${{env.AZURE_AKS_CLUSTER}}
4141
id: login
4242
- run: |
4343
kubectl get deployment
4444
- name: app-env
45-
uses: azure/k8s-create-secret@v4
45+
uses: azure/k8s-create-secret@6e0ba8047235646753f2a3a3b359b4d0006ff218
4646
with:
4747
namespace: 'default'
4848
secret-type: 'generic'
4949
arguments: --from-literal=APP_ID=${{ secrets.APP_ID }} --from-literal=PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} --from-literal=WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}
5050
secret-name: app-env
5151
- name: Set imagePullSecret
52-
uses: azure/k8s-create-secret@v4
52+
uses: azure/k8s-create-secret@6e0ba8047235646753f2a3a3b359b4d0006ff218
5353
with:
5454
namespace: ${{env.AZURE_AKS_NAMESPACE}}
5555
container-registry-url: ${{env.IMAGE_REGISTRY_URL}}
5656
container-registry-username: ${{ secrets.DOCKER_USERNAME }}
5757
container-registry-password: ${{ secrets.DOCKER_PASSWORD }}
5858
secret-name: 'image-pull-secret'
5959
id: create-secret
60-
- uses: Azure/k8s-deploy@v4.10
60+
- uses: Azure/k8s-deploy@v5
6161
with:
6262
namespace: ${{env.AZURE_AKS_NAMESPACE}}
6363
manifests: |

.github/workflows/node-ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@ name: Node.js CI
22
on:
33
pull_request:
44

5+
permissions:
6+
contents: read
7+
58
concurrency:
69
group: ${{ github.workflow }}-${{ github.ref }}
710
cancel-in-progress: true
811

912
jobs:
10-
build:
13+
test:
14+
if: ${{ github.actor != 'dependabot'}}
1115
runs-on: ubuntu-latest
1216
steps:
13-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1418
- name: Setup node
15-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
1620
with:
17-
node-version: 16.x
18-
cache: "npm"
21+
node-version: ${{ matrix.node-version }}
22+
cache: npm
1923
- run: npm install
20-
- run: npm run test:unit
24+
- run: npm run test:unit:ci
25+
strategy:
26+
matrix:
27+
node-version:
28+
- 18
29+
- 20

0 commit comments

Comments
 (0)