From 78f1d12d03535bb265a2f48fccbcd2d0dfbb6f18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 13:11:46 +0000 Subject: [PATCH 1/4] Initial plan From 33d80eeaf39d484b68d0a96ab2696d6d9ee02da4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 13:15:06 +0000 Subject: [PATCH 2/4] feat: support no input_url - exit early when config/input_url is missing Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/efe4ab4b-1cdb-4e16-896f-790d68425cf6 Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> --- shared-opt-dir/agency-parser/download.sh | 5 ++++ .../workflows/mt-check-data-outdated.yml | 24 ++++++++++++++++++- .../.github/workflows/mt-download-data.yml | 24 ++++++++++++++++++- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/shared-opt-dir/agency-parser/download.sh b/shared-opt-dir/agency-parser/download.sh index 9272fc13..5457e2a2 100755 --- a/shared-opt-dir/agency-parser/download.sh +++ b/shared-opt-dir/agency-parser/download.sh @@ -18,6 +18,11 @@ fi ARCHIVE_DIR="${SCRIPT_DIR}/archive"; +if [[ ! -f "$FILE_PATH/input_url" ]]; then + echo ">> No input_url file found. Exiting early."; + exit 0; +fi + URL=`cat $FILE_PATH/input_url`; INPUT_DIR="${SCRIPT_DIR}/input"; mkdir -p "${INPUT_DIR}"; diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index 400ab6d1..1af26c4b 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -10,9 +10,31 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - MT-CHECK-DATA-OUTDATED-JOB: + check-input-url: # if: ${{ env.MT_IS_MAIN_REPO != 'true' && env.MT_IS_AGENCY_BIKE != 'true' }} # can NOT use env here: if: ${{ ! endsWith(github.repository, '/mtransit-for-android') && ! contains(github.repository, '-bike-') }} + name: "Check input_url" + runs-on: ubuntu-latest + outputs: + has_input_url: ${{ steps.check.outputs.has_input_url }} + steps: + - name: MT check out repository code + uses: actions/checkout@v6 + with: + token: ${{ secrets.MT_PAT }} + fetch-depth: 1 + - name: Check if config/input_url file exists + id: check + run: | + if [[ -f "config/input_url" ]]; then + echo "has_input_url=true" >> "$GITHUB_OUTPUT" + else + echo ">> No config/input_url file found. Skipping job." + echo "has_input_url=false" >> "$GITHUB_OUTPUT" + fi + MT-CHECK-DATA-OUTDATED-JOB: + needs: check-input-url + if: ${{ needs.check-input-url.outputs.has_input_url == 'true' }} name: "MT Check Data Outdated" timeout-minutes: 5 runs-on: ubuntu-latest diff --git a/shared-overwrite/.github/workflows/mt-download-data.yml b/shared-overwrite/.github/workflows/mt-download-data.yml index ac504183..a371923d 100644 --- a/shared-overwrite/.github/workflows/mt-download-data.yml +++ b/shared-overwrite/.github/workflows/mt-download-data.yml @@ -28,9 +28,31 @@ env: MT_GIT_COMMIT_ON: ${{ secrets.MT_GIT_COMMIT_ON }} MT_GIT_COMMIT_OFF: ${{ secrets.MT_GIT_COMMIT_OFF }} jobs: - MT-DOWNLOAD-DATA-JOB: + check-input-url: # if: ${{ env.MT_IS_MAIN_REPO != 'true' && env.MT_IS_AGENCY_BIKE != 'true' }} # can NOT use env here: if: ${{ ! endsWith(github.repository, '/mtransit-for-android') && ! contains(github.repository, '-bike-') }} + name: "Check input_url" + runs-on: ubuntu-latest + outputs: + has_input_url: ${{ steps.check.outputs.has_input_url }} + steps: + - name: MT check out repository code + uses: actions/checkout@v6 + with: + token: ${{ secrets.MT_PAT }} + fetch-depth: 1 + - name: Check if config/input_url file exists + id: check + run: | + if [[ -f "config/input_url" ]]; then + echo "has_input_url=true" >> "$GITHUB_OUTPUT" + else + echo ">> No config/input_url file found. Skipping job." + echo "has_input_url=false" >> "$GITHUB_OUTPUT" + fi + MT-DOWNLOAD-DATA-JOB: + needs: check-input-url + if: ${{ needs.check-input-url.outputs.has_input_url == 'true' }} name: "MT Download Data" timeout-minutes: 30 runs-on: ubuntu-latest From 5ee00648451c3f4a0bb5cccd01b86fd4c72191fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 13:45:01 +0000 Subject: [PATCH 3/4] refactor: inline input_url check as a step instead of a separate job Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/4b8a4605-4d12-47fd-abdf-3b06fe49e12f Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> --- .../workflows/mt-check-data-outdated.yml | 29 +++++---------- .../.github/workflows/mt-download-data.yml | 35 ++++++++----------- 2 files changed, 23 insertions(+), 41 deletions(-) diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index 1af26c4b..8476a9f1 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -10,42 +10,31 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - check-input-url: + MT-CHECK-DATA-OUTDATED-JOB: # if: ${{ env.MT_IS_MAIN_REPO != 'true' && env.MT_IS_AGENCY_BIKE != 'true' }} # can NOT use env here: if: ${{ ! endsWith(github.repository, '/mtransit-for-android') && ! contains(github.repository, '-bike-') }} - name: "Check input_url" + name: "MT Check Data Outdated" + timeout-minutes: 5 runs-on: ubuntu-latest - outputs: - has_input_url: ${{ steps.check.outputs.has_input_url }} steps: - - name: MT check out repository code + - name: MT check out main repository code uses: actions/checkout@v6 with: token: ${{ secrets.MT_PAT }} - fetch-depth: 1 + fetch-depth: 1 # shallow clone - only latest commit needed + - name: Check if config/input_url file exists - id: check + id: check-input-url run: | if [[ -f "config/input_url" ]]; then echo "has_input_url=true" >> "$GITHUB_OUTPUT" else - echo ">> No config/input_url file found. Skipping job." + echo ">> No config/input_url file found. Skipping remaining steps." echo "has_input_url=false" >> "$GITHUB_OUTPUT" fi - MT-CHECK-DATA-OUTDATED-JOB: - needs: check-input-url - if: ${{ needs.check-input-url.outputs.has_input_url == 'true' }} - name: "MT Check Data Outdated" - timeout-minutes: 5 - runs-on: ubuntu-latest - steps: - - name: MT check out main repository code - uses: actions/checkout@v6 - with: - token: ${{ secrets.MT_PAT }} - fetch-depth: 1 # shallow clone - only latest commit needed - name: MT check if data is outdated & trigger download + if: steps.check-input-url.outputs.has_input_url == 'true' continue-on-error: true run: | echo ">> Checking if data is outdated..." diff --git a/shared-overwrite/.github/workflows/mt-download-data.yml b/shared-overwrite/.github/workflows/mt-download-data.yml index a371923d..03914035 100644 --- a/shared-overwrite/.github/workflows/mt-download-data.yml +++ b/shared-overwrite/.github/workflows/mt-download-data.yml @@ -28,59 +28,52 @@ env: MT_GIT_COMMIT_ON: ${{ secrets.MT_GIT_COMMIT_ON }} MT_GIT_COMMIT_OFF: ${{ secrets.MT_GIT_COMMIT_OFF }} jobs: - check-input-url: + MT-DOWNLOAD-DATA-JOB: # if: ${{ env.MT_IS_MAIN_REPO != 'true' && env.MT_IS_AGENCY_BIKE != 'true' }} # can NOT use env here: if: ${{ ! endsWith(github.repository, '/mtransit-for-android') && ! contains(github.repository, '-bike-') }} - name: "Check input_url" + name: "MT Download Data" + timeout-minutes: 30 runs-on: ubuntu-latest - outputs: - has_input_url: ${{ steps.check.outputs.has_input_url }} steps: - - name: MT check out repository code + - name: MT check out main repository code (with submodules) uses: actions/checkout@v6 with: + submodules: true # required to set right token token: ${{ secrets.MT_PAT }} - fetch-depth: 1 + fetch-depth: 0 # fetch all (not required util release build) + - name: Check if config/input_url file exists - id: check + id: check-input-url run: | if [[ -f "config/input_url" ]]; then echo "has_input_url=true" >> "$GITHUB_OUTPUT" else - echo ">> No config/input_url file found. Skipping job." + echo ">> No config/input_url file found. Skipping remaining steps." echo "has_input_url=false" >> "$GITHUB_OUTPUT" fi - MT-DOWNLOAD-DATA-JOB: - needs: check-input-url - if: ${{ needs.check-input-url.outputs.has_input_url == 'true' }} - name: "MT Download Data" - timeout-minutes: 30 - runs-on: ubuntu-latest - steps: - - name: MT check out main repository code (with submodules) - uses: actions/checkout@v6 - with: - submodules: true # required to set right token - token: ${{ secrets.MT_PAT }} - fetch-depth: 0 # fetch all (not required util release build) - name: MT setup + if: steps.check-input-url.outputs.has_input_url == 'true' id: mt-setup uses: ./.github/actions/setup with: code-sync: ${{ github.ref == format('refs/heads/{0}', env.MT_DEFAULT_BRANCH_NAME) }} - name: MT commit code change + if: steps.check-input-url.outputs.has_input_url == 'true' run: ./commit_code_change.sh - name: MT download data (& archive) + if: steps.check-input-url.outputs.has_input_url == 'true' run: ./agency-parser/download.sh timeout-minutes: 20 - name: MT push commits + if: steps.check-input-url.outputs.has_input_url == 'true' run: ./push_commits.sh - name: MT check if data is outdated or new data downloaded & trigger sync + if: steps.check-input-url.outputs.has_input_url == 'true' continue-on-error: true run: | if [[ "${MT_SKIP_PUSH_COMMIT}" != false ]] && ./agency-parser/check_data_outdated.sh; then From 1a70f016e580b34bbdfc5af6dc9d115637a27cc1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 14:20:42 +0000 Subject: [PATCH 4/4] fix: also check app-android/config/input_url for OLD REPO structure Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/620ae14d-6afa-4fc2-98ed-2b4ae29655e6 Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> --- shared-overwrite/.github/workflows/mt-check-data-outdated.yml | 4 ++-- shared-overwrite/.github/workflows/mt-download-data.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index 8476a9f1..64828491 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -26,10 +26,10 @@ jobs: - name: Check if config/input_url file exists id: check-input-url run: | - if [[ -f "config/input_url" ]]; then + if [[ -f "config/input_url" || -f "app-android/config/input_url" ]]; then echo "has_input_url=true" >> "$GITHUB_OUTPUT" else - echo ">> No config/input_url file found. Skipping remaining steps." + echo ">> No input_url file found. Skipping remaining steps." echo "has_input_url=false" >> "$GITHUB_OUTPUT" fi diff --git a/shared-overwrite/.github/workflows/mt-download-data.yml b/shared-overwrite/.github/workflows/mt-download-data.yml index 03914035..2f850e09 100644 --- a/shared-overwrite/.github/workflows/mt-download-data.yml +++ b/shared-overwrite/.github/workflows/mt-download-data.yml @@ -45,10 +45,10 @@ jobs: - name: Check if config/input_url file exists id: check-input-url run: | - if [[ -f "config/input_url" ]]; then + if [[ -f "config/input_url" || -f "app-android/config/input_url" ]]; then echo "has_input_url=true" >> "$GITHUB_OUTPUT" else - echo ">> No config/input_url file found. Skipping remaining steps." + echo ">> No input_url file found. Skipping remaining steps." echo "has_input_url=false" >> "$GITHUB_OUTPUT" fi