-
-
Notifications
You must be signed in to change notification settings - Fork 826
fix: this improves the way we do opena api diffing #11208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,28 +11,66 @@ on: | |||||
| - .github/workflows/openapi-diff.yaml | ||||||
| workflow_dispatch: | ||||||
| inputs: | ||||||
| stable_version: | ||||||
| description: 'Stable Unleash version to compare against (e.g. unleash-server:6.9.3 or unleash-enterprise:6.10.0)' | ||||||
| required: false | ||||||
| default: 'unleash-server:latest' | ||||||
| baseline_version: | ||||||
| description: 'Stable Unleash version or commit SHA to compare against (e.g. v6.9.3, or a commit SHA).' | ||||||
| required: true | ||||||
|
|
||||||
| jobs: | ||||||
| generate-openapi-stable: | ||||||
| name: Generate OpenAPI (stable) | ||||||
| runs-on: ubuntu-latest | ||||||
| services: | ||||||
| postgres: | ||||||
| image: postgres | ||||||
| env: | ||||||
| POSTGRES_PASSWORD: postgres | ||||||
| POSTGRES_INITDB_ARGS: "--no-sync" | ||||||
| ports: | ||||||
| - 5432:5432 | ||||||
| options: >- | ||||||
| --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||||||
| steps: | ||||||
| - uses: actions/checkout@v6 | ||||||
| with: | ||||||
| fetch-depth: 0 | ||||||
| - name: Determine baseline commit | ||||||
| run: | | ||||||
| if [ "${{ github.event_name }}" = "pull_request" ]; then | ||||||
| git fetch origin "${{ github.event.pull_request.base.ref }}" | ||||||
| BASE_SHA=$(git merge-base "origin/${{ github.event.pull_request.base.ref }}" "${{ github.sha }}") | ||||||
| else | ||||||
| # workflow_dispatch: baseline_version is required | ||||||
| git fetch --tags origin | ||||||
| BASE_SHA=$(git rev-parse "${{ github.event.inputs.baseline_version }}") | ||||||
| fi | ||||||
| echo "BASE_SHA=$BASE_SHA" >> $GITHUB_ENV | ||||||
| - name: Checkout baseline commit | ||||||
| run: git checkout "${BASE_SHA}" | ||||||
| - name: Install node | ||||||
| uses: actions/setup-node@v6 | ||||||
| with: | ||||||
| node-version: 22.x | ||||||
| - name: Install dependencies | ||||||
| run: | | ||||||
| yarn install --immutable | ||||||
|
Comment on lines
+48
to
+55
|
||||||
| - name: Start Unleash test instance | ||||||
| run: | | ||||||
| docker compose -f .github/docker-compose.test.yml up -d --wait -t 90 | ||||||
| # fake frontend build | ||||||
| mkdir frontend/build | ||||||
|
||||||
| mkdir frontend/build | |
| mkdir -p frontend/build |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow will fail if the backend doesn't start successfully. After starting the backend with "&", there's no check to ensure the process actually started. If the backend fails to start, the wait loop will timeout, but there's no cleanup or logging of the backend process output which would help debug failures.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The postgres service image should specify a version tag instead of using the implicit "latest" tag. Using "postgres" without a version tag can lead to unexpected behavior when the latest version changes. Consider pinning to a specific version like "postgres:15" or "postgres:16" to ensure consistent and reproducible builds.