Skip to content

Commit

Permalink
Merge branch 'release/0.0.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Jan 5, 2023
2 parents 40ff686 + 08b3db9 commit 21e333e
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 49 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
Export your favorite GitHub repositories to Prometheus

* Use it _as a service_: See https://gh.skuzzle.de for instructions
* Deploy it _on-premise_: `docker pull ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.17`
* Deploy it _on-premise_: `docker pull ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.18`

## On-Premise deployment with docker
This application can easily be run as a docker container in whatever environment you like:

```
docker run -p 8080:8080 \
-e WEB_ALLOWANONYMOUSSCRAPE=true \
ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.17
ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.18
```

With _anonymous scraping_ allowed, you can now easily view the scrape results directly in the browser by navigating to
Expand All @@ -38,7 +38,7 @@ scrape_configs:
In case you want to enforce authenticated scrapes only, use this configuration instead:
```
docker run -p 8080:8080 \
ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.17
ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.18
```

Scraping now requires a GitHub access token, otherwise the service will respond with 401/Unauthorized.
Expand Down
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![Coverage Status](https://coveralls.io/repos/github/skuzzle/gh-prom-exporter/badge.svg?branch=master)](https://coveralls.io/github/skuzzle/gh-prom-exporter?branch=master) [![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS)

* Upgrade to Spring-Boot 2.7.4 (coming from 2.7.3)
* Upgrade to Spring-Boot 3.0.0 (coming from 2.7.4)

```
docker pull ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.17
docker pull ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.18
```
45 changes: 11 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.skuzzle</groupId>
<artifactId>skuzzle-parent</artifactId>
<version>3.0.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<groupId>de.skuzzle.ghpromexporter</groupId>
<artifactId>gh-prom-exporter</artifactId>
<version>0.0.17</version>

<version>0.0.18</version>
<name>gh-prom-exporter</name>
<description>Export GitHub repository metrics in prometheus format</description>

<properties>
<java.version>17</java.version>
<!-- Enable Code coverage -->
Expand All @@ -28,21 +24,16 @@
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
<!-- Do not sign jars -->
<gpg.skip>true</gpg.skip>

<github.name>gh-prom-exporter</github.name>

<docker.publish.usr>CHANGE_ME</docker.publish.usr>
<docker.publish.psw>CHANGE_ME</docker.publish.psw>
<docker.registry.name>ghcr.io</docker.registry.name>
<docker.image.name>${docker.registry.name}/${github.user}/${github.name}/${project.artifactId}</docker.image.name>

<spring-boot.version>2.7.4</spring-boot.version>
<spring-cloud.version>2021.0.3</spring-cloud.version>
<guava.version>31.0.1-jre</guava.version>
<github-api.version>1.308</github-api.version>
<snapshottest.version>1.3.0</snapshottest.version>
<spring-boot.version>3.0.0</spring-boot.version>
<guava.version>31.1-jre</guava.version>
<github-api.version>1.313</github-api.version>
<snapshottest.version>1.7.1</snapshottest.version>
</properties>

<repositories>
<repository>
<id>repository.spring.milestone</id>
Expand All @@ -57,7 +48,6 @@
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>

<dependencyManagement>
<dependencies>
<dependency>
Expand All @@ -68,9 +58,9 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-bom</artifactId>
<version>${snapshottest.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -84,16 +74,8 @@
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-core</artifactId>
<version>${snapshottest.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>


<dependencies>
<!-- Spring-Boot -->
<dependency>
Expand All @@ -109,8 +91,8 @@
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
Expand All @@ -133,7 +115,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
Expand All @@ -142,7 +123,6 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<!-- Prometheus -->
<dependency>
<groupId>io.prometheus</groupId>
Expand All @@ -152,20 +132,17 @@
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_common</artifactId>
</dependency>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.skuzzle.test</groupId>
<artifactId>snapshot-tests-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion readme/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Coverage Status](https://coveralls.io/repos/github/${github.user}/${github.name}/badge.svg?branch=${github.main-branch})](https://coveralls.io/github/${github.user}/${github.name}?branch=${github.main-branch}) [![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS)

* Upgrade to Spring-Boot 2.7.4 (coming from 2.7.3)
* Upgrade to Spring-Boot 3.0.0 (coming from 2.7.4)

```
docker pull ${docker.image.name}:${project.version}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.skuzzle.ghpromexporter.github;

import javax.annotation.PostConstruct;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import jakarta.annotation.PostConstruct;

@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(GitHubProperties.class)
public class GitHubConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.sleuth.Span;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.scheduling.annotation.Scheduled;

import de.skuzzle.ghpromexporter.appmetrics.AppMetrics;
import de.skuzzle.ghpromexporter.github.GitHubAuthentication;
import de.skuzzle.ghpromexporter.scrape.RegistrationRepository.RegisteredScraper;
import io.micrometer.tracing.Span;
import io.micrometer.tracing.Tracer;
import reactor.core.publisher.Mono;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package de.skuzzle.ghpromexporter.scrape;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

import io.micrometer.tracing.Tracer;

@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(ScrapeProperties.class)
@EnableScheduling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import org.springframework.http.HttpStatus;

import de.skuzzle.ghpromexporter.github.GitHubAuthentication;
import de.skuzzle.test.snapshots.EnableSnapshotTests;
import de.skuzzle.test.snapshots.SnapshotDsl.Snapshot;
import de.skuzzle.test.snapshots.junit5.EnableSnapshotTests;
import reactor.test.StepVerifier;

@EnableSnapshotTests
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/de/skuzzle/ghpromexporter/web/TestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;
Expand All @@ -28,14 +28,14 @@ public Mono<ResponseEntity<String>> getStatsFor(String owner, String repository,
return client().get().uri("/{owner}/{repository}", owner, repository)
.headers(requestHeaders -> extraHeaders.forEach(requestHeaders::add))
.retrieve()
.onStatus(HttpStatus::is4xxClientError, response -> Mono.empty())
.onStatus(HttpStatusCode::is4xxClientError, response -> Mono.empty())
.toEntity(String.class);
}

public Mono<ResponseEntity<String>> getStatsFor(String owner, String repository) {
return client().get().uri("/{owner}/{repository}", owner, repository)
.retrieve()
.onStatus(HttpStatus::is4xxClientError, response -> Mono.empty())
.onStatus(HttpStatusCode::is4xxClientError, response -> Mono.empty())
.toEntity(String.class);
}
}

0 comments on commit 21e333e

Please sign in to comment.