Skip to content

registry: add oc and openshift-install (http backend)#9669

Merged
jdx merged 3 commits into
jdx:mainfrom
konono:add_openshift-client
May 11, 2026
Merged

registry: add oc and openshift-install (http backend)#9669
jdx merged 3 commits into
jdx:mainfrom
konono:add_openshift-client

Conversation

@konono

@konono konono commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add http: backend to existing oc registry entry (keeps conda/asdf as fallbacks)
  • Add new openshift-install registry entry with http: backend
  • Both tools download from the official OpenShift mirror at https://mirror.openshift.com/pub/openshift-v4/clients/ocp/
  • Allow version_regex to parse HTML responses in version_list.rs, since the OpenShift mirror serves an Apache-style HTML directory listing as its version index

Why the version_list.rs change is needed

The OpenShift mirror (https://mirror.openshift.com/pub/openshift-v4/clients/ocp/) serves an HTML directory listing as the only available version index — there is no JSON API, GitHub Releases, or plain-text endpoint. Currently, fetch_versions uses HTTP.get_text(),
which rejects any response starting with <!DOCTYPE html>. When version_regex is specified, the caller explicitly intends to parse arbitrary content (including HTML directory listings from Apache/nginx), so this change bypasses the HTML rejection in that case only.

Popularity

oc (OpenShift CLI)

  • Already registered in mise (conda:openshift-cli, asdf:mise-plugins/mise-oc) — this PR adds a better backend
  • GitHub (openshift/oc): 239 stars, 442 forks, last push 2026-05-05
  • Official CLI for Red Hat OpenShift, one of the leading enterprise Kubernetes distributions

openshift-install

  • GitHub (openshift/installer): 1.5k stars, 1.5k forks, last push 2026-05-06
  • Official installer for deploying OpenShift clusters

Test results (macOS ARM64)

Version listing

$ mise ls-remote oc
4.1.0
4.1.11
...
4.9.8
4.9.9

Install & verify

$ mise exec oc@4.17.0 -- oc version --client
Client Version: 4.17.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3

$ mise exec openshift-install@4.17.0 -- openshift-install version
openshift-install 4.17.0
built from commit dfd4c085a7210e49111fa8d6747016d78f98ecf2

Unit tests

$ cargo test version_list
test result: ok. 27 passed; 0 failed; 0 ignored; 0 measured; 840 filtered out

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds http backends for the oc and openshift-install tools to the registry, providing platform-specific download URLs. It also updates the version fetching logic in src/backend/version_list.rs to allow raw text retrieval when a regex is provided, which is necessary for parsing HTML directory listings. A review comment suggests extending Windows support to the openshift-install tool for parity with the oc tool configuration.

Comment thread registry/openshift-install.toml
@greptile-apps

greptile-apps Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds http: backend support for two OpenShift tools (oc and openshift-install) that download from the official mirror at https://mirror.openshift.com/pub/openshift-v4/clients/ocp/. The core Rust change in version_list.rs allows the mirror's Apache-style HTML directory listing to be parsed via version_regex, while a companion guard prevents the line-splitting fallback from treating raw HTML lines as version strings.

  • registry/oc.toml: Converts from an inline backends array to structured [[backends]] TOML, inserting the new http: entry first and retaining conda:openshift-cli and asdf:mise-plugins/mise-oc as fallbacks. All five platform variants (linux-x64/arm64, macos-x64/arm64, windows-x64) are covered.
  • registry/openshift-install.toml: New entry using the same mirror URL and version regex as oc; correctly omits Windows since no Windows build is published upstream.
  • src/backend/version_list.rs: When version_regex is present, fetch_versions now calls HTTP.get_async + .text() instead of get_text, bypassing the HTML-rejection guard. parse_version_list skips the line-split fallback when version_regex or version_expr was the extraction method, avoiding empty-regex-match results being promoted to garbage version strings.

Confidence Score: 5/5

Safe to merge — registry additions are additive and isolated, and the version_list.rs changes are guarded correctly.

The registry TOML files are straightforward additions that don't touch any shared logic. The version_list.rs change is narrow: it replaces get_text with get_async + .text() only when version_regex is supplied, which is the documented intent, and the HTTP client's error-status check, offline guard, and auth headers are all still applied via get_async_with_headers. The companion explicit_method guard correctly prevents the line-split fallback from firing when a regex or expr extraction method was used. The PR includes working test output and all 27 existing unit tests pass.

No files require special attention.

Important Files Changed

Filename Overview
src/backend/version_list.rs Bypasses HTML rejection in get_text when version_regex is set; prevents garbage line-split fallback when an explicit extraction method is provided. Logic is correct but introduces a silent empty-result failure mode when version_regex backend hits unexpected HTML.
registry/oc.toml Converts inline-array backends to structured TOML format; adds http: backend with platform-specific URLs and HTML-regex version listing, keeping conda/asdf as fallbacks.
registry/openshift-install.toml New registry entry for openshift-install using the same OpenShift mirror URL and regex pattern as oc; covers Linux and macOS but intentionally omits Windows (no Windows build available for this tool).

Reviews (4): Last reviewed commit: "[autofix.ci] apply automated fixes" | Re-trigger Greptile

Comment thread src/backend/version_list.rs
@konono konono force-pushed the add_openshift-client branch from fd1f969 to 0aa1f2a Compare May 11, 2026 01:55
@jdx jdx merged commit 0d7c74c into jdx:main May 11, 2026
34 checks passed
mise-en-dev added a commit that referenced this pull request May 11, 2026
### 🚀 Features

- **(cli)** add minimum release age flag to lock and ls-remote by
@risu729 in [#9269](#9269)
- **(config)** add run field for hooks by @risu729 in
[#9718](#9718)
- **(github)** add native oauth token source by @jdx in
[#9654](#9654)
- **(oci)** scope build to project config by default by @jdx in
[#9766](#9766)
- add support for prefixed latest version queries in outdated checks by
@roele in [#9767](#9767)

### 🐛 Bug Fixes

- **(activate)** guard bash chpwd hook under nounset by @risu729 in
[#9716](#9716)
- **(backend)** date-check latest stable fast path by @risu729 in
[#9650](#9650)
- **(config)** parse core tool options consistently by @risu729 in
[#9742](#9742)
- **(exec)** propagate __MISE_DIFF so nested mise recovers pristine PATH
by @jdx in [#9765](#9765)
- **(forgejo)** include prereleases when opted in by @risu729 in
[#9717](#9717)
- **(github)** avoid caching empty release assets by @risu729 in
[#9616](#9616)
- **(java)** resolve lockfile URLs from metadata by @risu729 in
[#9719](#9719)
- **(lock)** cache unavailable github attestations by @risu729 in
[#9741](#9741)
- **(pipx)** preserve options when reinstalling tools by @risu729 in
[#9663](#9663)
- **(python)** skip redundant lockfile provenance verification by
@risu729 in [#9739](#9739)
- **(vfox)** run pre_uninstall hook by @risu729 in
[#9662](#9662)

### 🚜 Refactor

- **(schema)** extract tool options definition by @risu729 in
[#9649](#9649)

### ⚡ Performance

- **(aqua)** bake rkyv aqua package blobs by @risu729 in
[#9535](#9535)

### 📦️ Dependency Updates

- lock file maintenance by @renovate[bot] in
[#9773](#9773)

### 📦 Registry

- add vector
([github:vectordotdev/vector](https://github.com/vectordotdev/vector))
by @kquinsland in [#9761](#9761)
- add oc and openshift-install (http backend) by @konono in
[#9669](#9669)

### New Contributors

- @konono made their first contribution in
[#9669](#9669)
- @kquinsland made their first contribution in
[#9761](#9761)
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