Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Run the Maven verify phase
env:
PROTO_GENERATION: true
REQUIRE_PROTO_UP_TO_DATE: true
run: mise run ci

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Combine all with `./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcove

## Updating the Protobuf Java Classes

Use `PROTO_GENERATION=true mvn clean install` to generate protobuf classes.
Use `mise up && mise run test` to generate protobuf classes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_1.Metrics;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_2.Metrics;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import com.google.common.io.Resources;
import io.prometheus.client.it.common.ExporterTest;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_1.Metrics;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_2.Metrics;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URLEncoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.prometheus.client.it.common.ExporterTest;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_1.Metrics;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_2.Metrics;
import java.io.IOException;
import java.net.URL;
import java.util.List;
Expand Down
10 changes: 10 additions & 0 deletions mise.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tools.java]
version = "temurin-17.0.13+11"
backend = "core:java"

[tools.protoc]
version = "30.2"
backend = "aqua:protocolbuffers/protobuf/protoc"

[tools.protoc.checksums]
"protoc-30.2-linux-x86_64.zip" = "sha256:327e9397c6fb3ea2a542513a3221334c6f76f7aa524a7d2561142b67b312a01f"
5 changes: 3 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROTO_GENERATION = "true"

[tools]
java = "temurin-17.0.13+11"
protoc = "30.1"
protoc = "latest"

[tasks.ci]
description = "CI Build"
Expand All @@ -12,7 +12,7 @@ run = [
# just to check if javadoc can be generated
"./mvnw javadoc:javadoc -P javadoc"
]
env = { PROTO_GENERATION = "true", REQUIRE_PROTO_UP_TO_DATE = "true" }
env = { REQUIRE_PROTO_UP_TO_DATE = "true" }

[tasks.format]
description = "format source code"
Expand All @@ -25,3 +25,4 @@ run = "./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=t
[tasks.test-all]
description = "run all tests"
run = "./mvnw verify"

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import static org.assertj.core.data.Offset.offset;

import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfigTestUtil;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_1.Metrics;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_2.Metrics;
import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl;
import io.prometheus.metrics.expositionformats.internal.ProtobufUtil;
import io.prometheus.metrics.model.snapshots.CounterSnapshot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import io.prometheus.metrics.core.datapoints.DistributionDataPoint;
import io.prometheus.metrics.core.exemplars.ExemplarSamplerConfigTestUtil;
import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_1.Metrics;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_2.Metrics;
import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl;
import io.prometheus.metrics.expositionformats.internal.ProtobufUtil;
import io.prometheus.metrics.model.snapshots.ClassicHistogramBucket;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_1.Metrics;
import io.prometheus.metrics.expositionformats.generated.com_google_protobuf_4_30_2.Metrics;
import io.prometheus.metrics.expositionformats.internal.PrometheusProtobufWriterImpl;
import io.prometheus.metrics.expositionformats.internal.ProtobufUtil;
import io.prometheus.metrics.model.snapshots.Labels;
Expand Down
4 changes: 2 additions & 2 deletions prometheus-metrics-exposition-formats/generate-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ GENERATED_WITH=$(grep -oP '\/\/ Protobuf Java Version: \K.*' "$TARGET_DIR/${PACK
if [[ $GENERATED_WITH != "$PROTOBUF_VERSION" ]]; then
echo "Generated protobuf sources version $GENERATED_WITH does not match provided version $PROTOBUF_VERSION"
echo "Please use https://mise.jdx.dev/ - this will use the version specified in mise.toml"
echo "Generated protobuf sources are not up-to-date. Please run 'mise up && mvn clean install' and commit the changes."
echo "Generated protobuf sources are not up-to-date. Please run 'mise up && mise run test' and commit the changes."
exit 1
fi

STATUS=$(git status --porcelain)
if [[ ${REQUIRE_PROTO_UP_TO_DATE:-false} == "true" && -n "$STATUS" ]]; then
echo "Please use https://mise.jdx.dev/ - this will use the version specified in mise.toml"
echo "Generated protobuf sources are not up-to-date. Please run 'mvn clean install' and commit the changes."
echo "Generated protobuf sources are not up-to-date. Please run 'mise run test' and commit the changes."
echo "Local changes:"
echo "$STATUS"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-exposition-formats/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<properties>
<automatic.module.name>io.prometheus.metrics.expositionformats</automatic.module.name>
<protobuf-java.version>4.30.1</protobuf-java.version>
<protobuf-java.version>4.30.2</protobuf-java.version>
</properties>

<dependencies>
Expand Down
Loading
Loading