Skip to content

Commit 331e499

Browse files
release(required): Amplify JS release (#14545)
2 parents 1beab3b + 0f5e997 commit 331e499

File tree

29 files changed

+1355
-558
lines changed

29 files changed

+1355
-558
lines changed

.github/actions/node-and-build/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ runs:
3333
# TODO We should be able to skip yarn / bootstrap if we cache enough things. Leaving because skipping causes issues.
3434
- name: Install
3535
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true'
36-
run: yarn
3736
shell: bash
3837
working-directory: ./amplify-js
38+
run: |
39+
for i in {1..3}; do
40+
echo "Starting attempt $i."
41+
yarn && break
42+
echo "Attempt $i failed."
43+
sleep 5
44+
done
3945
- name: Bootstrap
4046
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true'
4147
run: yarn bootstrap
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 'Set Status'
2+
description: 'Set status on a specified head-sha'
3+
inputs:
4+
context:
5+
description: 'Name of the status'
6+
required: true
7+
description:
8+
description: 'Short description of the status'
9+
required: false
10+
state:
11+
description: >-
12+
State of the status with possible values of 'error', 'failure', 'pending', 'success'
13+
required: true
14+
sha:
15+
description: 'The commit ID to add the status to'
16+
required: true
17+
target-url:
18+
description: >-
19+
Target URL to associate with this status.
20+
This URL will be linked from the GitHub UI to allow users to easily see the source of the status.'
21+
required: false
22+
runs:
23+
using: 'composite'
24+
steps:
25+
- name: Set a commit status
26+
id: set-status
27+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 https://github.com/actions/github-script/commit/60a0d83039c74a4aee543508d2ffcb1c3799cdea
28+
env:
29+
status_context: ${{ inputs.context }}
30+
description: ${{ inputs.description }}
31+
state: ${{ inputs.state }}
32+
sha: ${{ inputs.sha }}
33+
target_url: ${{ inputs.target-url }}
34+
owner: ${{ github.event.repository.owner.login }}
35+
repo: ${{ github.event.repository.name }}
36+
with:
37+
result-encoding: string
38+
script: |
39+
const { status_context, description, state, sha, target_url, owner, repo } = process.env;
40+
const inputValidationErrors = [];
41+
if (!state || state.length === 0) {
42+
inputValidationErrors.push('"state" input cannot be empty.');
43+
}
44+
if (!["error", "failure", "pending", "success"].includes(state)) {
45+
inputValidationErrors.push('"state" must be a string input with possible value of "error", "failure", "pending", "success".');
46+
}
47+
if (!status_context || status_context.length === 0) {
48+
inputValidationErrors.push('"context" input cannot be empty.');
49+
}
50+
if (!sha || sha.length === 0) {
51+
inputValidationErrors.push('"sha" input cannot be empty.');
52+
}
53+
if (!sha.match(/^[0-9a-z]+$/)) {
54+
inputValidationErrors.push('"sha" must be an alphanumeric string.');
55+
}
56+
if (target_url && target_url.length > 0) {
57+
if (target_url.length > 2048) {
58+
inputValidationErrors.push('"target-url" must be less than 2048 characters.');
59+
}
60+
61+
try {
62+
const url = new URL(target_url);
63+
64+
if (url.protocol !== 'https:') {
65+
inputValidationErrors.push('"target-url" must use HTTPS protocol.');
66+
}
67+
68+
const allowedHostnames = ['github.com', 'api.github.com'];
69+
if (!allowedHostnames.includes(url.hostname)) {
70+
inputValidationErrors.push(`"target-url" must be one of: ${allowedHostnames.join(', ')}.`);
71+
}
72+
73+
} catch (error) {
74+
if (error instanceof TypeError && error.message.includes('Invalid URL')) {
75+
inputValidationErrors.push('"target-url" must be a valid URL format.');
76+
} else {
77+
inputValidationErrors.push(`"target-url" validation failed: ${error.message}`);
78+
}
79+
}
80+
}
81+
if (inputValidationErrors.length > 0) {
82+
inputValidationErrors.forEach(core.error);
83+
process.exit(1);
84+
}
85+
github.rest.repos.createCommitStatus({
86+
owner,
87+
repo,
88+
sha,
89+
state,
90+
context: status_context,
91+
description: description && description.length > 0 ? description : undefined,
92+
target_url: target_url && target_url.length > 0 ? target_url : undefined,
93+
});

.github/actions/setup-samples-staging/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ runs:
4545
fi
4646
4747
- name: Install
48-
run: |
49-
yarn
5048
shell: bash
5149
working-directory: ./amplify-js-samples-staging
50+
run: |
51+
for i in {1..3}; do
52+
echo "Starting attempt $i."
53+
yarn && break
54+
echo "Attempt $i failed."
55+
sleep 5
56+
done

.github/dependency-review/dependency-review-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ allow-licenses:
1515
- 'ISC'
1616
- 'JSON'
1717
- 'MIT'
18+
- 'MIT-0'
1819
- 'OpenSSL'
1920
- 'PDDL-1.0'
2021
- 'PostgreSQL'
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
tests:
22
[]
3-
# integ_auth_test_cypress_no_ui
4-
# - test_name: 'Token revocation'
5-
# category: 'auth'
6-
# spec: 'token-revocation'
7-
# is_headless: true

.github/integ-config/integ-all.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,13 @@ tests:
528528
sample_name: [sign-in-with-oauth]
529529
spec: sign-out-oidc-provider
530530
browser: [chrome]
531+
- test_name: integ_next_auth_token_revocation
532+
desc: 'Token Revocation'
533+
framework: next
534+
category: auth
535+
sample_name: [auth-rsc]
536+
spec: token-revocation
537+
browser: [chrome]
531538

532539
# AUTH GEN2
533540
- test_name: integ_react_javascript_authentication_gen2
@@ -622,13 +629,15 @@ tests:
622629
category: auth
623630
sample_name: [custom-auth]
624631
spec: custom-auth
632+
retry_count: 15
625633
browser: *minimal_browser_list
626634
- test_name: integ_next_auth_sign_in_with_sms_mfa
627635
desc: 'Resumable sign in with SMS MFA flow'
628636
framework: next
629637
category: auth
630638
sample_name: [mfa]
631639
spec: sign-in-resumable-mfa
640+
retry_count: 15
632641
browser: *minimal_browser_list
633642
env:
634643
NEXT_PUBLIC_BACKEND_CONFIG: resum-signin
@@ -837,20 +846,23 @@ tests:
837846
category: storage
838847
sample_name: [storage-gen2]
839848
spec: storage-gen2
849+
retry_count: 10
840850
browser: *minimal_browser_list
841851
- test_name: integ_react_storage_internal
842852
desc: 'React Storage Gen2 Internal APIs'
843853
framework: react
844854
category: storage
845855
sample_name: [storage-gen2-internal]
846856
spec: storage-gen2-internal
857+
retry_count: 10
847858
browser: *minimal_browser_list
848859
- test_name: integ_next_storage
849860
desc: 'Next Storage Auth'
850861
framework: next
851862
category: storage
852863
sample_name: [storage-auth]
853864
spec: storage-client-server
865+
retry_count: 10
854866
browser: [chrome] # firefox issues with secure cookies in cypress, manual testing works fine
855867

856868
# INAPPMESSAGING
@@ -913,6 +925,7 @@ tests:
913925
category: auth
914926
sample_name: [mfa]
915927
spec: mfa-req-email
928+
retry_count: 15
916929
browser: *minimal_browser_list
917930
env:
918931
NEXT_PUBLIC_BACKEND_CONFIG: mfa-req-email
@@ -922,6 +935,7 @@ tests:
922935
category: auth
923936
sample_name: [mfa]
924937
spec: mfa-req-phone
938+
retry_count: 15
925939
browser: *minimal_browser_list
926940
env:
927941
NEXT_PUBLIC_BACKEND_CONFIG: mfa-req-phone
@@ -931,6 +945,7 @@ tests:
931945
category: auth
932946
sample_name: [mfa]
933947
spec: mfa-opt-email
948+
retry_count: 15
934949
browser: *minimal_browser_list
935950
env:
936951
NEXT_PUBLIC_BACKEND_CONFIG: mfa-opt-email
@@ -940,6 +955,7 @@ tests:
940955
category: auth
941956
sample_name: [mfa]
942957
spec: mfa-opt-phone
958+
retry_count: 15
943959
browser: *minimal_browser_list
944960
env:
945961
NEXT_PUBLIC_BACKEND_CONFIG: mfa-opt-phone
@@ -949,6 +965,7 @@ tests:
949965
category: auth
950966
sample_name: [mfa]
951967
spec: mfa-setup
968+
retry_count: 15
952969
browser: *minimal_browser_list
953970
env:
954971
NEXT_PUBLIC_BACKEND_CONFIG: mfa-setup
@@ -958,6 +975,7 @@ tests:
958975
category: auth
959976
sample_name: [mfa]
960977
spec: passwordless/auto-sign-in
978+
retry_count: 15
961979
browser: *minimal_browser_list
962980
env:
963981
NEXT_PUBLIC_BACKEND_CONFIG: pwl-autosignin
@@ -985,6 +1003,7 @@ tests:
9851003
category: auth
9861004
sample_name: [mfa]
9871005
spec: passwordless/sign-up
1006+
retry_count: 15
9881007
browser: *minimal_browser_list
9891008
env:
9901009
NEXT_PUBLIC_BACKEND_CONFIG: pwl-signup
@@ -994,6 +1013,7 @@ tests:
9941013
category: auth
9951014
sample_name: [mfa]
9961015
spec: passwordless/miscellaneous
1016+
retry_count: 15
9971017
browser: *minimal_browser_list
9981018
env:
9991019
NEXT_PUBLIC_BACKEND_CONFIG: pwl-misc
@@ -1014,6 +1034,8 @@ tests:
10141034
category: auth
10151035
sample_name: [mfa]
10161036
spec: refresh-token-auth
1037+
retry_count: 15
1038+
timeout_minutes: 90
10171039
browser: *minimal_browser_list
10181040
env:
10191041
NEXT_PUBLIC_BACKEND_CONFIG: misc-tokenref

.github/workflows/callable-e2e-test-detox.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
path: amplify-js
3232
- name: Setup node and build the repository
3333
uses: ./amplify-js/.github/actions/node-and-build
34+
- name: Set Xcode version
35+
run: |
36+
sudo xcode-select -s /Applications/Xcode_16.4.app
3437
- name: Setup samples staging repository
3538
uses: ./amplify-js/.github/actions/setup-samples-staging
3639
with:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Close pending-community-response issues
2+
3+
on:
4+
schedule:
5+
- cron: '30 2 * * *' # runs daily at 02:30 UTC
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
issues: write
10+
11+
jobs:
12+
stale:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639
16+
with:
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
only-issue-labels: pending-community-response,question
19+
stale-issue-label: pending-community-response
20+
days-before-issue-stale: -1 # skip stale labeling
21+
days-before-issue-close: 14
22+
close-issue-message: 'This issue is being automatically closed due to lack of recent activity. Please feel free to reopen it if you have any further questions.'
23+
days-before-pr-stale: -1 # ignore PRs
24+
days-before-pr-close: -1 # ignore PRs
25+
remove-issue-stale-when-updated: false
26+
operations-per-run: 100
27+
debug-only: true # TODO: remove this when the dry-run succeeds

.github/workflows/pr-label.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Description: This workflow runs test suite against PRs that are not from forks.
2+
#
3+
# Triggers:
4+
# - When a PR is opened, updated, or labeled against specific branches
5+
# - Only runs when the PR has the 'run-tests' label
6+
# - Only runs for internal PRs (not from forks)
7+
8+
name: Test / Internal PRs
9+
10+
concurrency:
11+
group: push-e2e-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
on:
15+
pull_request:
16+
branches: [main, release]
17+
types: [opened, synchronize, labeled]
18+
19+
jobs:
20+
setup:
21+
if: |
22+
github.event.pull_request.head.repo.full_name == github.repository &&
23+
contains(github.event.pull_request.labels.*.name, 'run-tests')
24+
runs-on: ubuntu-latest
25+
permissions:
26+
statuses: write # This is required for running set-status actions
27+
steps:
28+
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
29+
- name: Update status to pending prior to starting tests
30+
uses: ./.github/actions/set-status
31+
with:
32+
sha: ${{ github.event.pull_request.head.sha }}
33+
state: 'pending'
34+
context: 'Run PR e2e checks'
35+
description: 'PR e2e checks are now running'
36+
# URL below is a link to the current workflow run to allow users to see the status of the workflow.
37+
target-url: https://github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}
38+
39+
prebuild:
40+
needs: setup
41+
strategy:
42+
matrix:
43+
platform: [ubuntu-latest, macos-latest]
44+
uses: ./.github/workflows/callable-prebuild-amplify-js.yml
45+
with:
46+
runs_on: ${{ matrix.platform }}
47+
48+
prebuild-samples-staging:
49+
needs: setup
50+
secrets: inherit
51+
uses: ./.github/workflows/callable-prebuild-samples-staging.yml
52+
53+
e2e:
54+
needs: [setup, prebuild, prebuild-samples-staging]
55+
secrets: inherit
56+
uses: ./.github/workflows/callable-e2e-tests.yml
57+
58+
update-success-status:
59+
if: ${{ success() }}
60+
needs: [e2e]
61+
runs-on: ubuntu-latest
62+
permissions:
63+
statuses: write # This is required for running set-status actions
64+
steps:
65+
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
66+
- name: Update status when tests are successful
67+
uses: ./.github/actions/set-status
68+
with:
69+
sha: ${{ github.event.pull_request.head.sha }}
70+
state: 'success'
71+
context: 'Run PR e2e checks'
72+
description: 'PR e2e checks have finished running'
73+
target-url: https://github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}
74+
75+
update-failure-status:
76+
if: ${{ failure() }}
77+
needs: [e2e]
78+
runs-on: ubuntu-latest
79+
permissions:
80+
statuses: write # This is required for running set-status actions
81+
steps:
82+
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
83+
- name: Update status when tests are not successful
84+
uses: ./.github/actions/set-status
85+
with:
86+
sha: ${{ github.event.pull_request.head.sha }}
87+
state: 'failure'
88+
context: 'Run PR e2e checks'
89+
description: 'PR e2e checks have failed'
90+
target-url: https://github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)