Skip to content

Add fast post-merge gateway integration check#1126

Draft
Tharsanan1 wants to merge 2 commits intowso2:mainfrom
Tharsanan1:codex/gateway-post-merge-it-check
Draft

Add fast post-merge gateway integration check#1126
Tharsanan1 wants to merge 2 commits intowso2:mainfrom
Tharsanan1:codex/gateway-post-merge-it-check

Conversation

@Tharsanan1
Copy link
Contributor

@Tharsanan1 Tharsanan1 commented Feb 13, 2026

Summary

  • add a new post-merge gateway integration workflow triggered on push to main (gateway-related paths)
  • run normal and postgres integration variants in parallel with a matrix
  • add GitHub-native performance optimizations: Go dependency cache, Buildx GHA layer cache, and step-summary duration metrics
  • retain artifact uploads and failure log dump

Makefile updates

  • add optional BUILDX_CACHE_ARGS hook to gateway controller/runtime/builder Makefiles
  • pass cache args through buildx invocations used by integration image builds
  • switch gateway runtime coverage image build to docker buildx build --load for cache compatibility

Notes

  • existing PR workflows are unchanged
  • new workflow can also be run manually with workflow_dispatch

Summary by CodeRabbit

  • New Features

    • Added matrix-driven CI/CD testing with SQLite and PostgreSQL database configurations.
    • Introduced test duration tracking and performance metrics reporting in CI pipelines.
    • Added PostgreSQL preflight verification checks prior to test execution.
  • Improvements

    • Enhanced build caching for faster pipeline execution.
    • Improved failure diagnostics with comprehensive container and log capture on test failures.
    • Optimized multi-architecture build configuration support.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

The pull request restructures GitHub Actions workflows into multi-phase pipelines with matrix-driven testing strategies (SQLite and PostgreSQL), adds Docker image caching and artifact exports, introduces PostgreSQL preflight verification, and enhances timing and debugging capabilities. Makefile changes introduce optional build cache arguments for Docker buildx operations.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Restructuring
.github/workflows/gateway-integration-test.yml, .github/workflows/gateway-post-merge-integration-check.yml
Refactored workflows from single-job to multi-phase pipelines with matrix strategies (SQLite/PostgreSQL or normal/PostgreSQL modes). Added image caching, artifact exports/downloads, PostgreSQL schema verification, test duration tracking, per-matrix artifact naming, and container/log debugging on failure.
Makefile Build Cache Configuration
gateway/gateway-builder/Makefile, gateway/gateway-controller/Makefile, gateway/gateway-runtime/Makefile
Introduced BUILDX_CACHE_ARGS variable to enable optional Docker buildx cache arguments. Updated all relevant docker buildx invocations to include the variable, allowing cache configuration injection at build time.

Sequence Diagram

sequenceDiagram
    participant Developer
    participant GitHub as GitHub Actions
    participant BuildJob as build-images Job
    participant Registry as Image Registry
    participant IntegrationJob as integration-test Job
    participant Postgres as PostgreSQL
    participant Tests as Test Suite

    Developer->>GitHub: Push changes
    GitHub->>BuildJob: Trigger build-images
    BuildJob->>BuildJob: Setup Go + cache
    BuildJob->>BuildJob: Build coverage image<br/>(instrumented)
    BuildJob->>BuildJob: Build mock service image
    BuildJob->>Registry: Export + upload artifacts
    Registry-->>GitHub: Make artifacts reusable

    par SQLite Mode
        GitHub->>IntegrationJob: Run integration-test<br/>(sqlite matrix)
        IntegrationJob->>IntegrationJob: Download images
        IntegrationJob->>IntegrationJob: Load docker images
        IntegrationJob->>Tests: Execute tests
        Tests-->>IntegrationJob: Report results
    and PostgreSQL Mode
        GitHub->>IntegrationJob: Run integration-test<br/>(postgres matrix)
        IntegrationJob->>IntegrationJob: Download images
        IntegrationJob->>Postgres: Verify schema + connections
        Postgres-->>IntegrationJob: Verification OK
        IntegrationJob->>Tests: Execute tests
        Tests-->>IntegrationJob: Report results
    end

    IntegrationJob->>IntegrationJob: Record timing metrics
    IntegrationJob->>GitHub: Upload coverage + reports<br/>(per-matrix naming)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 Hops of joy through workflow trails,
Two-phase pipelines never fail!
Cache and postgres, side by side,
Build the images, test with pride!
Makefile tweaks, so clean and bright,
The gateway runs both day and night! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a clear summary of changes but diverges significantly from the required template structure with missing standard sections. Restructure description to follow the template: add Purpose section with issue links, Goals section, Approach with implementation details, User stories, Documentation section, Automation tests (unit/integration), Security checks, Samples, Related PRs, and Test environment details.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding a fast post-merge gateway integration check workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.github/workflows/gateway-integration-test.yml:
- Line 13: Remove the stale path filter entry
".github/workflows/gateway-integration-test-postgres.yml" from the paths list in
the workflow configuration in gateway-integration-test.yml (or alternatively
restore that missing workflow file if intended); update the paths filter so it
only references existing workflow files and ensure the paths array no longer
contains the exact string
".github/workflows/gateway-integration-test-postgres.yml".

In @.github/workflows/gateway-post-merge-integration-check.yml:
- Line 45: The workflow uses the wrong container name when collecting logs after
`docker compose -p "gateway-it-postgres-verify"`; replace the incorrect
`it-gateway-controller` reference with the actual container name
`gateway-it-postgres-verify-gateway-controller-1` or, better, use `docker
compose -p "$PROJECT" logs gateway-controller` (or `docker logs
gateway-it-postgres-verify-gateway-controller-1`) so the logs file is populated
and the grep won’t fail under set -euo pipefail; also consolidate the two
duplicated "Run integration tests" steps (the identical steps that differ only
by condition) into a single step that contains both conditional logic or a
unified condition to avoid repetition.
🧹 Nitpick comments (3)
.github/workflows/gateway-post-merge-integration-check.yml (2)

60-75: Each matrix job rebuilds all images from scratch — consider reusing the artifact strategy from the PR workflow.

Unlike gateway-integration-test.yml which builds once and shares images via artifact, this workflow rebuilds all coverage + mock images in each matrix leg (normal and postgres). On a post-merge path this doubles the build time. If speed is a goal (as the PR title suggests), consider extracting a build-images job similar to the PR workflow and sharing the tarball.


107-117: Two identical run steps can be collapsed into one unconditional step.

Both the "normal" and "postgres" steps execute the exact same command (COMPOSE_FILE=${{ matrix.compose_file }} make test-integration). The matrix already ensures only one mode runs per job, so the if conditions are redundant.

♻️ Proposed simplification
-      - name: Run integration tests (normal)
-        if: matrix.mode == 'normal'
-        run: |
-          cd gateway
-          COMPOSE_FILE=${{ matrix.compose_file }} make test-integration
-
-      - name: Run integration tests (postgres)
-        if: matrix.mode == 'postgres'
-        run: |
-          cd gateway
-          COMPOSE_FILE=${{ matrix.compose_file }} make test-integration
+      - name: Run integration tests (${{ matrix.mode }})
+        run: |
+          cd gateway
+          COMPOSE_FILE=${{ matrix.compose_file }} make test-integration
.github/workflows/gateway-integration-test.yml (1)

91-93: Minor: mode: sqlite vs suffix: normal naming inconsistency.

The mode is sqlite but the artifact suffix is normal. In the post-merge workflow, the equivalent mode is normal with suffix normal. This inconsistency could cause confusion when correlating artifacts across workflows.

Consider aligning the mode name (normalsqlite or vice versa) across both workflows for consistency.

- "tests/mock-servers/**"
- "samples/sample-service/**"
- ".github/workflows/gateway-integration-test.yml"
- ".github/workflows/gateway-integration-test-postgres.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the referenced workflow file exists
fd "gateway-integration-test-postgres.yml" .github/workflows/

Repository: wso2/api-platform

Length of output: 43


Remove the stale path filter entry for gateway-integration-test-postgres.yml.

The referenced workflow file does not exist, so this path filter will never trigger. Either restore the postgres integration workflow file or remove this entry from the filter.

🤖 Prompt for AI Agents
In @.github/workflows/gateway-integration-test.yml at line 13, Remove the stale
path filter entry ".github/workflows/gateway-integration-test-postgres.yml" from
the paths list in the workflow configuration in gateway-integration-test.yml (or
alternatively restore that missing workflow file if intended); update the paths
filter so it only references existing workflow files and ensure the paths array
no longer contains the exact string
".github/workflows/gateway-integration-test-postgres.yml".

uses: actions/setup-go@v5
with:
go-version: '1.25'
go-version: "1.25"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Go 1.25 release date availability

💡 Result:

  • Go 1.25 release date: August 12, 2025 (Go 1.25.0). [1][2]
  • Availability: Go 1.25 binary installers/archives are available from the official downloads page (go.dev/dl). [1][3]
  • Updates: Go 1.25 has received minor (patch) releases after 1.25.0 (for example Go 1.25.1 on September 3, 2025). [2]

Sources: [1] Go blog announcement, [2] Go release history, [3] Official downloads page.


🏁 Script executed:

cat -n .github/workflows/gateway-post-merge-integration-check.yml

Repository: wso2/api-platform

Length of output: 6880


Fix container name in postgres verification step (line 96).

When docker compose -p "gateway-it-postgres-verify" is used (line 86), the gateway-controller container is named gateway-it-postgres-verify-gateway-controller-1, not it-gateway-controller. Line 96 attempts to read logs from a non-existent container, creating an empty log file. The subsequent grep (line 97) then fails under set -euo pipefail, causing the step to always fail. Use the correct container name: docker logs gateway-it-postgres-verify-gateway-controller-1 or reference the service name via docker compose -p "$PROJECT" logs gateway-controller.

Additionally, the two "Run integration tests" steps (lines 107–118) are identical except for their conditions; consolidate into a single step.

🤖 Prompt for AI Agents
In @.github/workflows/gateway-post-merge-integration-check.yml at line 45, The
workflow uses the wrong container name when collecting logs after `docker
compose -p "gateway-it-postgres-verify"`; replace the incorrect
`it-gateway-controller` reference with the actual container name
`gateway-it-postgres-verify-gateway-controller-1` or, better, use `docker
compose -p "$PROJECT" logs gateway-controller` (or `docker logs
gateway-it-postgres-verify-gateway-controller-1`) so the logs file is populated
and the grep won’t fail under set -euo pipefail; also consolidate the two
duplicated "Run integration tests" steps (the identical steps that differ only
by condition) into a single step that contains both conditional logic or a
unified condition to avoid repetition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why rename?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to run Postgres not in PR, but after PR merge?

@Tharsanan1 Tharsanan1 marked this pull request as draft February 16, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments