Skip to content

HYPERFLEET-1024 - feat: CI for schema checks, version bump, externalize as Go module#42

Open
mliptak0 wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
mliptak0:HYPERFLEET-1024
Open

HYPERFLEET-1024 - feat: CI for schema checks, version bump, externalize as Go module#42
mliptak0 wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
mliptak0:HYPERFLEET-1024

Conversation

@mliptak0
Copy link
Copy Markdown
Contributor

@mliptak0 mliptak0 commented May 7, 2026

Summary

Added CI workflow (ci.yml) that runs on every PR and push to main: rebuilds all four schemas from TypeSpec, checks consistency against committed files, lints both openapi.yaml files with spectral:oas, and enforces a version bump against the latest release tag.

Replaced manual release process with automated release.yml that triggers on push to main, extracts version from main.tsp, auto-creates an annotated tag, and publishes a GitHub Release with all four artifacts attached (core-openapi.yaml, core-swagger.yaml, gcp-openapi.yaml, gcp-swagger.yaml).

Added go.mod and schemas/schemas.go exposing all generated schemas via //go:embed as embed.FS, enabling downstream Go consumers to import versioned schemas as a module dependency without vendoring local copies.

Added .spectral.yaml with spectral:oas ruleset. Fix Error.instance field format from uri to uri-reference per RFC 7807. Bump actions/checkout and actions/setup-node to v6.

Update CHANGELOG.md

Test Plan

  • Unit tests added/updated
  • make test-all passes
  • make lint passes
  • Helm chart changes validated with make test-helm (if applicable)
  • Deployed to a development cluster and verified (if Helm/config changes)
  • E2E tests passed (if cross-component or major changes)

Summary by CodeRabbit

  • New Features

    • Automated release pipeline with semantic versioning extraction.
    • Go module support for consuming generated schemas as embedded files.
    • OpenAPI linting validation via Spectral.
  • Bug Fixes

    • Error schema format updated for RFC 9457 compliance.
  • Documentation

    • Updated release and development setup guides.
    • Added specification update workflow documentation.
  • Chores

    • Version bumped to 1.0.11.
    • Expanded schema builds to include multiple output formats for core and GCP.

@openshift-ci openshift-ci Bot requested review from crizzo71 and vkareh May 7, 2026 08:00
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 7, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign vkareh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Walkthrough

This pull request releases v1.0.11 of the HyperFleet API specification with infrastructure and distribution improvements. The changes introduce automated GitHub Actions workflows for continuous integration (schema validation and linting via Spectral) and release automation (version extraction, tagging, and multi-artifact publishing). The build system is updated to use a locally installed TypeSpec compiler from node_modules/.bin/ rather than a global installation. Schema format compliance is improved by changing the Error.instance field constraint from uri to uri-reference (RFC 9457). Documentation is comprehensively revised to reflect the new automation, and a Go module is introduced to distribute generated OpenAPI/Swagger schemas as embedded files for downstream consumption. Configuration files are updated to enable Spectral linting with the OAS ruleset, and the build scripts are adjusted accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the three main changes: CI workflow additions, version bump enforcement, and Go module externalization of schemas.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@mliptak0 mliptak0 force-pushed the HYPERFLEET-1024 branch from a44fe19 to 94f150f Compare May 7, 2026 08:04
@mliptak0 mliptak0 marked this pull request as draft May 7, 2026 08:18
@mliptak0 mliptak0 force-pushed the HYPERFLEET-1024 branch from e624282 to 8c877b6 Compare May 7, 2026 12:43
@mliptak0 mliptak0 force-pushed the HYPERFLEET-1024 branch from 8c877b6 to 6a17bb6 Compare May 7, 2026 12:58
@mliptak0 mliptak0 marked this pull request as ready for review May 7, 2026 13:48
@openshift-ci openshift-ci Bot requested a review from pnguyen44 May 7, 2026 13:48
Copy link
Copy Markdown

@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: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 53-63: The version check currently does only string equality on
CURRENT and LATEST and doesn't guard empty values; update the CI step to first
fail if either CURRENT (from main.tsp) or LATEST is empty, then perform a
semver-aware comparison (e.g. using sort -V) to ensure CURRENT is strictly
greater than LATEST — reference the CURRENT and LATEST variables and replace the
equality check block with: 1) empty-value guard for CURRENT and LATEST, 2)
semver comparison that fails if the sorted highest version is not CURRENT, and
3) keep the existing messages but return non-zero on equal or downgraded
versions.

In @.github/workflows/release.yml:
- Around line 28-33: The "Extract version" step sets VERSION from main.tsp but
doesn't guard against an empty result, which yields a malformed tag "v"; update
the step to validate VERSION after extraction (the shell variable VERSION used
in the step) and if it's empty, print a clear error to stderr and exit with
non-zero status so the workflow fails instead of creating a "v" tag, or
alternatively conditionally set the "tag" output only when VERSION is non-empty;
ensure the outputs "version" and "tag" are only written to GITHUB_OUTPUT when
VERSION contains a value and include context (e.g., reference to main.tsp) in
the error message.

In `@CHANGELOG.md`:
- Line 21: The changelog entry incorrectly states "Node.js 24 runtime" while the
workflows still set node-version: '20'; update the CHANGELOG line that currently
reads "Bumped `actions/checkout` and `actions/setup-node` to v6 (Node.js 24
runtime)" to accurately reflect the runtime (e.g., remove the "(Node.js 24
runtime)" parenthetical or change it to "(Node.js 20 runtime)"), so the text
matches the actual `node-version: '20'` used in the workflows.

In `@go.mod`:
- Line 3: Update the Go version directive in go.mod from "go 1.25.0" to a lower,
compatible version such as "go 1.16" or "go 1.17" to broaden downstream
compatibility; open go.mod, locate the line containing the literal token "go
1.25.0" and replace it with "go 1.16" (or "go 1.17") since only //go:embed
(introduced in 1.16) is required by the module.

In `@README.md`:
- Around line 365-367: The fenced code block containing the Go module replace
directive (the line starting with "replace
github.com/openshift-hyperfleet/hyperfleet-api-spec =>
/path/to/local/hyperfleet-api-spec") should include a language specifier to
enable syntax highlighting and silence MD040; change the opening backticks from
"```" to "```go" so the block reads "```go" followed by the replace directive
and then the closing "```".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: d5cdb396-db24-4ad4-9c30-d1c9df7625b3

📥 Commits

Reviewing files that changed from the base of the PR and between 5d10855 and 6a17bb6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .spectral.yaml
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • README.md
  • RELEASING.md
  • build-schema.sh
  • go.mod
  • main.tsp
  • models/common/model.tsp
  • schemas/core/openapi.yaml
  • schemas/core/swagger.yaml
  • schemas/gcp/openapi.yaml
  • schemas/gcp/swagger.yaml
  • schemas/schemas.go

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/release.yml
Comment thread CHANGELOG.md Outdated
Comment thread go.mod
Comment thread README.md Outdated
@mliptak0 mliptak0 force-pushed the HYPERFLEET-1024 branch from 6df29fe to c0a5084 Compare May 7, 2026 14:14
@mliptak0 mliptak0 force-pushed the HYPERFLEET-1024 branch from c0a5084 to f3a980a Compare May 7, 2026 14:18
Comment thread .github/workflows/ci.yml
Comment on lines +37 to +43
- name: Check schema consistency
run: |
if ! git diff --exit-code schemas/; then
echo "Committed schemas are out of sync with TypeSpec sources."
echo "Run './build-schema.sh core --swagger && ./build-schema.sh gcp --swagger' and commit the results."
exit 1
fi
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this run always regardless of finding schemas in the git diff?

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 7, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Comment thread .github/workflows/ci.yml
run: npm ci

- name: Install Spectral CLI
run: npm install -g @stoplight/spectral-cli@6.15.1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ci.yml:28 — global Spectral install contradicts tsp-to-local migration

This PR removes the global tsp install in favor of node_modules/.bin/tsp to eliminate version mismatches, but installs Spectral globally (npm install -g @stoplight/spectral-cli@6.15.1). Consider adding @stoplight/spectral-cli as a pinned devDependency and invoking via npx spectral or node_modules/.bin/spectral for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants