From 2d5a42e593066ce34478358acf08cc0b2dec399b Mon Sep 17 00:00:00 2001 From: lucarlig Date: Tue, 1 Sep 2026 13:43:24 +0100 Subject: [PATCH 1/4] perf: cache conformance image builds Signed-off-by: lucarlig --- .dockerignore | 2 ++ .github/workflows/conformance.yml | 4 ++-- docker/Dockerfile | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 694eafc1..f0682c02 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,6 @@ target/ +.git/ +.integration/ .cache/ assets/ resources/ diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 6bae224b..fe1fa524 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -54,8 +54,8 @@ jobs: with: tool: cargo-binstall - - name: Install cf-integration 0.2.0 binary - run: cargo binstall cf-integration@0.2.0 --no-confirm + - name: Install cf-integration 0.2.1 binary + run: cargo binstall cf-integration@0.2.1 --no-confirm - name: Prepare the exact data-plane image env: diff --git a/docker/Dockerfile b/docker/Dockerfile index 7f8a9b6f..6005f0ab 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,7 +12,10 @@ RUN --mount=type=cache,id=cargo,target=/usr/local/cargo/registry,sharing=locked cargo fetch --locked RUN --mount=type=cache,id=cargo,target=/usr/local/cargo/registry,sharing=locked \ --mount=type=cache,id=cargo-git,target=/usr/local/cargo/git,sharing=locked \ - cargo build --release --features "contextforge-data-plane-lib/with_tools contextforge-data-plane/plugins" + --mount=type=cache,id=contextforge-data-plane-target,target=/app/target,sharing=locked \ + cargo build --release --features "contextforge-data-plane-lib/with_tools contextforge-data-plane/plugins" \ + && mkdir -p /out \ + && cp /app/target/release/contextforge-data-plane /out/contextforge-data-plane FROM debian:trixie-slim AS runtime RUN < Date: Tue, 1 Sep 2026 14:10:04 +0100 Subject: [PATCH 2/4] fix: make conformance feedback best effort Signed-off-by: lucarlig --- .github/workflows/conformance.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index fe1fa524..c6b03054 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -1,5 +1,5 @@ name: Conformance -run-name: Conformance for PR #${{ github.event.issue.number }} +run-name: "Conformance for PR #${{ github.event.issue.number }}" on: issue_comment: @@ -25,9 +25,11 @@ jobs: contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) permissions: issues: write + pull-requests: write runs-on: ubuntu-latest steps: - name: Acknowledge the command + continue-on-error: true env: COMMENT_ID: ${{ github.event.comment.id }} GH_TOKEN: ${{ github.token }} @@ -98,9 +100,11 @@ jobs: needs: conformance permissions: issues: write + pull-requests: write runs-on: ubuntu-latest steps: - name: Report the result + continue-on-error: true env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.issue.number }} From e883f78b6233ee6caec8a1e93b3cb6f3de6464fe Mon Sep 17 00:00:00 2001 From: lucarlig Date: Tue, 1 Sep 2026 14:38:53 +0100 Subject: [PATCH 3/4] fix: publish comment-triggered conformance status Signed-off-by: lucarlig --- .github/workflows/conformance.yml | 67 +++++++++++++++++++------------ 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index c6b03054..63ed2fa2 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -18,27 +18,48 @@ env: jobs: acknowledge: - name: acknowledge command + name: mark conformance pending if: >- github.event.issue.pull_request && github.event.comment.body == '/conformance' && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) + outputs: + head_sha: ${{ steps.revision.outputs.head_sha }} + merge_sha: ${{ steps.revision.outputs.merge_sha }} permissions: - issues: write - pull-requests: write + pull-requests: read + statuses: write runs-on: ubuntu-latest steps: - - name: Acknowledge the command - continue-on-error: true + - name: Resolve the exact PR revision + id: revision env: - COMMENT_ID: ${{ github.event.comment.id }} GH_TOKEN: ${{ github.token }} + PR_NUMBER: ${{ github.event.issue.number }} REPOSITORY: ${{ github.repository }} - run: gh api --method POST "repos/$REPOSITORY/issues/comments/$COMMENT_ID/reactions" -f content=eyes + run: >- + gh api "repos/$REPOSITORY/pulls/$PR_NUMBER" + --jq '"head_sha=\(.head.sha)\nmerge_sha=\(.merge_commit_sha)"' + >> "$GITHUB_OUTPUT" + + - name: Publish the pending PR status + env: + GH_TOKEN: ${{ github.token }} + HEAD_SHA: ${{ steps.revision.outputs.head_sha }} + REPOSITORY: ${{ github.repository }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: >- + gh api --method POST "repos/$REPOSITORY/statuses/$HEAD_SHA" + -f state=pending + -f context=conformance + -f description='Conformance is running' + -f target_url="$RUN_URL" conformance: name: conformance + needs: acknowledge if: >- + always() && github.event.issue.pull_request && github.event.comment.body == '/conformance' && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) @@ -50,7 +71,7 @@ jobs: with: fetch-depth: 0 persist-credentials: false - ref: refs/pull/${{ github.event.issue.number }}/merge + ref: ${{ needs.acknowledge.outputs.merge_sha }} - uses: taiki-e/install-action@v2.75.27 with: @@ -93,30 +114,26 @@ jobs: retention-days: 7 report: - name: report conformance result + name: publish conformance result if: >- always() && needs.conformance.result != 'skipped' - needs: conformance + needs: [acknowledge, conformance] permissions: - issues: write - pull-requests: write + statuses: write runs-on: ubuntu-latest steps: - - name: Report the result - continue-on-error: true + - name: Publish the final PR status env: + DESCRIPTION: Conformance ${{ needs.conformance.result }} GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ github.event.issue.number }} + HEAD_SHA: ${{ needs.acknowledge.outputs.head_sha }} REPOSITORY: ${{ github.repository }} - RESULT: ${{ needs.conformance.result }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: | - case "$RESULT" in - success) marker="✅" ;; - failure) marker="❌" ;; - cancelled) marker="⚪" ;; - *) marker="⚠️" ;; - esac - body="$marker Conformance **$RESULT** — [view workflow run]($RUN_URL)." - gh api --method POST "repos/$REPOSITORY/issues/$PR_NUMBER/comments" -f body="$body" + STATE: ${{ needs.conformance.result == 'success' && 'success' || needs.conformance.result == 'failure' && 'failure' || 'error' }} + run: >- + gh api --method POST "repos/$REPOSITORY/statuses/$HEAD_SHA" + -f state="$STATE" + -f context=conformance + -f description="$DESCRIPTION" + -f target_url="$RUN_URL" From 8018c1e399b7ea9334b2ed5dd87fdc9dd1fe2b5a Mon Sep 17 00:00:00 2001 From: lucarlig Date: Tue, 1 Sep 2026 15:10:18 +0100 Subject: [PATCH 4/4] ci: simplify comment-triggered conformance Signed-off-by: lucarlig --- .github/workflows/conformance.yml | 57 ++++++------------------------- 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 63ed2fa2..98218502 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -5,10 +5,6 @@ on: issue_comment: types: [created] -permissions: - actions: read - contents: read - concurrency: group: conformance-pr-${{ github.event.issue.number }} cancel-in-progress: true @@ -17,19 +13,19 @@ env: CARGO_TERM_COLOR: always jobs: - acknowledge: - name: mark conformance pending + conformance: + name: conformance if: >- github.event.issue.pull_request && github.event.comment.body == '/conformance' && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) - outputs: - head_sha: ${{ steps.revision.outputs.head_sha }} - merge_sha: ${{ steps.revision.outputs.merge_sha }} permissions: + actions: read + contents: read pull-requests: read statuses: write runs-on: ubuntu-latest + timeout-minutes: 60 steps: - name: Resolve the exact PR revision id: revision @@ -55,23 +51,12 @@ jobs: -f description='Conformance is running' -f target_url="$RUN_URL" - conformance: - name: conformance - needs: acknowledge - if: >- - always() && - github.event.issue.pull_request && - github.event.comment.body == '/conformance' && - contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - name: Check out data plane uses: actions/checkout@v6.0.2 with: fetch-depth: 0 persist-credentials: false - ref: ${{ needs.acknowledge.outputs.merge_sha }} + ref: ${{ steps.revision.outputs.merge_sha }} - uses: taiki-e/install-action@v2.75.27 with: @@ -95,42 +80,22 @@ jobs: node-version: 22 - name: Run strict modern conformance + id: conformance env: CF_DATAPLANE_IMAGE: contextforge-data-plane:conformance CF_DATAPLANE_PULL_POLICY: never CF_DATAPLANE_REF: "" run: make conformance - - name: Upload conformance diagnostics - if: failure() - uses: actions/upload-artifact@v7.0.1 - with: - name: conformance-diagnostics-${{ github.run_id }}-${{ github.run_attempt }} - path: | - .integration/conformance/ - .integration/reports/ - if-no-files-found: warn - include-hidden-files: true - retention-days: 7 - - report: - name: publish conformance result - if: >- - always() && - needs.conformance.result != 'skipped' - needs: [acknowledge, conformance] - permissions: - statuses: write - runs-on: ubuntu-latest - steps: - name: Publish the final PR status + if: always() && steps.revision.outputs.head_sha != '' env: - DESCRIPTION: Conformance ${{ needs.conformance.result }} + DESCRIPTION: Conformance ${{ job.status }} GH_TOKEN: ${{ github.token }} - HEAD_SHA: ${{ needs.acknowledge.outputs.head_sha }} + HEAD_SHA: ${{ steps.revision.outputs.head_sha }} REPOSITORY: ${{ github.repository }} RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - STATE: ${{ needs.conformance.result == 'success' && 'success' || needs.conformance.result == 'failure' && 'failure' || 'error' }} + STATE: ${{ job.status == 'success' && 'success' || job.status == 'failure' && 'failure' || 'error' }} run: >- gh api --method POST "repos/$REPOSITORY/statuses/$HEAD_SHA" -f state="$STATE"