Skip to content

Commit 51edcf2

Browse files
authored
Merge branch 'main' into mg/OPS-3127-2
2 parents 403ad4f + 22a45f8 commit 51edcf2

42 files changed

Lines changed: 833 additions & 431 deletions

Some content is hidden

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

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- name: Get token from Github App
1717
id: app_token
18-
uses: actions/create-github-app-token@v2.1.4
18+
uses: actions/create-github-app-token@v2.2.0
1919
with:
2020
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
2121
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}

.github/workflows/chromatic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v5.0.1
14+
uses: actions/checkout@v6.0.0
1515
with:
1616
fetch-depth: 0
1717

@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Run Chromatic
3131
if: env.CHROMATIC_PROJECT_TOKEN
32-
uses: chromaui/action@v13.3.3
32+
uses: chromaui/action@v13.3.4
3333
with:
3434
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
3535
onlyChanged: true # 👈 Required option to enable TurboSnap

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Install Dependencies
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v5.0.1
16+
- uses: actions/checkout@v6.0.0
1717
- name: Lookup node_modules cache
1818
id: node-modules-cache
1919
uses: actions/cache@v4.3.0
@@ -30,7 +30,7 @@ jobs:
3030
needs: install
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v5.0.1
33+
- uses: actions/checkout@v6.0.0
3434
- name: Restore node_modules cache
3535
id: node-modules-cache
3636
uses: actions/cache/restore@v4.3.0
@@ -45,7 +45,7 @@ jobs:
4545
needs: install
4646
runs-on: ubuntu-latest
4747
steps:
48-
- uses: actions/checkout@v5.0.1
48+
- uses: actions/checkout@v6.0.0
4949
- name: Restore node_modules cache
5050
id: node-modules-cache
5151
uses: actions/cache/restore@v4.3.0
@@ -76,12 +76,12 @@ jobs:
7676
steps:
7777
- name: Checkout for Dependabot PR
7878
if: ${{ startsWith(github.head_ref || '', 'dependabot/') }}
79-
uses: actions/checkout@v5.0.1
79+
uses: actions/checkout@v6.0.0
8080
with:
8181
ref: ${{ github.head_ref }}
8282
- name: Checkout for others
8383
if: ${{ !startsWith(github.head_ref || '', 'dependabot/') }}
84-
uses: actions/checkout@v5.0.1
84+
uses: actions/checkout@v6.0.0
8585
- name: Restore node_modules cache
8686
id: node-modules-cache
8787
uses: actions/cache/restore@v4.3.0
@@ -124,7 +124,7 @@ jobs:
124124
needs: install
125125
runs-on: ubuntu-latest
126126
steps:
127-
- uses: actions/checkout@v5.0.1
127+
- uses: actions/checkout@v6.0.0
128128
- name: Restore node_modules cache
129129
id: node-modules-cache
130130
uses: actions/cache/restore@v4.3.0
@@ -157,7 +157,7 @@ jobs:
157157
needs: install
158158
runs-on: ubuntu-latest
159159
steps:
160-
- uses: actions/checkout@v5.0.1
160+
- uses: actions/checkout@v6.0.0
161161
- name: Restore node_modules cache
162162
id: node-modules-cache
163163
uses: actions/cache/restore@v4.3.0
@@ -198,7 +198,7 @@ jobs:
198198
needs: build
199199
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-latest' || 'ubuntu-arm64' }}
200200
steps:
201-
- uses: actions/checkout@v5.0.1
201+
- uses: actions/checkout@v6.0.0
202202
- name: Restore build cache
203203
uses: actions/cache/restore@v4.3.0
204204
with:
@@ -209,7 +209,7 @@ jobs:
209209
uses: docker/setup-buildx-action@v3.11.1
210210
- name: Configure AWS credentials
211211
if: vars.ECR_REGION
212-
uses: aws-actions/configure-aws-credentials@v5.1.0
212+
uses: aws-actions/configure-aws-credentials@v5.1.1
213213
with:
214214
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
215215
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
@@ -266,7 +266,7 @@ jobs:
266266
needs: build-images
267267
steps:
268268
- name: Configure AWS credentials
269-
uses: aws-actions/configure-aws-credentials@v5.1.0
269+
uses: aws-actions/configure-aws-credentials@v5.1.1
270270
with:
271271
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
272272
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Set up Docker Buildx
4747
uses: docker/setup-buildx-action@v3.11.1
4848
- name: Configure AWS credentials
49-
uses: aws-actions/configure-aws-credentials@v5.1.0
49+
uses: aws-actions/configure-aws-credentials@v5.1.1
5050
with:
5151
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
5252
aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }}
@@ -84,7 +84,7 @@ jobs:
8484
VERSION: ${{ needs.get-version.outputs.version }}
8585
RELEASE_DC_FILENAME: openops-dc-${{ needs.get-version.outputs.version }}.zip
8686
steps:
87-
- uses: actions/checkout@v5.0.1
87+
- uses: actions/checkout@v6.0.0
8888
- name: Create a release file
8989
run: |
9090
cp THIRD_PARTY_LICENSES.txt LICENSE NOTICE deploy/docker-compose
@@ -109,7 +109,7 @@ jobs:
109109
echo "The release was created as a draft." >> $GITHUB_STEP_SUMMARY
110110
echo "Please [review and publish it](${RELEASE_URL/\/tags\//\/edit\/})." >> $GITHUB_STEP_SUMMARY
111111
- name: Configure AWS credentials
112-
uses: aws-actions/configure-aws-credentials@v5.1.0
112+
uses: aws-actions/configure-aws-credentials@v5.1.1
113113
with:
114114
aws-access-key-id: ${{ secrets.RELEASE_S3_ACCESS_KEY_ID }}
115115
aws-secret-access-key: ${{ secrets.RELEASE_S3_SECRET_ACCESS_KEY }}
@@ -133,7 +133,7 @@ jobs:
133133
steps:
134134
- name: Get token from Github App
135135
id: app_token
136-
uses: actions/create-github-app-token@v2.1.4
136+
uses: actions/create-github-app-token@v2.2.0
137137
with:
138138
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
139139
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}
@@ -154,7 +154,7 @@ jobs:
154154
steps:
155155
- name: Get GitHub App token
156156
id: app_token
157-
uses: actions/create-github-app-token@v2.1.4
157+
uses: actions/create-github-app-token@v2.2.0
158158
with:
159159
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
160160
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}

.github/workflows/sync-internal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Get token from Github App
1313
id: app_token
14-
uses: actions/create-github-app-token@v2.1.4
14+
uses: actions/create-github-app-token@v2.2.0
1515
with:
1616
app-id: ${{ vars.DEVOPS_GITHUB_APP_ID }}
1717
private-key: ${{ secrets.DEVOPS_GITHUB_APP_PEM }}

packages/blocks/aws/src/lib/actions/arn/build-arn-action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const buildArnAction = createAction({
1515
}),
1616
region: Property.ShortText({
1717
displayName: 'Region',
18-
required: true,
18+
required: false,
1919
}),
2020
accountId: Property.ShortText({
2121
displayName: 'Account ID',
@@ -33,7 +33,7 @@ export const buildArnAction = createAction({
3333
service,
3434
accountId,
3535
resource: resourceId,
36-
region,
36+
region: region ?? '',
3737
});
3838

3939
return arn;

packages/blocks/aws/test/arn/build-arn-action.test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('buildArnAction', () => {
1717
},
1818
region: {
1919
type: 'SHORT_TEXT',
20-
required: true,
20+
required: false,
2121
},
2222
});
2323
});
@@ -36,4 +36,21 @@ describe('buildArnAction', () => {
3636
'arn:aws:ec2:us-west-2:123456789012:i-1234567890abcdef0',
3737
);
3838
});
39+
40+
test.each([undefined, null, ''])(
41+
'should build ARN without region when region=%p',
42+
async (regionVal) => {
43+
const result = await buildArnAction.run({
44+
...jest.requireActual('@openops/blocks-framework'),
45+
propsValue: {
46+
service: 'iam',
47+
region: regionVal as any,
48+
accountId: '123456789012',
49+
resourceId: 'user/David',
50+
},
51+
});
52+
53+
expect(result).toEqual('arn:aws:iam::123456789012:user/David');
54+
},
55+
);
3956
});
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { LoadingSpinner } from '@openops/components/ui';
2+
import { useEffect, useState } from 'react';
3+
import { QueryKeys } from './constants/query-keys';
4+
import { flagsApi, FlagsMap } from './lib/flags-api';
5+
import { initializeInternal } from './lib/initialize-internal';
6+
import { queryClient } from './lib/query-client';
7+
8+
type AppBootstrapProps = {
9+
children: React.ReactNode;
10+
};
11+
12+
type BootstrapState =
13+
| { status: 'loading' }
14+
| { status: 'ready' }
15+
| { status: 'error'; error: Error };
16+
17+
export function AppBootstrap({ children }: Readonly<AppBootstrapProps>) {
18+
const [state, setState] = useState<BootstrapState>({ status: 'loading' });
19+
20+
useEffect(() => {
21+
let mounted = true;
22+
23+
async function bootstrap() {
24+
try {
25+
const flags = await flagsApi.getAll();
26+
queryClient.setQueryData<FlagsMap>([QueryKeys.flags], flags);
27+
await initializeInternal();
28+
29+
if (mounted) {
30+
setState({ status: 'ready' });
31+
}
32+
} catch (error) {
33+
console.error('Bootstrap failed:', error);
34+
if (mounted) {
35+
setState({
36+
status: 'error',
37+
error:
38+
error instanceof Error
39+
? error
40+
: new Error('Failed to initialize application'),
41+
});
42+
}
43+
}
44+
}
45+
46+
bootstrap();
47+
48+
return () => {
49+
mounted = false;
50+
};
51+
}, []);
52+
53+
if (state.status === 'loading') {
54+
return (
55+
<div className="flex h-screen w-screen items-center justify-center">
56+
<LoadingSpinner size={50} />
57+
</div>
58+
);
59+
}
60+
61+
if (state.status === 'error') {
62+
throw state.error;
63+
}
64+
65+
return children;
66+
}

0 commit comments

Comments
 (0)