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: prometheus/common
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.44.0
Choose a base ref
...
head repository: prometheus/common
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.55.0
Choose a head ref

Commits on May 15, 2023

  1. config: allow exposing real secret value through marshal

    There are external projects out there that marshal/unmarshal the
    Prometheus config that has secrets. To get the real value currently such
    horrible workarounds are in place:
    https://github.com/tkestack/kvass/blob/master/pkg/sidecar/injector.go#L175-L214
    
    Let's add a way to get the original values through the `Secret` type to
    avoid such things.
    
    Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
    GiedriusS committed May 15, 2023
    Copy the full SHA
    5ad26bf View commit details

Commits on Jun 18, 2023

  1. Update common Prometheus files

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot committed Jun 18, 2023
    Copy the full SHA
    dc8a02e View commit details

Commits on Aug 1, 2023

  1. Bump golang.org/x/net from 0.10.0 to 0.12.0

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.12.0.
    - [Commits](golang/net@v0.10.0...v0.12.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Aug 1, 2023
    Copy the full SHA
    162098f View commit details

Commits on Aug 24, 2023

  1. Adding support for file based configuration of basic auth in http cli…

    …ent config.
    
    Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
    wasim-nihal committed Aug 24, 2023
    Copy the full SHA
    dbdf15f View commit details

Commits on Sep 2, 2023

  1. Adding support for file based configuration of basic auth in http cli…

    …ent config.
    
    Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
    wasim-nihal committed Sep 2, 2023
    Copy the full SHA
    06c301c View commit details
  2. Update config/http_config.go

    Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
    Signed-off-by: Nihal <38865967+wasim-nihal@users.noreply.github.com>
    wasim-nihal and Julien Pivotto authored Sep 2, 2023
    Copy the full SHA
    0b1d03c View commit details
  3. Update config/http_config.go

    Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
    Signed-off-by: Nihal <38865967+wasim-nihal@users.noreply.github.com>
    wasim-nihal and Julien Pivotto authored Sep 2, 2023
    Copy the full SHA
    0af702d View commit details
  4. Merge branch 'username-file-12576' of https://github.com/wasim-nihal/…

    …common into username-file-12576
    
    Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
    wasim-nihal committed Sep 2, 2023
    Copy the full SHA
    707c0a9 View commit details
  5. Merge branch 'username-file-12576' of https://github.com/wasim-nihal/…

    …common into username-file-12576
    
    Signed-off-by: Wasim Nihal <sswasim64@gmail.com>
    wasim-nihal committed Sep 2, 2023
    Copy the full SHA
    e79ab68 View commit details
  6. Copy the full SHA
    ed1ca57 View commit details

Commits on Sep 4, 2023

  1. Merge pull request #511 from wasim-nihal/username-file-12576

    Adding support for file based configuration of basic auth username in http client config
    Julien Pivotto authored Sep 4, 2023
    Copy the full SHA
    4047c78 View commit details

Commits on Sep 8, 2023

  1. Merge pull request #507 from prometheus/dependabot/go_modules/golang.…

    …org/x/net-0.12.0
    
    Bump golang.org/x/net from 0.10.0 to 0.12.0
    Julien Pivotto authored Sep 8, 2023
    Copy the full SHA
    fa9dcdd View commit details

Commits on Sep 13, 2023

  1. Add read-only token permissions

    Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
    pnacht authored and discordianfish committed Sep 13, 2023
    Copy the full SHA
    86487d4 View commit details

Commits on Sep 28, 2023

  1. Merge pull request #495 from prometheus/repo_sync

    Synchronize common files from prometheus/prometheus
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    4e8cb35 View commit details
  2. Update client_golang

    * Update for Go 1.21.
    * Update client_golang.
    
    Signed-off-by: SuperQ <superq@gmail.com>
    SuperQ committed Sep 28, 2023
    Copy the full SHA
    9510d8d View commit details
  3. Merge pull request #513 from prometheus/superq/client_go

    Update client_golang
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    bd35fdb View commit details
  4. Bump golang.org/x/oauth2 from 0.8.0 to 0.12.0

    Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.8.0 to 0.12.0.
    - [Commits](golang/oauth2@v0.8.0...v0.12.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/oauth2
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 28, 2023
    Copy the full SHA
    2e29438 View commit details
  5. Merge pull request #514 from prometheus/dependabot/go_modules/golang.…

    …org/x/oauth2-0.12.0
    
    Bump golang.org/x/oauth2 from 0.8.0 to 0.12.0
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    29293ef View commit details
  6. Bump github.com/aws/aws-sdk-go from 1.44.266 to 1.45.18 in /sigv4

    Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.266 to 1.45.18.
    - [Release notes](https://github.com/aws/aws-sdk-go/releases)
    - [Commits](aws/aws-sdk-go@v1.44.266...v1.45.18)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/aws/aws-sdk-go
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 28, 2023
    Copy the full SHA
    68bf7ee View commit details
  7. Merge pull request #515 from prometheus/dependabot/go_modules/sigv4/g…

    …ithub.com/aws/aws-sdk-go-1.45.18
    
    Bump github.com/aws/aws-sdk-go from 1.44.266 to 1.45.18 in /sigv4
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    c3da61d View commit details
  8. Bump github.com/prometheus/client_golang from 1.15.1 to 1.17.0 in /sigv4

    Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.17.0.
    - [Release notes](https://github.com/prometheus/client_golang/releases)
    - [Changelog](https://github.com/prometheus/client_golang/blob/v1.17.0/CHANGELOG.md)
    - [Commits](prometheus/client_golang@v1.15.1...v1.17.0)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/prometheus/client_golang
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 28, 2023
    Copy the full SHA
    78c4467 View commit details
  9. Merge pull request #516 from prometheus/dependabot/go_modules/sigv4/g…

    …ithub.com/prometheus/client_golang-1.17.0
    
    Signed-off-by: Ben Kochie <superq@gmail.com>
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    806bab7 View commit details
  10. Bump github.com/stretchr/testify from 1.8.2 to 1.8.4 in /sigv4

    Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.4.
    - [Release notes](https://github.com/stretchr/testify/releases)
    - [Commits](stretchr/testify@v1.8.2...v1.8.4)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/stretchr/testify
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 28, 2023
    Copy the full SHA
    3d03105 View commit details
  11. Merge pull request #493 from prometheus/dependabot/go_modules/sigv4/g…

    …ithub.com/stretchr/testify-1.8.4
    
    Bump github.com/stretchr/testify from 1.8.2 to 1.8.4 in /sigv4
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    538e36f View commit details
  12. Add golangci-lint config

    Enable additional linters.
    
    Signed-off-by: SuperQ <superq@gmail.com>
    SuperQ committed Sep 28, 2023
    Copy the full SHA
    8a72a0c View commit details
  13. Update golang_protobuf_extensions to v2

    Updated github.com/matttproud/golang_protobuf_extensions/v2
    Use common from master in sigv4
    
    Signed-off-by: Neo2308 <pradha.krishna.cse17@itbhu.ac.in>
    Neo2308 committed Sep 28, 2023
    Copy the full SHA
    6fa8c32 View commit details
  14. Merge pull request #509 from Neo2308/feature/master/move-to-protobuf-…

    …extensions-v2
    
    Update golang_protobuf_extensions to v2
    SuperQ authored Sep 28, 2023
    Copy the full SHA
    2dfcc43 View commit details
  15. Update common Prometheus files

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot committed Sep 28, 2023
    Copy the full SHA
    777f9cc View commit details

Commits on Sep 29, 2023

  1. Merge pull request #518 from prometheus/repo_sync

    Synchronize common files from prometheus/prometheus
    SuperQ authored Sep 29, 2023
    Copy the full SHA
    ac62eb7 View commit details

Commits on Oct 1, 2023

  1. Bump github.com/aws/aws-sdk-go from 1.45.18 to 1.45.19 in /sigv4

    Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.18 to 1.45.19.
    - [Release notes](https://github.com/aws/aws-sdk-go/releases)
    - [Commits](aws/aws-sdk-go@v1.45.18...v1.45.19)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/aws/aws-sdk-go
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 1, 2023
    Copy the full SHA
    eb60b9b View commit details

Commits on Oct 2, 2023

  1. Merge pull request #519 from prometheus/dependabot/go_modules/sigv4/g…

    …ithub.com/aws/aws-sdk-go-1.45.19
    
    Bump github.com/aws/aws-sdk-go from 1.45.18 to 1.45.19 in /sigv4
    SuperQ authored Oct 2, 2023
    Copy the full SHA
    f4e05c0 View commit details
  2. Update common Prometheus files

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot committed Oct 2, 2023
    Copy the full SHA
    b6914dd View commit details

Commits on Oct 3, 2023

  1. Merge pull request #520 from prometheus/repo_sync

    Synchronize common files from prometheus/prometheus
    SuperQ authored Oct 3, 2023
    Copy the full SHA
    7043ea0 View commit details

Commits on Oct 11, 2023

  1. Bump golang.org/x/net from 0.15.0 to 0.17.0 in /sigv4

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.17.0.
    - [Commits](golang/net@v0.15.0...v0.17.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 11, 2023
    Copy the full SHA
    ff99062 View commit details

Commits on Oct 16, 2023

  1. Merge pull request #525 from prometheus/dependabot/go_modules/sigv4/g…

    …olang.org/x/net-0.17.0
    
    Bump golang.org/x/net from 0.15.0 to 0.17.0 in /sigv4
    SuperQ authored Oct 16, 2023
    Copy the full SHA
    16f9480 View commit details
  2. Bump golang.org/x/net from 0.15.0 to 0.17.0

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.17.0.
    - [Commits](golang/net@v0.15.0...v0.17.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 16, 2023
    Copy the full SHA
    1f9b004 View commit details

Commits on Oct 18, 2023

  1. Merge pull request #524 from prometheus/dependabot/go_modules/golang.…

    …org/x/net-0.17.0
    
    Bump golang.org/x/net from 0.15.0 to 0.17.0
    SuperQ authored Oct 18, 2023
    Copy the full SHA
    c59927e View commit details
  2. Merge pull request #517 from prometheus/superq/golangci

    Add golangci-lint config
    SuperQ authored Oct 18, 2023
    Copy the full SHA
    6ff0400 View commit details

Commits on Nov 1, 2023

  1. Bump github.com/aws/aws-sdk-go from 1.45.19 to 1.47.0 in /sigv4

    Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.19 to 1.47.0.
    - [Release notes](https://github.com/aws/aws-sdk-go/releases)
    - [Commits](aws/aws-sdk-go@v1.45.19...v1.47.0)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/aws/aws-sdk-go
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Nov 1, 2023
    Copy the full SHA
    f0d19ff View commit details

Commits on Nov 3, 2023

  1. Update common Prometheus files

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot committed Nov 3, 2023
    Copy the full SHA
    fbbe75a View commit details

Commits on Nov 22, 2023

  1. model: add metric type values

    To centralise these definitions.
    
    Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
    bboreham committed Nov 22, 2023
    Copy the full SHA
    445c210 View commit details
  2. Merge pull request #533 from prometheus/metadata

    model: add metric type values
    Julien Pivotto authored Nov 22, 2023
    Copy the full SHA
    832cd6e View commit details
  3. Merge pull request #532 from prometheus/repo_sync

    Synchronize common files from prometheus/prometheus
    SuperQ authored Nov 22, 2023
    Copy the full SHA
    00ee8d3 View commit details
  4. Merge pull request #529 from prometheus/dependabot/go_modules/sigv4/g…

    …ithub.com/aws/aws-sdk-go-1.47.0
    
    Bump github.com/aws/aws-sdk-go from 1.45.19 to 1.47.0 in /sigv4
    SuperQ authored Nov 22, 2023
    Copy the full SHA
    64159df View commit details
  5. Update modules

    Update modules in both root and sigv4 to avoid test failures.
    
    Signed-off-by: SuperQ <superq@gmail.com>
    SuperQ committed Nov 22, 2023
    Copy the full SHA
    de26626 View commit details

Commits on Nov 23, 2023

  1. Merge pull request #534 from prometheus/superq/client_model

    Update modules
    SuperQ authored Nov 23, 2023
    Copy the full SHA
    de1c963 View commit details
  2. Update common Prometheus files

    Signed-off-by: prombot <prometheus-team@googlegroups.com>
    prombot committed Nov 23, 2023
    Copy the full SHA
    36e2952 View commit details

Commits on Nov 24, 2023

  1. Merge pull request #535 from prometheus/repo_sync

    Synchronize common files from prometheus/prometheus
    SuperQ authored Nov 24, 2023
    Copy the full SHA
    1d8c672 View commit details

Commits on Dec 1, 2023

  1. Bump github.com/aws/aws-sdk-go from 1.47.0 to 1.48.10 in /sigv4

    Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.47.0 to 1.48.10.
    - [Release notes](https://github.com/aws/aws-sdk-go/releases)
    - [Commits](aws/aws-sdk-go@v1.47.0...v1.48.10)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/aws/aws-sdk-go
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Dec 1, 2023
    Copy the full SHA
    e888263 View commit details
  2. Bump golang.org/x/net from 0.18.0 to 0.19.0

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.18.0 to 0.19.0.
    - [Commits](golang/net@v0.18.0...v0.19.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Dec 1, 2023
    Copy the full SHA
    1f5a74c View commit details
Showing with 4,933 additions and 1,595 deletions.
  1. +4 −4 .circleci/config.yml
  2. +15 −6 .github/workflows/golangci-lint.yml
  3. +41 −0 .golangci.yml
  4. +3 −2 .yamllint
  5. +2 −0 MAINTAINERS.md
  6. +17 −9 Makefile.common
  7. +18 −0 RELEASE.md
  8. +1 −1 assets/go.mod
  9. +13 −2 config/config.go
  10. +50 −26 config/config_test.go
  11. +3 −4 config/generate.go
  12. +140 −0 config/headers.go
  13. +15 −9 version/info_default.go → config/headers_test.go
  14. +509 −248 config/http_config.go
  15. +617 −169 config/http_config_test.go
  16. +1 −0 config/testdata/basic-auth-username
  17. +1 −0 config/testdata/headers-file
  18. +3 −0 config/testdata/headers-file-a
  19. +1 −0 config/testdata/headers-file-b
  20. +1 −0 config/testdata/headers-file-c
  21. +4 −0 config/testdata/http.conf.basic-auth.bad-username.yaml
  22. +3 −0 config/testdata/http.conf.basic-auth.ref.yaml
  23. +3 −0 config/testdata/http.conf.basic-auth.username-file.good.yaml
  24. +8 −0 config/testdata/http.conf.headers-multiple.good.yaml
  25. +3 −0 config/testdata/http.conf.headers-reserved.bad.yaml
  26. +7 −0 config/testdata/http.conf.headers.good.yaml
  27. +0 −3 config/testdata/http.conf.oauth2-no-client-secret.bad.yaml
  28. +19 −12 config/tls_config_test.go
  29. +22 −10 expfmt/bench_test.go
  30. +17 −14 expfmt/decode.go
  31. +92 −19 expfmt/decode_test.go
  32. +60 −27 expfmt/encode.go
  33. +240 −21 expfmt/encode_test.go
  34. +144 −10 expfmt/expfmt.go
  35. +129 −0 expfmt/expfmt_test.go
  36. +226 −57 expfmt/openmetrics_create.go
  37. +403 −79 expfmt/openmetrics_create_test.go
  38. BIN expfmt/testdata/protobuf-multimessage
  39. +87 −31 expfmt/text_create.go
  40. +120 −69 expfmt/text_create_test.go
  41. +5 −3 expfmt/text_parse.go
  42. +52 −53 expfmt/text_parse_test.go
  43. +18 −13 go.mod
  44. +26 −40 go.sum
  45. +123 −0 helpers/templates/time.go
  46. +123 −0 helpers/templates/time_test.go
  47. +0 −67 internal/bitbucket.org/ww/goautoneg/README.txt
  48. +0 −160 internal/bitbucket.org/ww/goautoneg/autoneg.go
  49. +0 −71 internal/bitbucket.org/ww/goautoneg/autoneg_test.go
  50. +28 −3 model/alert.go
  51. +90 −7 model/alert_test.go
  52. +0 −2 model/fingerprinting_test.go
  53. +15 −7 model/labels.go
  54. +44 −25 model/labels_test.go
  55. +0 −11 model/labelset.go
  56. +144 −0 model/labelset_go120_test.go
  57. +45 −0 model/labelset_string.go
  58. +39 −0 model/labelset_string_go120.go
  59. +59 −3 model/labelset_test.go
  60. +28 −0 model/metadata.go
  61. +362 −7 model/metric.go
  62. +472 −29 model/metric_test.go
  63. +2 −4 model/signature.go
  64. +7 −7 model/signature_test.go
  65. +1 −1 model/silence.go
  66. +47 −17 model/silence_test.go
  67. +28 −18 model/time_test.go
  68. +7 −9 model/value.go
  69. +6 −8 model/value_float.go
  70. +0 −1 model/value_test.go
  71. +9 −4 promlog/flag/flag.go
  72. +3 −0 promlog/log.go
  73. +0 −1 server/static_file_server_test.go
  74. +15 −15 sigv4/go.mod
  75. +23 −72 sigv4/go.sum
  76. +10 −2 sigv4/sigv4.go
  77. +6 −5 sigv4/sigv4_config.go
  78. +1 −0 sigv4/testdata/sigv4_good.yaml
  79. +53 −31 version/info.go
  80. +0 −67 version/info_go118.go
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -95,15 +95,15 @@ workflows:
matrix:
parameters:
go_version:
- "1.18"
- "1.19"
- "1.20"
- "1.21"
- "1.22"
- test-assets:
name: assets-go-<< matrix.go_version >>
matrix:
parameters:
go_version:
- "1.20"
- "1.22"
- style:
name: style
go_version: "1.20"
go_version: "1.22"
21 changes: 15 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
# This action is synced from https://github.com/prometheus/prometheus
name: golangci-lint
on:
push:
@@ -10,21 +12,28 @@ on:
- ".golangci.yml"
pull_request:

permissions: # added using https://github.com/step-security/secure-repo
contents: read

jobs:
golangci:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: install Go
uses: actions/setup-go@v2
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.20.x
go-version: 1.22.x
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@v3.4.0
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
with:
version: v1.51.2
args: --verbose
version: v1.59.1
41 changes: 41 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable:
- errcheck
- errorlint
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- revive
- staticcheck
- testifylint
- unused
linters-settings:
goimports:
local-prefixes: github.com/prometheus/common
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true
testifylint:
disable:
- float-compare
- go-require
enable:
- bool-compare
- compares
- empty
- error-is-as
- error-nil
- expected-actual
- len
- require-error
- suite-dont-use-pkg
- suite-extra-assert-call
5 changes: 3 additions & 2 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
extends: default
ignore: |
ui/react-app/node_modules

rules:
braces:
@@ -20,5 +22,4 @@ rules:
config/testdata/section_key_dup.bad.yml
line-length: disable
truthy:
ignore: |
.github/workflows/*.yml
check-keys: false
2 changes: 2 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* Julien Pivotto <roidelapluie@prometheus.io> @roidelapluie
* Josue (Josh) Abreu <josue.abreu@gmail.com> @gotjosh
* Arthur Sens <arthur@prometheus.io> @ArthurSens
26 changes: 17 additions & 9 deletions Makefile.common
Original file line number Diff line number Diff line change
@@ -49,23 +49,23 @@ endif
GOTEST := $(GO) test
GOTEST_DIR :=
ifneq ($(CIRCLE_JOB),)
ifneq ($(shell which gotestsum),)
ifneq ($(shell command -v gotestsum 2> /dev/null),)
GOTEST_DIR := test-results
GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
endif
endif

PROMU_VERSION ?= 0.14.0
PROMU_VERSION ?= 0.17.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz

SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.51.2
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
GOLANGCI_LINT_VERSION ?= v1.59.1
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64))
# If we're in CI and there is an Actions file, that means the linter
# is being run in Actions, so we don't need to run it here.
ifneq (,$(SKIP_GOLANGCI_LINT))
@@ -169,16 +169,20 @@ common-vet:
common-lint: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint"
# 'go list' needs to be executed before staticcheck to prepopulate the modules cache.
# Otherwise staticcheck might fail randomly for some reason not yet explained.
$(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs)
endif

.PHONY: common-lint-fix
common-lint-fix: $(GOLANGCI_LINT)
ifdef GOLANGCI_LINT
@echo ">> running golangci-lint fix"
$(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs)
endif

.PHONY: common-yamllint
common-yamllint:
@echo ">> running yamllint on all YAML files in the repository"
ifeq (, $(shell which yamllint))
ifeq (, $(shell command -v yamllint 2> /dev/null))
@echo "yamllint not installed so skipping"
else
yamllint .
@@ -204,6 +208,10 @@ common-tarball: promu
@echo ">> building release tarball"
$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)

.PHONY: common-docker-repo-name
common-docker-repo-name:
@echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)"

.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
common-docker: $(BUILD_DOCKER_ARCHS)
$(BUILD_DOCKER_ARCHS): common-docker-%:
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Releases

## What to do know before cutting a release

While `prometheus/common` does not have a formal release process. We strongly encourage you follow these steps:

1. Scan the list of available issues / PRs and make sure that You attempt to merge any pull requests that appear to be ready or almost ready
2. Notify the maintainers listed as part of [`MANTAINERS.md`](MAINTAINERS.md) that you're going to do a release.

With those steps done, you can proceed to cut a release.

## How to cut an individual release

There is no automated process for cutting a release in `prometheus/common`. A manual release using GitHub's release feature via [this link](https://github.com/prometheus/prometheus/releases/new) is the best way to go. The tag name must be prefixed with a `v` e.g. `v0.53.0` and then you can use the "Generate release notes" button to generate the release note automagically ✨. No need to create a discussion or mark it a pre-release, please do mark it as the latest release if needed.

## Versioning strategy

We aim to adhere to [Semantic Versioning](https://semver.org/) as much as possible. For example, patch version (e.g. v0.0.x) releases should contain bugfixes only and any sort of major or minor version bump should be a minor or major release respectively.
2 changes: 1 addition & 1 deletion assets/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/prometheus/common/assets

go 1.18
go 1.20
15 changes: 13 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -27,8 +27,16 @@ const secretToken = "<secret>"
// Secret special type for storing secrets.
type Secret string

// MarshalSecretValue if set to true will expose Secret type
// through the marshal interfaces. Useful for outside projects
// that load and marshal the Prometheus config.
var MarshalSecretValue bool = false

// MarshalYAML implements the yaml.Marshaler interface for Secrets.
func (s Secret) MarshalYAML() (interface{}, error) {
if MarshalSecretValue {
return string(s), nil
}
if s != "" {
return secretToken, nil
}
@@ -43,15 +51,18 @@ func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error {

// MarshalJSON implements the json.Marshaler interface for Secret.
func (s Secret) MarshalJSON() ([]byte, error) {
if MarshalSecretValue {
return json.Marshal(string(s))
}
if len(s) == 0 {
return json.Marshal("")
}
return json.Marshal(secretToken)
}

type Header map[string][]Secret
type ProxyHeader map[string][]Secret

func (h *Header) HTTPHeader() http.Header {
func (h *ProxyHeader) HTTPHeader() http.Header {
if h == nil || *h == nil {
return nil
}
Loading