GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: reject units in StateSet builder by 2748109647 · Pull Request #2635 · prometheus/client_java

Conversation

@2748109647

@2748109647 2748109647 commented Nov 2, 2026

Copy link
Copy Markdown

@fstab

Fixes #2632.

StateSet.Builder inherited the generic unit(...) setter, so it accepted a non-null unit while building and only failed later during collect(). Override the setter to reject non-null units immediately, consistent with Info.Builder, and add a regression test.

Validation:

  • mvnw.cmd test -pl prometheus-metrics-core -am -Dtest=StateSetTest -Dsurefire.failIfNoSpecifiedTests=false -Dcoverage.skip=true — 5 tests passed; reactor build succeeded.
  • mvnw.cmd install -DskipTests -DskipITs -Dcoverage.skip=true — all 56 modules built successfully.
  • mise run lint:fix applied formatting. Checkstyle could not run locally because its downloaded Windows executable reported an incompatible binary.
  • Docker/Testcontainers integration checks were attempted with Docker available, but the configured docker.mirrors.ustc.edu.cn registry mirror did not resolve when pulling testcontainers/ryuk:0.12.0; those checks remain unverified.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@2748109647
fix: reject units in StateSet builder
4de92f3
Signed-off-by: Alpha <[email protected]>
@2748109647
2748109647 requested review from dhoard, fstab, jaydeluca and zeitlinger as code owners November 2, 2026 05:26
@zeitlinger

zeitlinger commented Nov 3, 2026

Copy link
Copy Markdown
Member

Run mise run api-diff and commit the generated update

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@2748109647
docs: update generated API diff
60a51f1
Signed-off-by: Alpha <[email protected]>
@github-actions github-actions Bot added the api-change label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — maintainer review required

This PR modifies the published API diff for the following module(s):

  • prometheus-metrics-core

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@2748109647 ChatGPT Codex Connector

2748109647 commented Nov 3, 2026

Copy link
Copy Markdown
Author

Done in commit 60a51f1 (60a51f1). I reviewed the generated diff; it records the new public StateSet.Builder.unit(Unit) method introduced by this PR.

The documented Maven API-diff reactor completed successfully across all 30 modules with -Dmaven.test.skip=true, and regenerated the API-diff output. The exact mise run api-diff task could not complete in this environment: mise reported a Java 25 lock/version mismatch and stalled while provisioning Renovate's npm dependencies. The fallback skipped test-source compilation and all tests. On the pushed commit, the API-change detector and DCO checks both pass; the remaining checks are still pending.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zeitlinger
fix: resolve StateSet unit API diff conflict with main
dc38842

This branch has not been deployed

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

Reviewers

@fstab fstab Awaiting requested review from fstab fstab is a code owner
@dhoard dhoard Awaiting requested review from dhoard dhoard is a code owner
@zeitlinger zeitlinger Awaiting requested review from zeitlinger zeitlinger is a code owner
@jaydeluca jaydeluca Awaiting requested review from jaydeluca jaydeluca is a code owner

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api-change

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

StateSet.Builder.unit(...) is accepted at build time, then every collect() throws

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@2748109647 @zeitlinger
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.