Repository navigation
Split API into a standalone Go module #2882
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
Open
aryangorwade
wants to merge
8
commits into
NVIDIA:main
Choose a base branch
from
aryangorwade:aryan-api-module-split
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2b10226
Move API dependencies into the API package
aryangorwade 5e786cf
Split API into a standalone Go module
aryangorwade 7bfa3bd
Make build tooling support the API module
aryangorwade e2d49d3
CI: Keep shared module dependencies in sync
aryangorwade 922a5af
CI: Validate paired API tags after release
aryangorwade 1b4885f
CI: Group dependency updates across Go modules
aryangorwade 88e6454
CI: Reject published API versions in release bumps
aryangorwade dc78578
CI: Ignore API module tags in GitLab
aryangorwade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright NVIDIA CORPORATION | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: API Post-Tag Validation | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+" | ||
| workflow_dispatch: | ||
| inputs: | ||
| operator_tag: | ||
| description: "Operator tag to validate" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate-api-module: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout tagged code | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| ref: ${{ github.event.inputs.operator_tag || github.ref }} | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Get Golang version | ||
| run: | | ||
| GOLANG_VERSION=$(grep "GOLANG_VERSION ?=" versions.mk) | ||
| echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> "${GITHUB_ENV}" | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: ${{ env.GOLANG_VERSION }} | ||
|
|
||
| - name: Validate published API module | ||
| env: | ||
| OPERATOR_TAG: ${{ github.event.inputs.operator_tag || github.ref_name }} | ||
| run: make validate-published-api-module OPERATOR_TAG="${OPERATOR_TAG}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Copyright NVIDIA CORPORATION | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: API Release Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| - edited | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| api-version-unpublished: | ||
| if: | | ||
| contains(github.event.pull_request.title, 'operator') && | ||
| contains(github.event.pull_request.title, 'version') && | ||
| contains(github.event.pull_request.title, 'bump') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Get Golang version | ||
| run: | | ||
| GOLANG_VERSION=$(grep "GOLANG_VERSION ?=" versions.mk) | ||
| echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> "${GITHUB_ENV}" | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: ${{ env.GOLANG_VERSION }} | ||
|
|
||
| - name: Check that API version is unpublished | ||
| run: make validate-api-version-unpublished | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| module github.com/NVIDIA/gpu-operator/api | ||
|
|
||
| go 1.26.3 | ||
|
|
||
| require ( | ||
| github.com/NVIDIA/k8s-kata-manager v0.2.3 | ||
| github.com/NVIDIA/k8s-operator-libs v0.0.0-20260629200812-d720f2557494 | ||
| github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.94.0 | ||
| github.com/regclient/regclient v0.11.5 | ||
| github.com/stretchr/testify v1.12.1 | ||
| golang.org/x/mod v0.41.0 | ||
| k8s.io/api v0.37.0 | ||
| k8s.io/apimachinery v0.37.0 | ||
| k8s.io/client-go v0.37.0 | ||
| k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
| github.com/emicklei/go-restful/v3 v3.13.0 // indirect | ||
| github.com/fxamacker/cbor/v2 v2.9.3 // indirect | ||
| github.com/go-logr/logr v1.4.4 // indirect | ||
| github.com/go-openapi/jsonpointer v1.0.0 // indirect | ||
| github.com/go-openapi/jsonreference v1.0.0 // indirect | ||
| github.com/go-openapi/swag v0.27.1 // indirect | ||
| github.com/go-openapi/swag/cmdutils v0.27.1 // indirect | ||
| github.com/go-openapi/swag/conv v0.27.1 // indirect | ||
| github.com/go-openapi/swag/fileutils v0.27.1 // indirect | ||
| github.com/go-openapi/swag/jsonutils v0.27.1 // indirect | ||
| github.com/go-openapi/swag/loading v0.27.1 // indirect | ||
| github.com/go-openapi/swag/mangling v0.27.1 // indirect | ||
| github.com/go-openapi/swag/netutils v0.27.1 // indirect | ||
| github.com/go-openapi/swag/pools v0.27.1 // indirect | ||
| github.com/go-openapi/swag/stringutils v0.27.1 // indirect | ||
| github.com/go-openapi/swag/typeutils v0.27.1 // indirect | ||
| github.com/go-openapi/swag/yamlutils v0.27.1 // indirect | ||
| github.com/google/gnostic-models v0.7.0 // indirect | ||
| github.com/google/uuid v1.6.0 // indirect | ||
| github.com/json-iterator/go v1.1.12 // indirect | ||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
| github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect | ||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | ||
| github.com/x448/float16 v0.8.4 // indirect | ||
| go.yaml.in/yaml/v2 v2.4.4 // indirect | ||
| go.yaml.in/yaml/v3 v3.0.5 // indirect | ||
| golang.org/x/net v0.58.0 // indirect | ||
| golang.org/x/oauth2 v0.36.0 // indirect | ||
| golang.org/x/sys v0.47.0 // indirect | ||
| golang.org/x/term v0.45.0 // indirect | ||
| golang.org/x/text v0.41.0 // indirect | ||
| golang.org/x/time v0.15.0 // indirect | ||
| google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect | ||
| gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect | ||
| gopkg.in/inf.v0 v0.9.1 // indirect | ||
| k8s.io/klog/v2 v2.140.0 // indirect | ||
| k8s.io/kube-openapi v0.0.0-20260821135717-be32def86098 // indirect | ||
| sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect | ||
| sigs.k8s.io/randfill v1.0.0 // indirect | ||
| sigs.k8s.io/structured-merge-diff/v6 v6.4.2 // indirect | ||
| sigs.k8s.io/yaml v1.6.0 // indirect | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: NVIDIA/gpu-operator
Length of output: 10771
🏁 Script executed:
Repository: NVIDIA/gpu-operator
Length of output: 15870
🤖 get_repo_knowledge executed:
get_repo_knowledge NVIDIA/gpu-operator /tmp/coderabbit-repo-knowledge/nvidia-gpu-operator-eed98df4/conventionsLength of output: 4401
🏁 Script executed:
Repository: NVIDIA/gpu-operator
Length of output: 8575
Run the API-tag check for version changes.
If a PR changes the API module version but its title does not contain all three required substrings, GitHub skips
api-version-unpublished. The validator then does not check whetherapi/<version>already exists, so a title such asRelease v25.3.0can bypass this release check. The PR template does not require the current title format.Gate the job on changed API version metadata, or use a required release signal that cannot be omitted by changing the title.