Skip to content

Add OCI registry URL to the API server config - #676

Merged
epompeii merged 2 commits into
mainfrom
u/ep/registry-url
Feb 25, 2026
Merged

Add OCI registry URL to the API server config#676
epompeii merged 2 commits into
mainfrom
u/ep/registry-url

Conversation

@epompeii

Copy link
Copy Markdown
Member

This changset adds a url to the the plus.registry section of the API server configuration.
If not specified, it will point to http://localhost:61016 by default for Bencher Self-Hosted instances.

@github-actions

github-actions Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

馃 Claude Code Review

PR: #676
Base: main
Head: u/ep/registry-url
Commit: 8f8a1a3a4b9095dc20d076cbc5673eaac51e8d8a


I now have a thorough understanding of the changes. Here's my review:


PR Review: registry_url + optional_data_store

Commits: 6a99a337 (registry_url) and 8f8a1a3a (optional_data_store)

Summary

Two related changes to the OCI registry configuration:

  1. Add a configurable url field to JsonRegistry for the externally-reachable registry URL
  2. Make data_store optional and add an explicit Local variant to RegistryDataStore

Positives

  • Good defaults: Self-hosted gets localhost:61016, Bencher Cloud gets registry.bencher.dev -- clean fallback logic in default_registry_url()
  • Thorough documentation: All 9 language doc files updated consistently, example config updated
  • Clean error handling: New PlusError::RegistryUrl variant with thiserror, consistent with project patterns
  • OpenAPI spec regenerated: openapi.json updated correctly with nullable fields and the new Local variant
  • PLAN.md updated: Completed tasks properly checked off and renumbered

Issues

1. LOCALHOST_BENCHER_REGISTRY_URL_STR reuses the API server address

lib/bencher_json/src/lib.rs:205:

pub const LOCALHOST_BENCHER_REGISTRY_URL_STR: &str = "http://localhost:61016";

This is the same as LOCALHOST_BENCHER_API_URL_STR (line 164). If the registry is served by the same API server (at /v2/), this is correct. But calling it a "registry URL" while pointing to the general API server could be confusing. A doc comment clarifying that the registry is hosted on the same origin (at /v2/ paths) would help future readers.

2. PROD_BENCHER_REGISTRY_URL is defined but never referenced

lib/bencher_json/src/lib.rs:228-232 defines PROD_BENCHER_REGISTRY_URL but nothing in the codebase uses it -- only BENCHER_REGISTRY_URL and LOCALHOST_BENCHER_REGISTRY_URL are actually consumed. Consider removing it to avoid dead code, or add #[expect(dead_code)] with a reason if it's intended for future use.

3. registry_url() accessor is defined but never called

lib/bencher_schema/src/context/mod.rs:134-137:

pub fn registry_url(&self) -> &Url {
    &self.registry_url
}

No code calls context.registry_url() yet. The PLAN.md indicates this is for a future step (building JsonJobConfig). This is fine as scaffolding, but worth noting that the accessor is currently dead code.

4. data_store.service documented as "Required: Yes" but data_store itself is optional

In the docs (e.g., en/plus-registry.mdx), the table says data_store is "Required: No" (local if omitted), but data_store.service is "Required: Yes". This is internally consistent (if you provide data_store, you must specify the service tag) but could confuse readers. Consider a note like: "Required when data_store is provided."

5. Minor: debug_assertions pattern for BENCHER_REGISTRY_URL_STR

#[cfg(debug_assertions)]
pub const BENCHER_REGISTRY_URL_STR: &str = LOCALHOST_BENCHER_REGISTRY_URL_STR;
#[cfg(not(debug_assertions))]
pub const BENCHER_REGISTRY_URL_STR: &str = PROD_BENCHER_REGISTRY_URL_STR;

This follows the existing pattern for BENCHER_API_URL_STR, so it's consistent. Just noting that this means the constant switches between localhost/production based on debug vs release mode, which is the established convention.

6. Breaking change to JsonRegistry serialization

data_store went from required (RegistryDataStore) to optional (Option<RegistryDataStore>). Existing config files with "data_store": { "service": "aws_s3", ... } will still deserialize fine. But if any code was generating configs that relied on data_store being non-optional, the serialization of None will differ (field absent vs. present). Since this is a config struct (not stored in DB), and Option fields are skipped by default in serde if using skip_serializing_if, this could be fine -- but note that there's no #[serde(skip_serializing_if = "Option::is_none")] on the data_store or url fields. This means serializing a default config will emit "data_store": null and "url": null in JSON. Consider adding skip_serializing_if for cleaner output.

No Security Concerns

  • The registry URL is a configuration value with sensible defaults
  • No new attack surface introduced
  • Credentials (secret_access_key) handling unchanged

No Performance Concerns

  • Static LazyLock URLs are initialized once
  • No hot-path changes

Verdict

Clean, well-structured change that follows project conventions. The main actionable items are the unused PROD_BENCHER_REGISTRY_URL static and optionally adding skip_serializing_if to the new Option fields in JsonRegistry for cleaner serialized output. The dead registry_url() accessor is acceptable as scaffolding for the next step in the PLAN.


Model: claude-opus-4-6

@github-actions

Copy link
Copy Markdown
Contributor

馃惏 Bencher Report

Branchu/ep/registry-url
Testbedubuntu-22.04

鈿狅笍 WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (碌s)
Adapter::Json馃搱 view plot
鈿狅笍 NO THRESHOLD
3.70 碌s
Adapter::Magic (JSON)馃搱 view plot
鈿狅笍 NO THRESHOLD
3.64 碌s
Adapter::Magic (Rust)馃搱 view plot
鈿狅笍 NO THRESHOLD
25.38 碌s
Adapter::Rust馃搱 view plot
鈿狅笍 NO THRESHOLD
2.81 碌s
Adapter::RustBench馃搱 view plot
鈿狅笍 NO THRESHOLD
2.83 碌s
head_version_insert/batch/10馃搱 view plot
鈿狅笍 NO THRESHOLD
94.99 碌s
head_version_insert/batch/100馃搱 view plot
鈿狅笍 NO THRESHOLD
228.77 碌s
head_version_insert/batch/255馃搱 view plot
鈿狅笍 NO THRESHOLD
455.46 碌s
head_version_insert/batch/50馃搱 view plot
鈿狅笍 NO THRESHOLD
154.69 碌s
threshold_query/join/10馃搱 view plot
鈿狅笍 NO THRESHOLD
138.84 碌s
threshold_query/join/20馃搱 view plot
鈿狅笍 NO THRESHOLD
156.29 碌s
threshold_query/join/5馃搱 view plot
鈿狅笍 NO THRESHOLD
131.32 碌s
threshold_query/join/50馃搱 view plot
鈿狅笍 NO THRESHOLD
194.15 碌s
馃惏 View full continuous benchmarking report in Bencher

@epompeii
epompeii force-pushed the u/ep/registry-url branch 2 times, most recently from d60b631 to d734e34 Compare February 25, 2026 04:24
@epompeii
epompeii merged commit 62133fa into main Feb 25, 2026
67 of 69 checks passed
@epompeii
epompeii deleted the u/ep/registry-url branch February 25, 2026 05:23
@github-actions github-actions Bot mentioned this pull request Feb 26, 2026
epompeii added a commit that referenced this pull request Feb 26, 2026
This changset adds a `url` to the the `plus.registry` section of the API
server configuration.
If not specified, it will point to `http://localhost:61016` by default
for Bencher Self-Hosted instances.
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.

1 participant