Repository navigation
Update openshift dependencies to 1.36 deps #2200
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| --- | ||
| name: openshift-rebase-update | ||
| description: Bumps openshift/api, openshift/library-go, openshift/client-go, and other openshift/* Go module dependencies in kueue-operator to their latest commits, re-vendors, regenerates code/manifests, and runs the full verification suite (build, vet, unit tests, lint). Use whenever asked to "rebase", "bump openshift deps", "update openshift/api", or similar dependency-refresh requests for this repo. | ||
| --- | ||
|
|
||
| # OpenShift Dependency Rebase/Update | ||
|
|
||
| Updates this operator's `openshift/*` Go module dependencies to their latest | ||
| upstream commits and verifies nothing broke. Mirrors the manual workflow used | ||
| for bumping `openshift/api`. | ||
|
|
||
| ## Which modules this covers | ||
|
|
||
| Check `go.mod` for the current set — typically: | ||
|
|
||
| - `github.com/openshift/api` | ||
| - `github.com/openshift/library-go` | ||
| - `github.com/openshift/client-go` | ||
| - `github.com/openshift/build-machinery-go` | ||
| - `github.com/openshift/jobset-operator` | ||
| - `github.com/openshift/lws-operator` | ||
|
|
||
| ```bash | ||
| grep -n 'github.com/openshift/' go.mod | ||
| ``` | ||
|
|
||
| **Important:** `go.mod` may contain a `replace` directive pointing an | ||
| `openshift/*` module at a personal fork (e.g. a fork used to pick up an | ||
| unmerged upstream PR). Check for these before bumping: | ||
|
|
||
| ```bash | ||
| grep -n '^replace' go.mod | ||
| ``` | ||
|
|
||
| If a target module is `replace`d by a fork, decide whether to: | ||
| - leave the replace as-is (fork still needed, e.g. PR not yet merged upstream), or | ||
| - point the replace at a newer fork commit / remove it if the PR has since merged into `openshift/library-go` proper. | ||
|
|
||
| Do not silently drop a `replace` directive without confirming the underlying | ||
| PR has actually merged upstream. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. **Identify target modules.** Default to updating all `github.com/openshift/*` | ||
| direct dependencies unless the user specifies a subset. | ||
|
|
||
| 2. **Bump each module to latest:** | ||
|
|
||
| ```bash | ||
| go get github.com/openshift/api@latest | ||
| go get github.com/openshift/library-go@latest | ||
| go get github.com/openshift/client-go@latest | ||
| # ... repeat for other requested openshift/* modules | ||
| ``` | ||
|
|
||
| `go get @latest` follows the module's default branch tip (or a `replace` | ||
| target's branch tip if one is set). This will also pull in any required | ||
| transitive bumps (e.g. `k8s.io/api`, `k8s.io/apimachinery`). | ||
|
|
||
| 3. **Tidy and re-vendor:** | ||
|
|
||
| ```bash | ||
| go mod tidy | ||
| go mod vendor | ||
| ``` | ||
|
|
||
| 4. **Check for accidental submodule drift.** `upstream/kueue/src` is a git | ||
| submodule and can show as modified even when unrelated to this task | ||
| (e.g. from a prior `git submodule update` elsewhere). Restore it unless the | ||
| task explicitly wants it moved: | ||
|
|
||
| ```bash | ||
| git status --short upstream/kueue/src | ||
| git submodule update upstream/kueue/src # if unexpectedly dirty | ||
| ``` | ||
|
|
||
| 5. **Regenerate manifests/generated code**, since API type changes can affect | ||
| CRDs, deepcopy, clients, listers, informers: | ||
|
|
||
| ```bash | ||
| make generate | ||
| ``` | ||
|
|
||
| Review `git status --short` for changes under `manifests/`, | ||
| `pkg/generated/`, and `pkg/apis/.../zz_generated*.go`. | ||
|
|
||
| 6. **Run the full verification suite:** | ||
|
|
||
| ```bash | ||
| go build ./... | ||
| go vet ./... | ||
| make test-unit | ||
| make lint | ||
| ``` | ||
|
|
||
| Fix any compile errors from upstream API changes (renamed fields, removed | ||
| types, changed signatures) before proceeding. Common sources of breakage: | ||
| - `library-go` helper function signature changes | ||
| - `openshift/api` type/field renames or removals (check `zz_generated.deepcopy.go` diffs and callers) | ||
| - `client-go`/`applyconfiguration` generated code needing regeneration (step 5) | ||
|
|
||
| 7. **Review the diff** before considering the task done: | ||
|
|
||
| ```bash | ||
| git status --short | grep -v '^ M vendor/' # non-vendor changes worth a close look | ||
| git diff go.mod go.sum | ||
| ``` | ||
|
|
||
| Expect `go.mod`/`go.sum` version bumps, vendor tree churn (many files, this | ||
| is normal and doesn't need individual review), and possibly `manifests/` | ||
| or `pkg/generated/` diffs from regeneration. Flag anything unexpected | ||
| (e.g. unrelated submodule pointer changes, unrelated untracked files) to | ||
| the user rather than committing them. | ||
|
|
||
| ## Notes | ||
|
|
||
| - `go get @latest` for pseudo-versioned modules (no tags) resolves to the | ||
| latest commit on the module's default branch as of that moment — safe to | ||
| re-run to pick up newer commits later. | ||
| - If `go build`/`make generate` fails with "inconsistent vendoring", it means | ||
| `go.mod` and `vendor/modules.txt` disagree; re-run `go mod vendor`. | ||
| - Do not hand-edit files under `vendor/`; always regenerate via `go mod vendor`. | ||
| - `make lint` uses golangci-lint v2 (30m timeout) — expect it to download the | ||
| pinned binary into `bin/` on first run. | ||
|
kannon92 marked this conversation as resolved.
Resolved
|
||
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
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.
is there a word missing after "if the PR has"?
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.
No I think that is proper english. It reads fine to me.