1- name : integration-patch-repair
1+ name : autofix
22
33on :
44 workflow_run :
@@ -12,12 +12,11 @@ permissions:
1212
1313env :
1414 TARGET_RUN_ID : ${{ github.event.workflow_run.id }}
15- REPAIR_SCRIPT : ./tests/ci/integration/integration_patch_repair/repair .sh
15+ AUTOFIX_SCRIPT : ./tests/ci/integration/autofix_integration_failures/autofix .sh
1616
1717jobs :
18-
19- get-failing-targets :
20- name : get-failing-targets
18+ get-failing-integrations :
19+ name : get-failing-integrations
2120 if : >-
2221 github.event.workflow_run.event == 'schedule' &&
2322 github.event.workflow_run.conclusion == 'failure'
@@ -36,37 +35,35 @@ jobs:
3635 env :
3736 GH_TOKEN : ${{ github.token }}
3837 run : |
39- set -eo pipefail
40- targets=$("$REPAIR_SCRIPT" get-failing-targets "$TARGET_RUN_ID")
38+ targets=$("$AUTOFIX_SCRIPT" get-failing-targets "$TARGET_RUN_ID")
4139 echo "Targets: $targets"
4240 echo "targets=$targets" >> "$GITHUB_OUTPUT"
4341 - name : Download each failing integration's logs
4442 env :
4543 GH_TOKEN : ${{ github.token }}
4644 TARGETS : ${{ steps.targets.outputs.targets }}
4745 run : |
48- set -eo pipefail
49- echo "$TARGETS" | jq -r '.[]' | while IFS='| ' read -r integration version; do
50- "$REPAIR_SCRIPT " fetch-logs "$TARGET_RUN_ID" "$integration" "$version"
46+ echo "$TARGETS" | jq -r '.[] | "\(.integration)\t\(.version)"' \
47+ | while IFS=$'\t ' read -r integration version; do
48+ "$AUTOFIX_SCRIPT " fetch-logs "$TARGET_RUN_ID" "$integration" "$version"
5149 done
5250 - uses : actions/upload-artifact@v4
5351 if : always()
5452 with :
55- name : patch-repair-logs
56- # Upload the whole tree so the <slug>/logs/ structure is preserved on
57- # download; reason restores it to the same path repair.sh reads from.
58- path : .integration-patch-repair/
53+ name : autofix-logs
54+ # Save the logs folder so the `reason` job find the logs.
55+ path : .autofix/
5956 if-no-files-found : ignore
6057
6158 reason :
62- name : reason (${{ matrix.target }})
63- needs : get-failing-targets
64- if : needs.get-failing-targets .outputs.targets != '[]' && needs.get-failing-targets .outputs.targets != ''
59+ name : reason (${{ matrix.target.dir }})
60+ needs : get-failing-integrations
61+ if : needs.get-failing-integrations .outputs.targets != '[]' && needs.get-failing-integrations .outputs.targets != ''
6562 strategy :
6663 fail-fast : false
6764 max-parallel : 5
6865 matrix :
69- target : ${{ fromJSON(needs.get-failing-targets .outputs.targets) }}
66+ target : ${{ fromJSON(needs.get-failing-integrations .outputs.targets) }}
7067 runs-on :
7168 - codebuild-aws-lc-ci-github-actions-${{ github.run_id }}-${{ github.run_attempt }}
7269 image:linux-5.0
8481 persist-credentials : false
8582 - uses : ./.github/actions/configure-aws-credentials
8683 with :
87- roleName : AwsLcGitHubActionPatchRepairReasoningRole
84+ roleName : AwsLcGitHubActionAutofixReasoningRole
8885 - name : Install Claude Code
8986 run : npm install -g @anthropic-ai/claude-code@2.1.161
9087 - name : Install Bash sandbox deps
@@ -94,43 +91,32 @@ jobs:
9491 - name : Download pre-fetched logs
9592 uses : actions/download-artifact@v4
9693 with :
97- name : patch-repair -logs
98- path : .integration-patch-repair /
94+ name : autofix -logs
95+ path : .autofix /
9996 continue-on-error : true
100- # Turn the target (e.g. "openvpn|release/2.6") into a slug with no | or /
101- # (e.g. "openvpn-release-2.6"), safe for artifact names and matching the
102- # work dir repair.sh writes to.
103- - name : Derive target slug
104- id : slug
105- env :
106- TARGET : ${{ matrix.target }}
107- run : |
108- slug=${TARGET//[|\/]/-}
109- slug=${slug%-}
110- echo "dir=$slug" >> "$GITHUB_OUTPUT"
111- - name : Repair the patch
97+ - name : Autofix the patch
11298 env :
113- TARGET : ${{ matrix.target }}
99+ INTEGRATION : ${{ matrix.target.integration }}
100+ VERSION : ${{ matrix.target.version }}
114101 run : |
115- set -exo pipefail
116- IFS='|' read -r integration version <<< "$TARGET"
117- "$REPAIR_SCRIPT" reason "$TARGET_RUN_ID" "$integration" "$version"
102+ set -x
103+ "$AUTOFIX_SCRIPT" reason "$TARGET_RUN_ID" "$INTEGRATION" "$VERSION"
118104 - uses : actions/upload-artifact@v4
119105 if : always()
120106 with :
121- name : patch-repair- ${{ steps.slug.outputs .dir }}
122- path : .integration-patch-repair /${{ steps.slug.outputs .dir }}/
107+ name : autofix- ${{ matrix.target .dir }}
108+ path : .autofix /${{ matrix.target .dir }}/
123109 if-no-files-found : ignore
124110
125111 upload :
126- name : upload (${{ matrix.target }})
127- needs : [get-failing-targets , reason]
128- if : ${{ always() && needs.get-failing-targets .outputs.targets != '[]' && needs.get-failing-targets .outputs.targets != '' }}
112+ name : upload (${{ matrix.target.dir }})
113+ needs : [get-failing-integrations , reason]
114+ if : ${{ always() && needs.get-failing-integrations .outputs.targets != '[]' && needs.get-failing-integrations .outputs.targets != '' }}
129115 strategy :
130116 fail-fast : false
131117 max-parallel : 5
132118 matrix :
133- target : ${{ fromJSON(needs.get-failing-targets .outputs.targets) }}
119+ target : ${{ fromJSON(needs.get-failing-integrations .outputs.targets) }}
134120 runs-on :
135121 - codebuild-aws-lc-ci-github-actions-${{ github.run_id }}-${{ github.run_attempt }}
136122 image:linux-5.0
@@ -141,26 +127,19 @@ jobs:
141127 persist-credentials : false
142128 - uses : ./.github/actions/configure-aws-credentials
143129 with :
144- roleName : AwsLcGitHubActionPatchRepairUploadRole
145- - name : Derive target slug
146- id : slug
147- env :
148- TARGET : ${{ matrix.target }}
149- run : |
150- slug=${TARGET//[|\/]/-}
151- slug=${slug%-}
152- echo "dir=$slug" >> "$GITHUB_OUTPUT"
130+ roleName : AwsLcGitHubActionAutofixUploadRole
153131 - name : Download results from reason job
154132 uses : actions/download-artifact@v4
155133 with :
156- name : patch-repair- ${{ steps.slug.outputs .dir }}
157- path : .integration-patch-repair /${{ steps.slug.outputs .dir }}/
134+ name : autofix- ${{ matrix.target .dir }}
135+ path : .autofix /${{ matrix.target .dir }}/
158136 continue-on-error : true
159137 - name : Upload results to S3
160138 env :
161- TARGET : ${{ matrix.target }}
139+ INTEGRATION : ${{ matrix.target.integration }}
140+ VERSION : ${{ matrix.target.version }}
162141 run : |
163- set -exo pipefail
164- export PATCH_REPAIR_BUCKET="${AWS_ACCOUNT_ID}-aws-lc-integration-patch-repair"
165- IFS='|' read -r integration version <<< "$TARGET "
166- "$REPAIR_SCRIPT " upload "$TARGET_RUN_ID" "$integration " "$version "
142+ set -x
143+ # Suffix must match S3_FOR_AUTOFIX_INTEGRATION_FAILURES in tests/ci/cdk/util/metadata.py
144+ export AUTOFIX_BUCKET="${AWS_ACCOUNT_ID}-aws-lc-autofix-integration-failures "
145+ "$AUTOFIX_SCRIPT " upload "$TARGET_RUN_ID" "$INTEGRATION " "$VERSION "
0 commit comments