Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: promhippie/github_exporter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.1
Choose a base ref
...
head repository: promhippie/github_exporter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Nov 7, 2024

  1. minor(deps): update module golang.org/x/oauth2 to v0.24.0 (#419)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 7, 2024

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    e313f45 View commit details
  2. chore(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1

    Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
    - [Release notes](https://github.com/golang-jwt/jwt/releases)
    - [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
    - [Commits](golang-jwt/jwt@v4.5.0...v4.5.1)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/golang-jwt/jwt/v4
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and promhippie[bot] committed Nov 7, 2024
    Copy the full SHA
    18d5e99 View commit details

Commits on Nov 11, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Nov 11, 2024
    Copy the full SHA
    3285025 View commit details

Commits on Nov 12, 2024

  1. chore(deps): update docker digests (#421)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 12, 2024
    Copy the full SHA
    88bae5f View commit details
  2. minor(deps): update module github.com/bradleyfalzon/ghinstallation/v2…

    … to v2.12.0 (#422)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 12, 2024
    Copy the full SHA
    55e392b View commit details

Commits on Nov 16, 2024

  1. minor(deps): update module modernc.org/sqlite to v1.34.1 (#423)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 16, 2024
    Copy the full SHA
    44e8b0d View commit details

Commits on Nov 18, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Nov 18, 2024
    Copy the full SHA
    7b1a301 View commit details

Commits on Nov 23, 2024

  1. minor(deps): update module github.com/stretchr/testify to v1.10.0 (#424)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 23, 2024
    Copy the full SHA
    0ad57a7 View commit details

Commits on Nov 25, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Nov 25, 2024
    Copy the full SHA
    8a476e5 View commit details

Commits on Nov 27, 2024

  1. major(deps): update module github.com/google/go-github/v66 to v67 (#425)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 27, 2024
    Copy the full SHA
    6bbf6e4 View commit details

Commits on Nov 29, 2024

  1. Update Docs for Workflows Jobs collector (webhook info)

    I wasn't able to get the Workflow Jobs working until I enabled the `Workflows Jobs` in the webhook. Suggest adding this to the docs.
    aleclerc-cio authored and tboerger committed Nov 29, 2024
    Copy the full SHA
    c255080 View commit details

Commits on Dec 2, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Dec 2, 2024
    Copy the full SHA
    9dd643b View commit details
  2. patch(deps): update module modernc.org/sqlite to v1.34.2 (#427)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 2, 2024
    Copy the full SHA
    9899f4c View commit details

Commits on Dec 6, 2024

  1. minor(deps): update minor versions to v3.21 (#428)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 6, 2024
    Copy the full SHA
    cedd345 View commit details
  2. minor(deps): update i386/alpine docker tag to v3.21 (#429)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 6, 2024
    Copy the full SHA
    5ad5cf8 View commit details

Commits on Dec 9, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Dec 9, 2024
    Copy the full SHA
    30b7eb7 View commit details

Commits on Dec 13, 2024

  1. patch(deps): update module github.com/prometheus/exporter-toolkit to …

    …v0.13.2 (#430)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 13, 2024
    Copy the full SHA
    340ea62 View commit details

Commits on Dec 16, 2024

  1. minor(deps): update module github.com/go-chi/chi/v5 to v5.2.0 (#431)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 16, 2024
    Copy the full SHA
    be9764d View commit details
  2. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Dec 16, 2024
    Copy the full SHA
    f889a24 View commit details

Commits on Dec 18, 2024

  1. patch(deps): update module modernc.org/sqlite to v1.34.3 (#432)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 18, 2024
    Copy the full SHA
    61d1a8f View commit details

Commits on Dec 22, 2024

  1. patch(deps): update module modernc.org/sqlite to v1.34.4 (#434)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Dec 22, 2024
    Copy the full SHA
    32c4e58 View commit details

Commits on Dec 23, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Dec 23, 2024
    Copy the full SHA
    73d4fa9 View commit details

Commits on Dec 30, 2024

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Dec 30, 2024
    Copy the full SHA
    515e7b3 View commit details

Commits on Jan 3, 2025

  1. minor(deps): update module github.com/bradleyfalzon/ghinstallation/v2…

    … to v2.13.0 (#436)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 3, 2025
    Copy the full SHA
    cb2df6d View commit details

Commits on Jan 4, 2025

  1. minor(deps): update module golang.org/x/oauth2 to v0.25.0 (#437)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 4, 2025
    Copy the full SHA
    b2d3f60 View commit details

Commits on Jan 6, 2025

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Jan 6, 2025
    Copy the full SHA
    61fbfdc View commit details
  2. major(deps): update major versions (major) (#433)

    * major(deps): update major versions
    
    * fix: add compat for new backoff version
    
    ---------
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Thomas Boerger <thomas@webhippie.de>
    renovate[bot] and tboerger authored Jan 6, 2025
    Copy the full SHA
    60d1d0d View commit details

Commits on Jan 7, 2025

  1. chore(deps): update docker digests (#438)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 7, 2025
    Copy the full SHA
    2fdf1d7 View commit details

Commits on Jan 8, 2025

  1. chore(deps): update docker digests (#439)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 8, 2025
    Copy the full SHA
    c541511 View commit details

Commits on Jan 13, 2025

  1. chore(flake): updated lockfile [skip ci]

    Signed-off-by: GitHub Actions <github@webhippie.de>
    GitHub Actions committed Jan 13, 2025
    Copy the full SHA
    0066c95 View commit details

Commits on Jan 16, 2025

  1. patch(deps): update module modernc.org/sqlite to v1.34.5 (#440)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 16, 2025
    Copy the full SHA
    92e370d View commit details
2 changes: 1 addition & 1 deletion docker/Dockerfile.linux.386
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM i386/alpine:3.20@sha256:b3e87f642f5c48cdc7556c3e03a0d63916bd0055ba6edba7773df3cb1a76f224 AS build
FROM i386/alpine:3.21@sha256:483a843f6d421ef80be40d739461a762bfa12d5f2327151835326d4e7f6ae189 AS build
RUN apk add --no-cache ca-certificates mailcap

FROM scratch
2 changes: 1 addition & 1 deletion docker/Dockerfile.linux.amd64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amd64/alpine:3.20@sha256:33735bd63cf84d7e388d9f6d297d348c523c044410f553bd878c6d7829612735 AS build
FROM amd64/alpine:3.21@sha256:b7adcabf8c8320af2f49b10a8ba9336f2a286d7d3f647533c638732c73e00f20 AS build
RUN apk add --no-cache ca-certificates mailcap

FROM scratch
2 changes: 1 addition & 1 deletion docker/Dockerfile.linux.arm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM arm32v6/alpine:3.20@sha256:50f635c8b04d86dde8a02bcd8d667ba287eb8b318c1c0cf547e5a48ddadea1be AS build
FROM arm32v6/alpine:3.21@sha256:2c2afdf9c980373d45dd1ae735da4a649b6e01dccd126d4028ed68ae9c5ffdbe AS build
RUN apk add --no-cache ca-certificates mailcap

FROM scratch
2 changes: 1 addition & 1 deletion docker/Dockerfile.linux.arm64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM arm64v8/alpine:3.20@sha256:9cee2b382fe2412cd77d5d437d15a93da8de373813621f2e4d406e3df0cf0e7c AS build
FROM arm64v8/alpine:3.21@sha256:027789c1e8530f46d8211da2debc3f927eab8387ee2bb3922e466005d53cb0fe AS build
RUN apk add --no-cache ca-certificates mailcap

FROM scratch
4 changes: 2 additions & 2 deletions docs/content/webhook.md
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@ should be correctly parsed by the exporter.
configured the exporter, mentioned above.

**Which events would you like to trigger this webhook** got to be set to
`Let me select individual events` where you just got to check the last item
`Workflow runs`.
`Let me select individual events` where you just got to check the last two items
`Workflow runs` and `Workflow jobs` (If you want to enable the workflow job collector).

After hitting the **Add webhook** button you are ready to receive first webhooks
by GitHub. It should also show that the initial test webhook have been executed
548 changes: 69 additions & 479 deletions flake.lock

Large diffs are not rendered by default.

37 changes: 16 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -4,23 +4,23 @@ go 1.23.0

require (
github.com/GuiaBolso/darwin v0.0.0-20191218124601-fd6d2aa3d244
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
github.com/cenkalti/backoff/v4 v4.3.0
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0
github.com/cenkalti/backoff/v5 v5.0.0
github.com/chaisql/chai v0.16.0
github.com/go-chi/chi/v5 v5.1.0
github.com/go-chi/chi/v5 v5.2.0
github.com/go-sql-driver/mysql v1.8.1
github.com/google/go-github/v66 v66.0.0
github.com/google/go-github/v68 v68.0.0
github.com/jmoiron/sqlx v1.4.0
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.9
github.com/oklog/run v1.1.0
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/exporter-toolkit v0.13.1
github.com/prometheus/exporter-toolkit v0.13.2
github.com/ryanuber/go-glob v1.0.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.27.5
golang.org/x/oauth2 v0.23.0
modernc.org/sqlite v1.33.1
golang.org/x/oauth2 v0.25.0
modernc.org/sqlite v1.34.5
)

require (
@@ -41,13 +41,11 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/getsentry/sentry-go v0.25.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang-module/carbon/v2 v2.2.14 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v62 v62.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
@@ -61,25 +59,22 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.55.3 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
)
70 changes: 32 additions & 38 deletions go.sum
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@ github.com/GuiaBolso/darwin v0.0.0-20191218124601-fd6d2aa3d244 h1:dqzm54OhCqY8Ri
github.com/GuiaBolso/darwin v0.0.0-20191218124601-fd6d2aa3d244/go.mod h1:3sqgkckuISJ5rs1EpOp6vCvwOUKe/z9vPmyuIlq8Q/A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0 h1:R9d0v+iobRHSaE4wKUnXFiZp53AL4ED5MzgEMwGTZag=
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0/go.mod h1:0LWKQwOHewXO/1acI6TtyE0Xc4ObDb2rFN7eHBAG71M=
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0 h1:5FhjW93/YLQJDmPdeyMPw7IjAPzqsr+0jHPfrPz0sZI=
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0/go.mod h1:EJ6fgedVEHa2kUyBTTvslJCXJafS/mhJNNKEOCspZXQ=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v5 v5.0.0 h1:4ziwFuaVJicDO1ah1Nz1aXXV1caM28PFgf1V5TTFXew=
github.com/cenkalti/backoff/v5 v5.0.0/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chaisql/chai v0.16.0 h1:UVvVOcf9H/OfSNRAzH9j1TuJnetUGGqV6gaAXZ8mrjQ=
@@ -62,17 +62,17 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712 h1:aaQcKT9WumO6JEJc
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI=
github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0=
github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-module/carbon/v2 v2.2.14 h1:mT2hpNoCQVnkboZ6iyRf7WCbXtZTRXFBvXXWMp0PaMc=
github.com/golang-module/carbon/v2 v2.2.14/go.mod h1:XDALX7KgqmHk95xyLeaqX9/LJGbfLATyruTziq68SZ8=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@@ -81,18 +81,14 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4=
github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4=
github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M=
github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4=
github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s=
github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo=
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
@@ -138,10 +134,10 @@ github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc=
github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
github.com/prometheus/exporter-toolkit v0.13.1 h1:Evsh0gWQo2bdOHlnz9+0Nm7/OFfIwhE2Ws4A2jIlR04=
github.com/prometheus/exporter-toolkit v0.13.1/go.mod h1:ujdv2YIOxtdFxxqtloLpbqmxd5J0Le6IITUvIRSWjj0=
github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ=
github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s=
github.com/prometheus/exporter-toolkit v0.13.2 h1:Z02fYtbqTMy2i/f+xZ+UK5jy/bl1Ex3ndzh06T/Q9DQ=
github.com/prometheus/exporter-toolkit v0.13.2/go.mod h1:tCqnfx21q6qN1KA4U3Bfb8uWzXfijIrJz3/kTIqMV7g=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
@@ -159,8 +155,8 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
@@ -170,8 +166,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4=
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@@ -182,25 +178,25 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70=
golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
@@ -211,8 +207,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -229,8 +225,6 @@ modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI=
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U=
modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w=
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
@@ -241,8 +235,8 @@ modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM=
modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k=
modernc.org/sqlite v1.34.5 h1:Bb6SR13/fjp15jt70CL4f18JIN7p7dnMExd+UFnF15g=
modernc.org/sqlite v1.34.5/go.mod h1:YLuNmX9NKs8wRNK2ko1LW1NGYcc9FkBO69JOt1AR9JE=
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
2 changes: 1 addition & 1 deletion pkg/action/server.go
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import (

"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/go-chi/chi/v5"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/oklog/run"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/exporter-toolkit/web"
22 changes: 12 additions & 10 deletions pkg/command/command.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"os"
"time"

"github.com/cenkalti/backoff/v4"
"github.com/cenkalti/backoff/v5"
"github.com/promhippie/github_exporter/pkg/action"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
@@ -42,7 +42,7 @@ func Run() error {
Commands: []*cli.Command{
Health(cfg),
},
Action: func(_ *cli.Context) error {
Action: func(c *cli.Context) error {
logger := setupLogger(cfg)
db, err := setupStorage(cfg, logger)

@@ -58,15 +58,16 @@ func Run() error {
defer db.Close()
}

if err := backoff.RetryNotify(
if _, err := backoff.Retry(
c.Context,
db.Open,
backoff.NewExponentialBackOff(),
func(err error, dur time.Duration) {
backoff.WithBackOff(backoff.NewExponentialBackOff()),
backoff.WithNotify(func(err error, dur time.Duration) {
logger.Warn("Database open failed",
"retry", dur,
"error", err,
)
},
}),
); err != nil {
logger.Error("Giving up to connect to database",
"error", err,
@@ -75,15 +76,16 @@ func Run() error {
return err
}

if err := backoff.RetryNotify(
if _, err := backoff.Retry(
c.Context,
db.Ping,
backoff.NewExponentialBackOff(),
func(err error, dur time.Duration) {
backoff.WithBackOff(backoff.NewExponentialBackOff()),
backoff.WithNotify(func(err error, dur time.Duration) {
logger.Warn("Database ping failed",
"retry", dur,
"err", err,
)
},
}),
); err != nil {
logger.Error("Giving up to ping the database",
"error", err,
2 changes: 1 addition & 1 deletion pkg/exporter/admin.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"log/slog"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
2 changes: 1 addition & 1 deletion pkg/exporter/billing.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"log/slog"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
2 changes: 1 addition & 1 deletion pkg/exporter/helper.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
)

func closeBody(resp *github.Response) {
2 changes: 1 addition & 1 deletion pkg/exporter/org.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"log/slog"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"

"github.com/promhippie/github_exporter/pkg/config"
2 changes: 1 addition & 1 deletion pkg/exporter/repo.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
2 changes: 1 addition & 1 deletion pkg/exporter/runner.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
2 changes: 1 addition & 1 deletion pkg/exporter/workflow_job.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"log/slog"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
10 changes: 5 additions & 5 deletions pkg/exporter/workflow_job_test.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
@@ -52,16 +52,16 @@ func (s StaticStore) PruneWorkflowJobs(time.Duration) error {
return nil
}

func (s StaticStore) Open() error {
return nil
func (s StaticStore) Open() (bool, error) {
return true, nil
}

func (s StaticStore) Close() error {
return nil
}

func (s StaticStore) Ping() error {
return nil
func (s StaticStore) Ping() (bool, error) {
return true, nil
}

func (s StaticStore) Migrate() error {
2 changes: 1 addition & 1 deletion pkg/exporter/workflow_run.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"log/slog"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/prometheus/client_golang/prometheus"
"github.com/promhippie/github_exporter/pkg/config"
"github.com/promhippie/github_exporter/pkg/store"
16 changes: 10 additions & 6 deletions pkg/store/chai.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import (
"time"

"github.com/GuiaBolso/darwin"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/jmoiron/sqlx"
"github.com/promhippie/github_exporter/pkg/migration/dialect"

@@ -91,17 +91,17 @@ type chaiStore struct {
}

// Open simply opens the database connection.
func (s *chaiStore) Open() (err error) {
func (s *chaiStore) Open() (res bool, err error) {
s.handle, err = sqlx.Open(
s.driver,
s.dsn(),
)

if err != nil {
return err
return false, err
}

return nil
return true, nil
}

// Close simply closes the database connection.
@@ -110,8 +110,12 @@ func (s *chaiStore) Close() error {
}

// Ping just tests the database connection.
func (s *chaiStore) Ping() error {
return s.handle.Ping()
func (s *chaiStore) Ping() (bool, error) {
if err := s.handle.Ping(); err != nil {
return false, err
}

return true, nil
}

// Migrate executes required db migrations.
2 changes: 1 addition & 1 deletion pkg/store/generic_workflow_job.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (
"strings"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/jmoiron/sqlx"
)

2 changes: 1 addition & 1 deletion pkg/store/generic_workflow_run.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/jmoiron/sqlx"
)

16 changes: 10 additions & 6 deletions pkg/store/mysql.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import (
"time"

"github.com/GuiaBolso/darwin"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/jmoiron/sqlx"
"github.com/promhippie/github_exporter/pkg/migration/dialect"

@@ -98,21 +98,21 @@ type mysqlStore struct {
}

// Open simply opens the database connection.
func (s *mysqlStore) Open() (err error) {
func (s *mysqlStore) Open() (res bool, err error) {
s.handle, err = sqlx.Open(
s.driver,
s.dsn(),
)

if err != nil {
return err
return false, err
}

s.handle.SetMaxOpenConns(s.maxOpenConns)
s.handle.SetMaxIdleConns(s.maxIdleConns)
s.handle.SetConnMaxLifetime(s.connMaxLifetime)

return nil
return true, nil
}

// Close simply closes the database connection.
@@ -121,8 +121,12 @@ func (s *mysqlStore) Close() error {
}

// Ping just tests the database connection.
func (s *mysqlStore) Ping() error {
return s.handle.Ping()
func (s *mysqlStore) Ping() (bool, error) {
if err := s.handle.Ping(); err != nil {
return false, err
}

return true, nil
}

// Migrate executes required db migrations.
20 changes: 12 additions & 8 deletions pkg/store/postgres.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import (
"time"

"github.com/GuiaBolso/darwin"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/jmoiron/sqlx"
"github.com/promhippie/github_exporter/pkg/migration/dialect"

@@ -76,12 +76,12 @@ var (
{
Version: 4,
Description: "Fix identifier be BIGINT",
Script: `ALTER TABLE workflow_jobs ALTER COLUMN identifier TYPE BIGINT USING identifier::BIGINT;`,
Script: `ALTER TABLE workflow_jobs ALTER COLUMN identifier TYPE BIGINT USING identifier::BIGINT;`,
},
{
Version: 5,
Description: "Fix run_id be BIGINT",
Script: `ALTER TABLE workflow_jobs ALTER COLUMN run_id TYPE BIGINT USING run_id::BIGINT;`,
Script: `ALTER TABLE workflow_jobs ALTER COLUMN run_id TYPE BIGINT USING run_id::BIGINT;`,
},
}
)
@@ -108,21 +108,21 @@ type postgresStore struct {
}

// Open simply opens the database connection.
func (s *postgresStore) Open() (err error) {
func (s *postgresStore) Open() (res bool, err error) {
s.handle, err = sqlx.Open(
s.driver,
s.dsn(),
)

if err != nil {
return err
return false, err
}

s.handle.SetMaxOpenConns(s.maxOpenConns)
s.handle.SetMaxIdleConns(s.maxIdleConns)
s.handle.SetConnMaxLifetime(s.connMaxLifetime)

return nil
return true, nil
}

// Close simply closes the database connection.
@@ -131,8 +131,12 @@ func (s *postgresStore) Close() error {
}

// Ping just tests the database connection.
func (s *postgresStore) Ping() error {
return s.handle.Ping()
func (s *postgresStore) Ping() (bool, error) {
if err := s.handle.Ping(); err != nil {
return false, err
}

return true, nil
}

// Migrate executes required db migrations.
18 changes: 11 additions & 7 deletions pkg/store/sqlite.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
"time"

"github.com/GuiaBolso/darwin"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/jmoiron/sqlx"
"github.com/promhippie/github_exporter/pkg/migration/dialect"

@@ -92,10 +92,10 @@ func init() {
}

// Open simply opens the database connection.
func (s *sqliteStore) Open() (err error) {
func (s *sqliteStore) Open() (res bool, err error) {
if dir := path.Dir(s.database); dir != "." {
if err := os.MkdirAll(dir, 0770); err != nil {
return fmt.Errorf("failed to create database dir: %w", err)
return false, fmt.Errorf("failed to create database dir: %w", err)
}
}

@@ -105,10 +105,10 @@ func (s *sqliteStore) Open() (err error) {
)

if err != nil {
return err
return false, err
}

return nil
return true, nil
}

// Close simply closes the database connection.
@@ -117,8 +117,12 @@ func (s *sqliteStore) Close() error {
}

// Ping just tests the database connection.
func (s *sqliteStore) Ping() error {
return s.handle.Ping()
func (s *sqliteStore) Ping() (bool, error) {
if err := s.handle.Ping(); err != nil {
return false, err
}

return true, nil
}

// Migrate executes required db migrations.
6 changes: 3 additions & 3 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
)

var (
@@ -31,9 +31,9 @@ type Store interface {
GetWorkflowJobs() ([]*WorkflowJob, error)
PruneWorkflowJobs(time.Duration) error

Open() error
Open() (bool, error)
Close() error
Ping() error
Ping() (bool, error)
Migrate() error
}