From d9ae4ae4cb1b359d12f00bebfd292b69840ff4fb Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Fri, 13 Feb 2026 22:27:45 -0600 Subject: [PATCH 1/3] ci: add notify-downstream workflow for cascading CI Notifies downstream dependents (meta_cli, meta_git_cli, meta_project_cli, meta_rust_cli) via repository_dispatch when CI passes on main. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/notify-downstream.yml | 110 ++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/notify-downstream.yml diff --git a/.github/workflows/notify-downstream.yml b/.github/workflows/notify-downstream.yml new file mode 100644 index 0000000..cc85f06 --- /dev/null +++ b/.github/workflows/notify-downstream.yml @@ -0,0 +1,110 @@ +name: Notify Downstream + +on: + push: + branches: [main] + +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: + needs: wait-for-ci + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Extract commit info + id: commit + run: | + MSG=$(git log -1 --pretty=%s) + echo "message=$MSG" >> $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 + + - name: Notify meta_cli + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PARENT_REPO_PAT }} + repository: harmony-labs/meta_cli + event-type: dependency-updated + client-payload: | + { + "repo": "${{ github.repository }}", + "repo_name": "${{ github.event.repository.name }}", + "sha": "${{ steps.commit.outputs.sha }}", + "short_sha": "${{ steps.commit.outputs.short_sha }}", + "message": "${{ steps.commit.outputs.message }}", + "type": "${{ steps.commit.outputs.type }}", + "actor": "${{ github.actor }}" + } + + - name: Notify meta_git_cli + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PARENT_REPO_PAT }} + repository: harmony-labs/meta_git_cli + event-type: dependency-updated + client-payload: | + { + "repo": "${{ github.repository }}", + "repo_name": "${{ github.event.repository.name }}", + "sha": "${{ steps.commit.outputs.sha }}", + "short_sha": "${{ steps.commit.outputs.short_sha }}", + "message": "${{ steps.commit.outputs.message }}", + "type": "${{ steps.commit.outputs.type }}", + "actor": "${{ github.actor }}" + } + + - name: Notify meta_project_cli + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PARENT_REPO_PAT }} + repository: harmony-labs/meta_project_cli + event-type: dependency-updated + client-payload: | + { + "repo": "${{ github.repository }}", + "repo_name": "${{ github.event.repository.name }}", + "sha": "${{ steps.commit.outputs.sha }}", + "short_sha": "${{ steps.commit.outputs.short_sha }}", + "message": "${{ steps.commit.outputs.message }}", + "type": "${{ steps.commit.outputs.type }}", + "actor": "${{ github.actor }}" + } + + - name: Notify meta_rust_cli + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PARENT_REPO_PAT }} + repository: harmony-labs/meta_rust_cli + event-type: dependency-updated + client-payload: | + { + "repo": "${{ github.repository }}", + "repo_name": "${{ github.event.repository.name }}", + "sha": "${{ steps.commit.outputs.sha }}", + "short_sha": "${{ steps.commit.outputs.short_sha }}", + "message": "${{ steps.commit.outputs.message }}", + "type": "${{ steps.commit.outputs.type }}", + "actor": "${{ github.actor }}" + } From c43188dfc087b53f6c1a13b1ea7bf29d8e2d3297 Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Fri, 13 Feb 2026 22:53:59 -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) - Use matrix strategy for downstream notifications Co-Authored-By: Claude Opus 4.6 --- .github/workflows/notify-downstream.yml | 95 +++++++------------------ 1 file changed, 25 insertions(+), 70 deletions(-) diff --git a/.github/workflows/notify-downstream.yml b/.github/workflows/notify-downstream.yml index cc85f06..13f8124 100644 --- a/.github/workflows/notify-downstream.yml +++ b/.github/workflows/notify-downstream.yml @@ -9,7 +9,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)' @@ -19,11 +19,17 @@ jobs: notify: needs: wait-for-ci runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + downstream: + - meta_cli + - meta_git_cli + - meta_project_cli + - meta_rust_cli steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Extract commit info id: commit @@ -32,79 +38,28 @@ jobs: echo "message=$MSG" >> $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 - - name: Notify meta_cli - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.PARENT_REPO_PAT }} - repository: harmony-labs/meta_cli - event-type: dependency-updated - client-payload: | - { - "repo": "${{ github.repository }}", - "repo_name": "${{ github.event.repository.name }}", - "sha": "${{ steps.commit.outputs.sha }}", - "short_sha": "${{ steps.commit.outputs.short_sha }}", - "message": "${{ steps.commit.outputs.message }}", - "type": "${{ steps.commit.outputs.type }}", - "actor": "${{ github.actor }}" - } - - - name: Notify meta_git_cli - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.PARENT_REPO_PAT }} - repository: harmony-labs/meta_git_cli - event-type: dependency-updated - client-payload: | - { - "repo": "${{ github.repository }}", - "repo_name": "${{ github.event.repository.name }}", - "sha": "${{ steps.commit.outputs.sha }}", - "short_sha": "${{ steps.commit.outputs.short_sha }}", - "message": "${{ steps.commit.outputs.message }}", - "type": "${{ steps.commit.outputs.type }}", - "actor": "${{ github.actor }}" - } - - - name: Notify meta_project_cli - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.PARENT_REPO_PAT }} - repository: harmony-labs/meta_project_cli - event-type: dependency-updated - client-payload: | - { - "repo": "${{ github.repository }}", - "repo_name": "${{ github.event.repository.name }}", - "sha": "${{ steps.commit.outputs.sha }}", - "short_sha": "${{ steps.commit.outputs.short_sha }}", - "message": "${{ steps.commit.outputs.message }}", - "type": "${{ steps.commit.outputs.type }}", - "actor": "${{ github.actor }}" - } - - - name: Notify meta_rust_cli + - name: Notify ${{ matrix.downstream }} uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.PARENT_REPO_PAT }} - repository: harmony-labs/meta_rust_cli + repository: harmony-labs/${{ matrix.downstream }} event-type: dependency-updated - client-payload: | + client-payload: >- { - "repo": "${{ github.repository }}", - "repo_name": "${{ github.event.repository.name }}", - "sha": "${{ steps.commit.outputs.sha }}", - "short_sha": "${{ steps.commit.outputs.short_sha }}", - "message": "${{ steps.commit.outputs.message }}", - "type": "${{ steps.commit.outputs.type }}", - "actor": "${{ github.actor }}" + "repo": ${{ toJSON(github.repository) }}, + "repo_name": ${{ toJSON(github.event.repository.name) }}, + "sha": ${{ toJSON(steps.commit.outputs.sha) }}, + "short_sha": ${{ toJSON(steps.commit.outputs.short_sha) }}, + "message": ${{ toJSON(steps.commit.outputs.message) }}, + "type": ${{ toJSON(steps.commit.outputs.type) }}, + "actor": ${{ toJSON(github.actor) }} } From 0028c578ba951db45a3a4d0bfb36b49ce91db8d3 Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Fri, 13 Feb 2026 23:05:13 -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 | 18 ++++++++++ .github/workflows/ci.yml | 56 +++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/.github/workflows/auto-format.yml b/.github/workflows/auto-format.yml index 3865df5..c257dbb 100644 --- a/.github/workflows/auto-format.yml +++ b/.github/workflows/auto-format.yml @@ -27,18 +27,35 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref || github.ref_name }} + path: meta_plugin_protocol # Use PAT to trigger downstream workflows; fallback to GITHUB_TOKEN token: ${{ secrets.PARENT_REPO_PAT || github.token }} + - name: Create workspace Cargo.toml + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["meta_plugin_protocol"] + 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: meta_plugin_protocol run: cargo fmt --all - name: Check for changes id: changes + working-directory: meta_plugin_protocol run: | if git diff --quiet; then echo "formatted=false" >> $GITHUB_OUTPUT @@ -48,6 +65,7 @@ jobs: - name: Commit and push if: steps.changes.outputs.formatted == 'true' + working-directory: meta_plugin_protocol 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 00bbb0c..cbfc130 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,14 +20,34 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + path: meta_plugin_protocol + + - name: Create workspace Cargo.toml + shell: bash + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["meta_plugin_protocol"] + 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 - name: Cache Rust uses: Swatinem/rust-cache@v2 + with: + workspaces: meta_plugin_protocol - name: Run tests + working-directory: meta_plugin_protocol run: cargo test --all-features clippy: @@ -36,6 +56,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + path: meta_plugin_protocol + + - name: Create workspace Cargo.toml + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["meta_plugin_protocol"] + 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 @@ -44,8 +80,11 @@ jobs: - name: Cache Rust uses: Swatinem/rust-cache@v2 + with: + workspaces: meta_plugin_protocol - name: Run clippy + working-directory: meta_plugin_protocol run: cargo clippy --all-targets --all-features -- -D warnings format: @@ -54,6 +93,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 + with: + path: meta_plugin_protocol + + - name: Create workspace Cargo.toml + run: | + cat > Cargo.toml << 'EOF' + [workspace] + members = ["meta_plugin_protocol"] + 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 @@ -61,4 +116,5 @@ jobs: components: rustfmt - name: Check formatting + working-directory: meta_plugin_protocol run: cargo fmt --all -- --check