Skip to content

Commit 49e852d

Browse files
authored
Merge branch 'main' into fix-tokencreated-dialog
2 parents d1d91e4 + 4b418dc commit 49e852d

257 files changed

Lines changed: 8994 additions & 3323 deletions

File tree

Some content is hidden

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

.github/scripts/initial-setup.sh

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ INIT_CONFIG_PASSWORD_HASH=$2
88
INIT_CONFIG_ACCESS_TOKEN_HASH=$3
99
INIT_CONFIG_ACCESS_TOKEN=$4
1010
INIT_CONFIG_PASSWORD=$5
11-
FLOWFUSE_URL="${6:-$PR_NUMBER.flowfuse.dev}"
11+
FF_NODES_TOKEN=$6
12+
FLOWFUSE_URL="${7:-$PR_NUMBER.flowfuse.dev}"
1213

1314

1415
create_user() {
@@ -166,6 +167,14 @@ kubectl run flowfuse-setup-2 \
166167
"INSERT INTO public.\"AccessTokens\" (token,\"expiresAt\",scope,\"ownerId\",\"ownerType\",\"refreshToken\",name,\"createdAt\",\"updatedAt\") \
167168
VALUES ('$INIT_CONFIG_ACCESS_TOKEN_HASH',NULL,'','1','user',NULL,'setup','2024-03-18 10:46:54.055+01','2024-03-18 10:46:54.055+01');"
168169

170+
### Configure ff-npm-registry token
171+
echo "Configuring ff-npm-registry token"
172+
curl -ks -w "\n" -XPUT \
173+
-H "Content-Type: application/json" \
174+
-H "Authorization: Bearer $INIT_CONFIG_ACCESS_TOKEN" \
175+
-d '{"platform:ff-npm-registry:token": "'"$FF_NODES_TOKEN"'"}' \
176+
https://$FLOWFUSE_URL/api/v1/settings/
177+
169178
### Create project type
170179
echo "Creating project type"
171180
curl -ks -w "\n" -XPOST \
@@ -175,7 +184,8 @@ curl -ks -w "\n" -XPOST \
175184
https://$FLOWFUSE_URL/api/v1/project-types/
176185

177186
### Create stacks
178-
create_stack "Default" "Default" 30 256 "flowfuse/node-red:$(get_latest_image_tag "4.0.x")"
187+
create_stack "Default" "Default (4.1.x)" 30 256 "flowfuse/node-red:$(get_latest_image_tag "4.1.x")"
188+
create_stack "NR-40x" "4.0.x" 30 256 "flowfuse/node-red:$(get_latest_image_tag "4.0.x")"
179189
create_stack "NR-30x" "3.0.x" 30 256 "flowfuse/node-red:latest"
180190
create_stack "NR-31x" "3.1.x" 30 256 "flowfuse/node-red:$(get_latest_image_tag "3.1.x")"
181191

@@ -211,22 +221,23 @@ curl -ks -w "\n" -XPOST \
211221
"limit": 10
212222
},
213223
"features": {
214-
"shared-library": false,
215-
"projectComms": false,
224+
"shared-library": true,
225+
"projectComms": true,
216226
"ha": false,
217227
"teamHttpSecurity": false,
218228
"customCatalogs": false,
219229
"deviceGroups": false,
220230
"emailAlerts": false,
221231
"protectedInstance": false,
222-
"deviceAutoSnapshot": false,
232+
"deviceAutoSnapshot": true,
223233
"instanceAutoSnapshot": false,
224234
"editorLimits": false,
225235
"fileStorageLimit": null,
226236
"contextLimit": null,
227237
"customHostnames":false,
228238
"staticAssets":false,
229-
"teamBroker":false
239+
"teamBroker":false,
240+
"ffNodes": true
230241
},
231242
"instances": {
232243
"'"$projectTypeId"'": {
@@ -254,7 +265,7 @@ curl -ks -w "\n" -XPOST \
254265
"limit": 10
255266
},
256267
"features":{
257-
"ha":true,
268+
"ha":false,
258269
"shared-library":true,
259270
"projectComms":true,
260271
"teamHttpSecurity":true,
@@ -267,11 +278,14 @@ curl -ks -w "\n" -XPOST \
267278
"instanceAutoSnapshot":true,
268279
"protectedInstance":true,
269280
"editorLimits":true,
270-
"customHostnames":true,
281+
"customHostnames":false,
271282
"staticAssets":true,
272283
"projectHistory":true,
273284
"teamBroker":true,
274-
"generatedSnapshotDescription":true
285+
"generatedSnapshotDescription":true,
286+
"assistantInlineCompletions": true,
287+
"npm": true,
288+
"ffNodes": true
275289
},
276290
"instances": {
277291
"'"$projectTypeId"'": {
@@ -319,7 +333,13 @@ curl -ks -w "\n" -XPOST \
319333
"teamBroker":true,
320334
"gitIntegration": true,
321335
"instanceResources":true,
322-
"generatedSnapshotDescription":true
336+
"generatedSnapshotDescription":true,
337+
"assistantInlineCompletions": true,
338+
"ffNodes": true,
339+
"rbacApplication": true,
340+
"npm": true,
341+
"ffNodes": true,
342+
"tables": true
323343
},
324344
"instances": {
325345
"'"$projectTypeId"'": {

.github/trivy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pkg:
2222
types:
2323
- os
2424
- library
25-
25+
include-dev-deps: true
2626

2727
format: "sarif"
2828
ignorefile: ".github/.trivyignore.yaml"

.github/workflows/branch-deploy.yaml

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ on:
4040
- 'docs/**'
4141

4242
concurrency:
43-
group: ${{ github.workflow }}-${{ github.event.number }}
43+
group: ${{ github.workflow }}-${{ github.event.number || inputs.pr_number }}
4444
cancel-in-progress: false
4545

4646
env:
@@ -55,7 +55,8 @@ jobs:
5555
runs-on: ubuntu-latest
5656
if: |
5757
(github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') &&
58-
github.actor != 'dependabot[bot]'
58+
github.actor != 'dependabot[bot]' &&
59+
!startsWith(github.head_ref, 'release-')
5960
outputs:
6061
is_org_member: ${{ steps.validate.outputs.is_member }}
6162
steps:
@@ -88,7 +89,7 @@ jobs:
8889
needs.validate-user.outputs.is_org_member == 'true' &&
8990
github.event_name == 'workflow_dispatch' &&
9091
inputs.driver_k8s_branch != 'main'
91-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.44.0'
92+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.48.0'
9293
with:
9394
package_name: driver-k8s
9495
publish_package: true
@@ -105,7 +106,7 @@ jobs:
105106
needs.validate-user.outputs.is_org_member == 'true' &&
106107
github.event_name == 'workflow_dispatch' &&
107108
inputs.nr_project_nodes_branch != 'main'
108-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.44.0'
109+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.48.0'
109110
with:
110111
package_name: nr-project-nodes
111112
publish_package: true
@@ -122,7 +123,7 @@ jobs:
122123
needs.validate-user.outputs.is_org_member == 'true' &&
123124
github.event_name == 'workflow_dispatch' &&
124125
inputs.nr_file_nodes_branch != 'main'
125-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.44.0'
126+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.48.0'
126127
with:
127128
package_name: nr-file-nodes
128129
publish_package: true
@@ -139,7 +140,7 @@ jobs:
139140
needs.validate-user.outputs.is_org_member == 'true' &&
140141
github.event_name == 'workflow_dispatch' &&
141142
inputs.nr_assistant_branch != 'main'
142-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.44.0'
143+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.48.0'
143144
with:
144145
package_name: nr-assistant
145146
publish_package: true
@@ -156,7 +157,7 @@ jobs:
156157
needs.validate-user.outputs.is_org_member == 'true' &&
157158
github.event_name == 'workflow_dispatch' &&
158159
inputs.nr_tables_nodes_branch != 'main'
159-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.44.0'
160+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.48.0'
160161
with:
161162
package_name: nr-tables-nodes
162163
publish_package: true
@@ -178,7 +179,7 @@ jobs:
178179
needs.validate-user.outputs.is_org_member == 'true' &&
179180
github.event_name == 'workflow_dispatch' &&
180181
(always() && inputs.nr_launcher_branch != 'main') || needs.publish_nr_project_nodes.result == 'success' || needs.publish_nr_file_nodes.result == 'success' || needs.publish_nr_assistant.result == 'success' || needs.publish_nr_tables_nodes.result == 'success'
181-
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.44.0'
182+
uses: 'flowfuse/github-actions-workflows/.github/workflows/publish_node_package.yml@v0.48.0'
182183
with:
183184
package_name: flowfuse-nr-launcher
184185
publish_package: true
@@ -202,7 +203,7 @@ jobs:
202203
needs.validate-user.outputs.is_org_member == 'true' &&
203204
github.event_name == 'workflow_dispatch' &&
204205
(always() && needs.publish_nr_launcher.result == 'success')
205-
uses: flowfuse/github-actions-workflows/.github/workflows/build_container_image.yml@v0.43.0
206+
uses: flowfuse/github-actions-workflows/.github/workflows/build_container_image.yml@v0.48.0
206207
with:
207208
image_name: 'node-red'
208209
dockerfile_path: Dockerfile
@@ -242,11 +243,11 @@ jobs:
242243
echo "timestamp=$(date +%s)" >> $GITHUB_ENV
243244
244245
- name: Setup Docker buildx
245-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
246+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
246247

247248
- name: Configure AWS credentials for ECR interaction
248249
id: aws-config
249-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
250+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
250251
with:
251252
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ env.AWS_ECR_PUSH_ROLE }}
252253
role-session-name: GithubActionsRoleSession
@@ -261,7 +262,7 @@ jobs:
261262
mask-password: true
262263

263264
- name: Login to GHCR
264-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
265+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
265266
with:
266267
registry: ghcr.io
267268
username: ${{ github.actor }}
@@ -295,7 +296,7 @@ jobs:
295296
PR_NUMBER: ${{ github.event.number == '' && inputs.pr_number || github.event.number }}
296297
steps:
297298
- name: Checkout
298-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
299+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
299300

300301
- name: Set variables
301302
run: |
@@ -305,7 +306,7 @@ jobs:
305306
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
306307

307308
- name: Setup Docker buildx
308-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
309+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
309310

310311
- name: Set build-args if branch is not main
311312
id: set-build-args
@@ -359,15 +360,15 @@ jobs:
359360
id-token: write
360361
steps:
361362
- name: Checkout
362-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
363+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
363364

364365
- name: Set variables
365366
run: |
366367
echo "tagged_image=${{ env.IMAGE_NAME }}:pr-${{ env.PR_NUMBER}}" >> $GITHUB_ENV
367368
echo "timestamp=$(date +%s)" >> $GITHUB_ENV
368369
369370
- name: Download artifact
370-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
371+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
371372
with:
372373
name: k8s-forge
373374
path: /tmp
@@ -385,7 +386,7 @@ jobs:
385386

386387
- name: Configure AWS credentials for ECR interaction
387388
id: aws-config
388-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
389+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
389390
with:
390391
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ env.AWS_ECR_PUSH_ROLE }}
391392
role-session-name: GithubActionsRoleSession
@@ -405,7 +406,7 @@ jobs:
405406
docker push ${{ steps.aws-config.outputs.aws-account-id }}.dkr.ecr.eu-west-1.amazonaws.com/flowforge/${{ env.tagged_image }}-${{ env.timestamp }}
406407
407408
- name: Configure AWS credentials for EKS interaction
408-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
409+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
409410
with:
410411
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ env.AWS_EKS_DEPLOY_ROLE }}
411412
role-session-name: GithubActionsRoleSessio
@@ -417,12 +418,12 @@ jobs:
417418
aws eks update-kubeconfig --region eu-west-1 --name ${{ secrets.EKS_CLUSTER_NAME }}
418419
419420
- name: Install 1Password CLI
420-
uses: 1password/install-cli-action@f5d505685ccf986ef535da41cd180792c8ac3a36 # v2.0.1
421+
uses: 1password/install-cli-action@9a0c9dd934086b7ab1d90115d455bda1c53c2bdb # v2.0.2
421422
with:
422423
version: 2.25.0
423424

424425
- name: Check out FlowFuse/helm repository (to access latest helm chart)
425-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
426+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
426427
with:
427428
repository: 'FlowFuse/helm'
428429
ref: 'main'
@@ -459,14 +460,17 @@ jobs:
459460
--set forge.email.ses.sourceArn=arn:aws:ses:eu-west-1:${{ secrets.AWS_ACCOUNT_ID }}:identity/flowfuse.com \
460461
--set forge.assistant.service.url=$(op read op://ci/staging_flowfuse/assistant_url) \
461462
--set forge.assistant.service.token=$(op read op://ci/staging_flowfuse/assistant_token) \
462-
--set forge.expert.service.url=$(op read op://ci/staging_flowfuse/expert_url) \
463-
--set forge.expert.service.token=$(op read op://ci/staging_flowfuse/expert_token) \
463+
--set forge.expert.service.url=$(op read op://ci/prestaging_flowfuse/expert_url) \
464+
--set forge.expert.service.token=$(op read op://ci/prestaging_flowfuse/expert_token) \
465+
--set forge.tables.driver.options.database.user=$(op read op://ci/prestaging_flowfuse/local_postgres_admin_username) \
466+
--set forge.tables.driver.options.database.password=$(op read op://ci/prestaging_flowfuse/local_postgres_admin_password) \
467+
--set forge.tables.driver.options.database.host=flowfuse-pr-${{ env.PR_NUMBER }}-postgresql.pr-${{ env.PR_NUMBER }}.svc.cluster.local \
464468
flowfuse-pr-${{ env.PR_NUMBER }} ./helm-repo/helm/flowfuse
465469
466470
- name: Initial setup
467471
if: ${{ env.initialSetup == 'true' }}
468472
run: |
469-
./.github/scripts/initial-setup.sh ${{ env.PR_NUMBER }} ${{ secrets.INIT_CONFIG_PASSWORD_HASH }} ${{ secrets.INIT_CONFIG_ACCESS_TOKEN_HASH }} ${{ secrets.INIT_CONFIG_ACCESS_TOKEN }} ${{ secrets.INIT_CONFIG_PASSWORD }}
473+
./.github/scripts/initial-setup.sh ${{ env.PR_NUMBER }} ${{ secrets.INIT_CONFIG_PASSWORD_HASH }} ${{ secrets.INIT_CONFIG_ACCESS_TOKEN_HASH }} ${{ secrets.INIT_CONFIG_ACCESS_TOKEN }} ${{ secrets.INIT_CONFIG_PASSWORD }} ${{ secrets.PRE_STAGING_FLOWFUSE_NODES_TOKEN }}
470474
471475
- name: Summary
472476
run: |
@@ -533,11 +537,13 @@ jobs:
533537

534538
- name: Post to a Slack channel
535539
id: slack
536-
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
540+
uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1
537541
with:
538-
channel-id: 'C067BD0377F'
542+
method: 'chat.postMessage'
543+
token: ${{ secrets.SLACK_GHBOT_TOKEN }}
539544
payload: |
540545
{
546+
"channel": "C067BD0377F",
541547
"blocks": [
542548
{
543549
"type": "header",
@@ -591,7 +597,6 @@ jobs:
591597
PR_TEXT: |
592598
*Pull Request:*
593599
<https://github.com/FlowFuse/flowfuse/pull/${{ env.PR_NUMBER }}|${{ github.event.pull_request.title }}>
594-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_GHBOT_TOKEN }}
595600
GRAFANA_URL: ${{ secrets.STAGING_GRAFANA_URL }}
596601

597602

@@ -612,7 +617,7 @@ jobs:
612617
id-token: write
613618
steps:
614619
- name: Configure AWS credentials for EKS interaction
615-
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
620+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
616621
with:
617622
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ env.AWS_EKS_DEPLOY_ROLE }}
618623
role-session-name: GithubActionsRoleSession

.github/workflows/check-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
run:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
14+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1515
with:
1616
ref: ${{ github.event.pull_request.head.sha }}
1717
fetch-depth: 0

.github/workflows/docs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
name: Test Documentation links
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
16+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717
- name: Setup Node
18-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
18+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
1919
with:
2020
node-version: '18'
2121
- name: Install Dependencies
@@ -27,11 +27,11 @@ jobs:
2727
name: Test Documentation with website
2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131
with:
3232
path: 'flowfuse'
3333
- name: Check out website repository
34-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3535
with:
3636
repository: 'FlowFuse/website'
3737
path: 'website'
@@ -42,18 +42,18 @@ jobs:
4242
app_id: ${{ secrets.GH_BOT_APP_ID }}
4343
private_key: ${{ secrets.GH_BOT_APP_KEY }}
4444
- name: Check out FlowFuse/blueprint-library repository (to access the blueprints)
45-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
45+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4646
with:
4747
repository: 'FlowFuse/blueprint-library'
4848
ref: main
4949
path: 'blueprint-library'
5050
token: ${{ steps.generate_token.outputs.token }}
5151
- name: Cache image pipeline output
52-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
52+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
5353
with:
5454
key: img-pipeline-cache
5555
path: website/_site/img
56-
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
56+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
5757
with:
5858
cache: 'npm'
5959
cache-dependency-path: './website/package-lock.json'

0 commit comments

Comments
 (0)