From 249e1580b2a027223629f30302b741f68361d501 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 19:07:50 +0000 Subject: [PATCH 1/3] Initial plan From 582d736689aa73c70576e46dd7f2948fe95399fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 30 Mar 2026 19:11:06 +0000 Subject: [PATCH 2/3] Handle parsing issue: create GitHub issue when MT parse current/next fails Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/71015dd7-7bfb-4eb3-95f7-d2f8f3d5122e Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> --- .../.github/workflows/mt-sync-code-data.yml | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/shared-overwrite/.github/workflows/mt-sync-code-data.yml b/shared-overwrite/.github/workflows/mt-sync-code-data.yml index edd0b2a0..5fb48ff2 100644 --- a/shared-overwrite/.github/workflows/mt-sync-code-data.yml +++ b/shared-overwrite/.github/workflows/mt-sync-code-data.yml @@ -123,15 +123,91 @@ jobs: echo "Schedule files deletion completed."; - name: MT parse current + id: mt-parse-current if: ${{ env.MT_IS_AGENCY_BIKE != 'true' && env.MT_IS_MAIN_REPO != 'true' }} timeout-minutes: 40 run: ./parse_current.sh + - name: MT parse current failed - create issue + if: ${{ failure() && steps.mt-parse-current.outcome == 'failure' }} + run: | + STEP_NAME="MT parse current" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + FAILED_LOGS=$(gh run view ${{ github.run_id }} --log-failed 2>&1 || echo "Failed to fetch logs") + HOW_TO_FIX="Need to update \`config/gtfs/*.json\` if available or \`agency-parser/src/main/java/org/mtransit/parser/*/*AgencyTools.java\` to fix. +Look at [parser](https://github.com/mtransitapps/parser) repository for available options in [\`src/main/java/org/mtransit/parser/config/gtfs/data/*Config.kt\`](https://github.com/mtransitapps/parser/tree/master/src/main/java/org/mtransit/parser/config/gtfs/data) and [\`src/main/java/org/mtransit/parser/DefaultAgencyTools.java\`](https://github.com/mtransitapps/parser/blob/master/src/main/java/org/mtransit/parser/DefaultAgencyTools.java) +Open a **draft** pull request when ready. +Notify \`@mtransitapps/reviewers\` in the pull request comment" + ISSUE_BODY="## ${STEP_NAME} failed + +**Run:** [${STEP_NAME} - ${{ github.run_id }}](${RUN_URL}) +**Raw logs:** ${RUN_URL} (see failed step) + +
+Failed step logs + +\`\`\` +${FAILED_LOGS} +\`\`\` + +
+ +## How to fix + +${HOW_TO_FIX}" + ISSUE_URL=$(gh issue create \ + --title "${STEP_NAME} failed" \ + --type "Bug" \ + --label "bug" \ + --body "${ISSUE_BODY}" \ + --assignee "copilot") + gh issue comment "${ISSUE_URL}" --body "@mtransitapps/reviewers please review" + env: + GH_TOKEN: ${{ secrets.MT_PAT }} + - name: MT parse next + id: mt-parse-next if: ${{ env.MT_IS_AGENCY_BIKE != 'true' && env.MT_IS_MAIN_REPO != 'true' }} timeout-minutes: 40 run: ./parse_next.sh + - name: MT parse next failed - create issue + if: ${{ failure() && steps.mt-parse-next.outcome == 'failure' }} + run: | + STEP_NAME="MT parse next" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + FAILED_LOGS=$(gh run view ${{ github.run_id }} --log-failed 2>&1 || echo "Failed to fetch logs") + HOW_TO_FIX="Need to update \`config/gtfs/*.json\` if available or \`agency-parser/src/main/java/org/mtransit/parser/*/*AgencyTools.java\` to fix. +Look at [parser](https://github.com/mtransitapps/parser) repository for available options in [\`src/main/java/org/mtransit/parser/config/gtfs/data/*Config.kt\`](https://github.com/mtransitapps/parser/tree/master/src/main/java/org/mtransit/parser/config/gtfs/data) and [\`src/main/java/org/mtransit/parser/DefaultAgencyTools.java\`](https://github.com/mtransitapps/parser/blob/master/src/main/java/org/mtransit/parser/DefaultAgencyTools.java) +Open a **draft** pull request when ready. +Notify \`@mtransitapps/reviewers\` in the pull request comment" + ISSUE_BODY="## ${STEP_NAME} failed + +**Run:** [${STEP_NAME} - ${{ github.run_id }}](${RUN_URL}) +**Raw logs:** ${RUN_URL} (see failed step) + +
+Failed step logs + +\`\`\` +${FAILED_LOGS} +\`\`\` + +
+ +## How to fix + +${HOW_TO_FIX}" + ISSUE_URL=$(gh issue create \ + --title "${STEP_NAME} failed" \ + --type "Bug" \ + --label "bug" \ + --body "${ISSUE_BODY}" \ + --assignee "copilot") + gh issue comment "${ISSUE_URL}" --body "@mtransitapps/reviewers please review" + env: + GH_TOKEN: ${{ secrets.MT_PAT }} + - name: MT parse list change if: ${{ env.MT_IS_AGENCY_BIKE != 'true' && env.MT_IS_MAIN_REPO != 'true' }} run: ./parse_list_change.sh From 7b1f85faacfe411804a163706d8e3d82755ab5b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Apr 2026 13:14:21 +0000 Subject: [PATCH 3/3] Extract parse failure issue creation into composite action handle-parse-failure Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/49f4565a-0571-4fbb-b6fe-232d969418f0 Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> --- .../actions/handle-parse-failure/action.yml | 53 +++++++++++++ .../.github/workflows/mt-sync-code-data.yml | 78 +++---------------- 2 files changed, 63 insertions(+), 68 deletions(-) create mode 100644 shared-overwrite/.github/actions/handle-parse-failure/action.yml diff --git a/shared-overwrite/.github/actions/handle-parse-failure/action.yml b/shared-overwrite/.github/actions/handle-parse-failure/action.yml new file mode 100644 index 00000000..0274dccb --- /dev/null +++ b/shared-overwrite/.github/actions/handle-parse-failure/action.yml @@ -0,0 +1,53 @@ +# ORIGINAL FILE: https://github.com/mtransitapps/commons/tree/master/shared-overwrite +name: MT handle parse failure +description: 'Create a GitHub issue when a parse step fails' +inputs: + step-name: + description: "Name of the failed parse step (e.g. 'MT parse current')" + required: true + run-id: + description: "GitHub Actions run ID" + required: true + github-token: + description: "GitHub token with issue creation permissions" + required: true + +runs: + using: "composite" + steps: + - name: MT create issue for failed parse step + shell: bash + run: | + STEP_NAME="${{ inputs.step-name }}" + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ inputs.run-id }}" + FAILED_LOGS=$(gh run view ${{ inputs.run-id }} --log-failed 2>&1 || echo "Failed to fetch logs") + HOW_TO_FIX="Need to update \`config/gtfs/*.json\` if available or \`agency-parser/src/main/java/org/mtransit/parser/*/*AgencyTools.java\` to fix. +Look at [parser](https://github.com/mtransitapps/parser) repository for available options in [\`src/main/java/org/mtransit/parser/config/gtfs/data/*Config.kt\`](https://github.com/mtransitapps/parser/tree/master/src/main/java/org/mtransit/parser/config/gtfs/data) and [\`src/main/java/org/mtransit/parser/DefaultAgencyTools.java\`](https://github.com/mtransitapps/parser/blob/master/src/main/java/org/mtransit/parser/DefaultAgencyTools.java) +Open a **draft** pull request when ready. +Notify \`@mtransitapps/reviewers\` in the pull request comment" + ISSUE_BODY="## ${STEP_NAME} failed + +**Run:** [${STEP_NAME} - ${{ inputs.run-id }}](${RUN_URL}) +**Raw logs:** ${RUN_URL} (see failed step) + +
+Failed step logs + +\`\`\` +${FAILED_LOGS} +\`\`\` + +
+ +## How to fix + +${HOW_TO_FIX}" + ISSUE_URL=$(gh issue create \ + --title "${STEP_NAME} failed" \ + --type "Bug" \ + --label "bug" \ + --body "${ISSUE_BODY}" \ + --assignee "copilot") + gh issue comment "${ISSUE_URL}" --body "@mtransitapps/reviewers please review" + env: + GH_TOKEN: ${{ inputs.github-token }} diff --git a/shared-overwrite/.github/workflows/mt-sync-code-data.yml b/shared-overwrite/.github/workflows/mt-sync-code-data.yml index 5fb48ff2..39e6a08d 100644 --- a/shared-overwrite/.github/workflows/mt-sync-code-data.yml +++ b/shared-overwrite/.github/workflows/mt-sync-code-data.yml @@ -130,40 +130,11 @@ jobs: - name: MT parse current failed - create issue if: ${{ failure() && steps.mt-parse-current.outcome == 'failure' }} - run: | - STEP_NAME="MT parse current" - RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - FAILED_LOGS=$(gh run view ${{ github.run_id }} --log-failed 2>&1 || echo "Failed to fetch logs") - HOW_TO_FIX="Need to update \`config/gtfs/*.json\` if available or \`agency-parser/src/main/java/org/mtransit/parser/*/*AgencyTools.java\` to fix. -Look at [parser](https://github.com/mtransitapps/parser) repository for available options in [\`src/main/java/org/mtransit/parser/config/gtfs/data/*Config.kt\`](https://github.com/mtransitapps/parser/tree/master/src/main/java/org/mtransit/parser/config/gtfs/data) and [\`src/main/java/org/mtransit/parser/DefaultAgencyTools.java\`](https://github.com/mtransitapps/parser/blob/master/src/main/java/org/mtransit/parser/DefaultAgencyTools.java) -Open a **draft** pull request when ready. -Notify \`@mtransitapps/reviewers\` in the pull request comment" - ISSUE_BODY="## ${STEP_NAME} failed - -**Run:** [${STEP_NAME} - ${{ github.run_id }}](${RUN_URL}) -**Raw logs:** ${RUN_URL} (see failed step) - -
-Failed step logs - -\`\`\` -${FAILED_LOGS} -\`\`\` - -
- -## How to fix - -${HOW_TO_FIX}" - ISSUE_URL=$(gh issue create \ - --title "${STEP_NAME} failed" \ - --type "Bug" \ - --label "bug" \ - --body "${ISSUE_BODY}" \ - --assignee "copilot") - gh issue comment "${ISSUE_URL}" --body "@mtransitapps/reviewers please review" - env: - GH_TOKEN: ${{ secrets.MT_PAT }} + uses: ./.github/actions/handle-parse-failure + with: + step-name: "MT parse current" + run-id: ${{ github.run_id }} + github-token: ${{ secrets.MT_PAT }} - name: MT parse next id: mt-parse-next @@ -173,40 +144,11 @@ ${HOW_TO_FIX}" - name: MT parse next failed - create issue if: ${{ failure() && steps.mt-parse-next.outcome == 'failure' }} - run: | - STEP_NAME="MT parse next" - RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - FAILED_LOGS=$(gh run view ${{ github.run_id }} --log-failed 2>&1 || echo "Failed to fetch logs") - HOW_TO_FIX="Need to update \`config/gtfs/*.json\` if available or \`agency-parser/src/main/java/org/mtransit/parser/*/*AgencyTools.java\` to fix. -Look at [parser](https://github.com/mtransitapps/parser) repository for available options in [\`src/main/java/org/mtransit/parser/config/gtfs/data/*Config.kt\`](https://github.com/mtransitapps/parser/tree/master/src/main/java/org/mtransit/parser/config/gtfs/data) and [\`src/main/java/org/mtransit/parser/DefaultAgencyTools.java\`](https://github.com/mtransitapps/parser/blob/master/src/main/java/org/mtransit/parser/DefaultAgencyTools.java) -Open a **draft** pull request when ready. -Notify \`@mtransitapps/reviewers\` in the pull request comment" - ISSUE_BODY="## ${STEP_NAME} failed - -**Run:** [${STEP_NAME} - ${{ github.run_id }}](${RUN_URL}) -**Raw logs:** ${RUN_URL} (see failed step) - -
-Failed step logs - -\`\`\` -${FAILED_LOGS} -\`\`\` - -
- -## How to fix - -${HOW_TO_FIX}" - ISSUE_URL=$(gh issue create \ - --title "${STEP_NAME} failed" \ - --type "Bug" \ - --label "bug" \ - --body "${ISSUE_BODY}" \ - --assignee "copilot") - gh issue comment "${ISSUE_URL}" --body "@mtransitapps/reviewers please review" - env: - GH_TOKEN: ${{ secrets.MT_PAT }} + uses: ./.github/actions/handle-parse-failure + with: + step-name: "MT parse next" + run-id: ${{ github.run_id }} + github-token: ${{ secrets.MT_PAT }} - name: MT parse list change if: ${{ env.MT_IS_AGENCY_BIKE != 'true' && env.MT_IS_MAIN_REPO != 'true' }}