From f4795909543cc10b9e9406e76a2535b457181a42 Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Fri, 13 Feb 2026 22:27:55 -0600 Subject: [PATCH 1/3] ci: add cascading notification support - Add repository_dispatch trigger to CI for upstream dependency updates - Add notify-parent.yml to notify meta when CI passes (on push or cascade) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 2 + .github/workflows/notify-parent.yml | 73 +++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/notify-parent.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd85722..cf56eed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,8 @@ on: branches: [main] pull_request: branches: [main] + repository_dispatch: + types: [dependency-updated] env: CARGO_TERM_COLOR: always diff --git a/.github/workflows/notify-parent.yml b/.github/workflows/notify-parent.yml new file mode 100644 index 0000000..aa20e96 --- /dev/null +++ b/.github/workflows/notify-parent.yml @@ -0,0 +1,73 @@ +name: Notify Parent Repo + +on: + push: + branches: [main] + repository_dispatch: + types: [dependency-updated] + +jobs: + wait-for-ci: + runs-on: ubuntu-latest + steps: + - name: Wait for CI + uses: lewagon/wait-on-check-action@v1.3.4 + with: + ref: ${{ github.sha }} + check-name: 'Test (ubuntu-latest)' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 10 + + notify-parent: + needs: wait-for-ci + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Determine source + id: source + run: | + if [ "${{ github.event_name }}" = "repository_dispatch" ]; then + echo "repo=${{ github.event.client_payload.repo }}" >> $GITHUB_OUTPUT + echo "repo_name=${{ github.event.client_payload.repo_name }}" >> $GITHUB_OUTPUT + echo "sha=${{ github.event.client_payload.sha }}" >> $GITHUB_OUTPUT + echo "short_sha=${{ github.event.client_payload.short_sha }}" >> $GITHUB_OUTPUT + echo "message=${{ github.event.client_payload.message }}" >> $GITHUB_OUTPUT + echo "type=${{ github.event.client_payload.type }}" >> $GITHUB_OUTPUT + echo "actor=${{ github.event.client_payload.actor }}" >> $GITHUB_OUTPUT + else + MSG=$(git log -1 --pretty=%s) + echo "message=$MSG" >> $GITHUB_OUTPUT + echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT + echo "repo_name=${{ github.event.repository.name }}" >> $GITHUB_OUTPUT + echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + if [[ "$MSG" =~ ^feat ]]; then echo "type=feat" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^fix ]]; then echo "type=fix" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^chore ]]; then echo "type=chore" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^docs ]]; then echo "type=docs" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^test ]]; then echo "type=test" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^refactor ]]; then echo "type=refactor" >> $GITHUB_OUTPUT + else echo "type=other" >> $GITHUB_OUTPUT + fi + fi + + - name: Notify parent repo + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PARENT_REPO_PAT }} + repository: harmony-labs/meta + event-type: child-repo-updated + client-payload: | + { + "repo": "${{ steps.source.outputs.repo }}", + "repo_name": "${{ steps.source.outputs.repo_name }}", + "sha": "${{ steps.source.outputs.sha }}", + "short_sha": "${{ steps.source.outputs.short_sha }}", + "message": "${{ steps.source.outputs.message }}", + "type": "${{ steps.source.outputs.type }}", + "actor": "${{ steps.source.outputs.actor }}" + } From f1ae78a1eac2dcbeb79ede71a4aca1c415db207f Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Fri, 13 Feb 2026 22:54:12 -0600 Subject: [PATCH 2/3] fix: address code review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update lewagon/wait-on-check-action v1.3.4 → v1.5.0 - Use toJSON() in client-payload to prevent JSON injection - Tighten commit type regex (^feat → ^feat[:(]) - Use shallow clone (remove fetch-depth: 0) - Add missing actor output in push event path Co-Authored-By: Claude Opus 4.6 --- .github/workflows/notify-parent.yml | 33 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/notify-parent.yml b/.github/workflows/notify-parent.yml index aa20e96..d551942 100644 --- a/.github/workflows/notify-parent.yml +++ b/.github/workflows/notify-parent.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Wait for CI - uses: lewagon/wait-on-check-action@v1.3.4 + uses: lewagon/wait-on-check-action@v1.5.0 with: ref: ${{ github.sha }} check-name: 'Test (ubuntu-latest)' @@ -24,8 +24,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Determine source id: source @@ -43,14 +41,15 @@ jobs: echo "message=$MSG" >> $GITHUB_OUTPUT echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT echo "repo_name=${{ github.event.repository.name }}" >> $GITHUB_OUTPUT + echo "actor=${{ github.actor }}" >> $GITHUB_OUTPUT echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - if [[ "$MSG" =~ ^feat ]]; then echo "type=feat" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^fix ]]; then echo "type=fix" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^chore ]]; then echo "type=chore" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^docs ]]; then echo "type=docs" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^test ]]; then echo "type=test" >> $GITHUB_OUTPUT - elif [[ "$MSG" =~ ^refactor ]]; then echo "type=refactor" >> $GITHUB_OUTPUT + if [[ "$MSG" =~ ^feat[:(] ]]; then echo "type=feat" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^fix[:(] ]]; then echo "type=fix" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^chore[:(] ]]; then echo "type=chore" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^docs[:(] ]]; then echo "type=docs" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^test[:(] ]]; then echo "type=test" >> $GITHUB_OUTPUT + elif [[ "$MSG" =~ ^refactor[:(] ]]; then echo "type=refactor" >> $GITHUB_OUTPUT else echo "type=other" >> $GITHUB_OUTPUT fi fi @@ -61,13 +60,13 @@ jobs: token: ${{ secrets.PARENT_REPO_PAT }} repository: harmony-labs/meta event-type: child-repo-updated - client-payload: | + client-payload: >- { - "repo": "${{ steps.source.outputs.repo }}", - "repo_name": "${{ steps.source.outputs.repo_name }}", - "sha": "${{ steps.source.outputs.sha }}", - "short_sha": "${{ steps.source.outputs.short_sha }}", - "message": "${{ steps.source.outputs.message }}", - "type": "${{ steps.source.outputs.type }}", - "actor": "${{ steps.source.outputs.actor }}" + "repo": ${{ toJSON(steps.source.outputs.repo) }}, + "repo_name": ${{ toJSON(steps.source.outputs.repo_name) }}, + "sha": ${{ toJSON(steps.source.outputs.sha) }}, + "short_sha": ${{ toJSON(steps.source.outputs.short_sha) }}, + "message": ${{ toJSON(steps.source.outputs.message) }}, + "type": ${{ toJSON(steps.source.outputs.type) }}, + "actor": ${{ toJSON(steps.source.outputs.actor) }} } From 4eb33c9d2d62cfaf7e6aa304ea3dcb744b9d310e Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Fri, 13 Feb 2026 23:05:14 -0600 Subject: [PATCH 3/3] fix(ci): add workspace Cargo.toml for workspace inheritance The Cargo.toml uses edition.workspace, version.workspace, etc. but CI had no workspace root, causing all builds to fail since the config refactoring. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/auto-format.yml | 22 ++++++++++++++ .github/workflows/ci.yml | 50 +++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/.github/workflows/auto-format.yml b/.github/workflows/auto-format.yml index 3865df5..88052e4 100644 --- a/.github/workflows/auto-format.yml +++ b/.github/workflows/auto-format.yml @@ -27,18 +27,39 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref || github.ref_name }} + path: loop_cli # Use PAT to trigger downstream workflows; fallback to GITHUB_TOKEN token: ${{ secrets.PARENT_REPO_PAT || github.token }} + - name: Clone dependencies + run: | + git clone --depth 1 https://github.com/harmony-labs/loop_lib.git + + - name: Create workspace Cargo.toml + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["loop_cli", "loop_lib"] + resolver = "2" + + [workspace.package] + version = "0.1.0" + edition = "2021" + license = "MIT" + repository = "https://github.com/harmony-labs/meta" + EOF + - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - name: Run cargo fmt + working-directory: loop_cli run: cargo fmt --all - name: Check for changes id: changes + working-directory: loop_cli run: | if git diff --quiet; then echo "formatted=false" >> $GITHUB_OUTPUT @@ -48,6 +69,7 @@ jobs: - name: Commit and push if: steps.changes.outputs.formatted == 'true' + working-directory: loop_cli run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf56eed..2e0abdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,21 @@ jobs: run: | git clone --depth 1 https://github.com/harmony-labs/loop_lib.git + - name: Create workspace Cargo.toml + shell: bash + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["loop_cli", "loop_lib"] + resolver = "2" + + [workspace.package] + version = "0.1.0" + edition = "2021" + license = "MIT" + repository = "https://github.com/harmony-labs/meta" + EOF + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -55,6 +70,20 @@ jobs: run: | git clone --depth 1 https://github.com/harmony-labs/loop_lib.git + - name: Create workspace Cargo.toml + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["loop_cli", "loop_lib"] + resolver = "2" + + [workspace.package] + version = "0.1.0" + edition = "2021" + license = "MIT" + repository = "https://github.com/harmony-labs/meta" + EOF + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable with: @@ -75,6 +104,26 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + path: loop_cli + + - name: Clone dependencies + run: | + git clone --depth 1 https://github.com/harmony-labs/loop_lib.git + + - name: Create workspace Cargo.toml + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["loop_cli", "loop_lib"] + resolver = "2" + + [workspace.package] + version = "0.1.0" + edition = "2021" + license = "MIT" + repository = "https://github.com/harmony-labs/meta" + EOF - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -82,4 +131,5 @@ jobs: components: rustfmt - name: Check formatting + working-directory: loop_cli run: cargo fmt --all -- --check