124 Commits

Author SHA1 Message Date
Ganesh Vernekar
ccc3062521 Merge branch 'main' into codesome/merge-3.10
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2026-02-25 17:33:06 -08:00
Ben Kochie
8f1f1f3146
Update CI (#18173)
* Bump promu to latest release.
* Update actions/checkout.
* Update Go to 1.26.x for golangci-lint in synced repos.
* Improve golangci-lint push filter for synced repos.

Signed-off-by: SuperQ <superq@gmail.com>
2026-02-23 15:25:09 +01:00
Julien Pivotto
6acbd1aa42 chore(ci): Add registry-specific architecture exclusions
Fixes #18123

Introduces DOCKER_REGISTRY_ARCH_EXCLUSIONS to exclude specific
architectures from specific registries. This allows riscv64 to be
excluded from quay.io (which returns unauthorized) while still
supporting it on docker.io.

The new registry_arch_is_excluded function extracts the registry
from DOCKER_REPO and checks if registry:arch is in the exclusion
list. This is applied during push, tag, and manifest creation steps.

This fix ensures s390x and other architectures are included in
quay.io manifests even when riscv64 fails to push.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-20 12:32:34 +01:00
Matthieu MOREL
addc3dcb47 chore: enable staticcheck linter and update golangci-lint to 2.10.1
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-02-18 15:58:16 +00:00
Julien Pivotto
debc951f2a chore: Exclude riskv64 from distroless images
Upstream distroless does not support riskv64 yet

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-18 15:25:34 +01:00
Ganesh Vernekar
631282ac18 Upgrade golangci-lint to v2.9.0
Signed-off-by: Ganesh Vernekar <ganesh.vernekar@reddit.com>
2026-02-11 13:46:41 -08:00
Julien
8e6b097560
Merge pull request #17892 from roidelapluie/roidelapluie/pushver
Makefile.common: Push major version tags to registry
2026-01-22 11:50:57 +01:00
Julien Pivotto
01637b47b0 Fix multi-arch support for distroless Docker image
The distroless Dockerfile was using a hardcoded SHA256 digest that
referenced only the amd64 image, preventing builds for other
architectures. This caused the main-distroless tag to only publish
amd64 images while the regular main tag had all 5 architectures.

Changes:
- Use architecture-specific image tags (nonroot-${DISTROLESS_ARCH})
  instead of SHA256 digest to enable multi-arch manifest resolution
- Add DISTROLESS_ARCH build arg to handle architecture name mapping
  (armv7 -> arm) between Prometheus and distroless conventions
- Move ARG declarations before FROM to support variable substitution

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-19 15:58:37 +01:00
Julien Pivotto
adaf139826 Makefile.common: Push major version tags to registry
In commit 74775d732 "Add major version tag (#8026)" from 2020, the
docker-tag-latest target was updated to create major version tags
(v2, v3, etc.) but these tags were never actually pushed to the
registry. They existed locally only after tagging but were never
published.

This commit fixes the issue by:
- Adding logic to docker-publish to push major version tags when
  DOCKER_IMAGE_TAG="latest" (triggered by promci during releases)
- Adding logic to docker-manifest to create major version manifests
  when DOCKER_IMAGE_TAG="latest"

Pre-release filtering is handled at the promci level, where the regex
check ^v[0-9]+(\.[0-9]+){2}$ already ensures only stable releases
trigger the "latest" tagging workflow.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-19 15:43:35 +01:00
Julien Pivotto
1105c825cf Add distroless Docker image variant
Introduces distroless image using UID/GID 65532 instead of nobody,
and removes VOLUME declaration. Busybox image remains default with
unchanged tags for backwards compatibility.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-19 14:39:59 +01:00
Ben Kochie
e14795bbf4
Remove copyright date from headers (#17785)
Remove copyright dates from various files as part of [PROM-50].

[PROM-50]: https://github.com/prometheus/proposals/blob/main/proposals/0050-remove-copyright-dates.md

Signed-off-by: SuperQ <superq@gmail.com>
2026-01-05 13:46:21 +01:00
Julien Pivotto
a35e19e6cf Makefile.common: Add check for future copyright years
Add validation in common-check_license to detect and reject copyright
headers with years 2026 or later. This enforces the removal of copyright
dates as per https://github.com/prometheus/proposals/blob/main/proposals/0050-remove-copyright-dates.md

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-01-05 11:00:44 +01:00
Ben Kochie
44ed09336d
Update golangci-lint (#17767)
Update golangci-lint to latest.
* Update revive config to ignore package name rules.

Signed-off-by: SuperQ <superq@gmail.com>
2026-01-04 15:18:48 +01:00
dongjiang
3239723098
Update golangci-lint and add modernize check (#17640)
* add modernize check

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* fix golangci lint

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2025-12-05 09:29:10 +01:00
Julien
61f64a4cb1
Makefile.common: Use git ls-files instead of find for license check and style check (#17557)
Also improve find fallback to use -prune for better performance.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-11-20 08:56:39 +01:00
Ben Kochie
204249fcb5
Update golangci-lint (#17478)
* Update golangci-lint to v2.6.0
* Fixup various linting issues.
* Fixup deprecations.
* Add exception for `labels.MetricName` deprecation.

Signed-off-by: SuperQ <superq@gmail.com>
2025-11-05 13:47:34 +01:00
Ayoub Mrini
7416f33df5
chore: define golangci-lint version in a single place and bump to v2.4.0 (#17202)
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2025-09-17 10:52:09 +02:00
Cristian Greco
3a5db2d442
ci: address golangci-lint issue with persist-credentials (#16861)
* ci: address golangci-lint issue with persist-credentials

Fixes the following zizmor warning:

```
warning[artipacked]: credential persistence through GitHub Actions artifacts
  --> scripts/golangci-lint.yml:26:9
   |
26 |         - name: Checkout repository
   |  _________-
27 | |         uses: actions/checkout@11bd71901b # v4.2.2
28 | |         # with:
29 | |         #   persist-credentials: false
   | |______________________________________- does not set persist-credentials: false
```

All other actions have been fixed in https://github.com/prometheus/prometheus/pull/16530

Credit to @jharvey10 who also addressed this particular issue in
a5bf67d897

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* update golangci-lint to v2.2.1

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
2025-07-11 11:53:32 +02:00
Bryan Boreham
2a1093e9be [BUILD] Don't specify -d for go get
It is deprecated; see https://golang.org/doc/go1.18#go-get

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-06-23 14:15:33 +01:00
Ben Kochie
1eaf12e99b
Add golangci-lint fmt (#16602)
With golangci-lint v2, it now has "formatters" that can be configured.
Add `golangci-lint fmt` to the `make format` in Makefile.common.
* Enable goimports formatter.

Signed-off-by: SuperQ <superq@gmail.com>
2025-05-16 11:05:35 +02:00
Ben Kochie
3eb44003c6
Fixup make proto (#16603)
Use `common-` prefix for `make proto` so downstream projects like
client_golang can implement their own `make proto`.

Signed-off-by: SuperQ <superq@gmail.com>
2025-05-16 09:03:07 +00:00
Matthieu MOREL
9d7a37ae18
Bump golangci-lint to v2.1.5 (#16545)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-04 11:17:22 +02:00
Matthieu MOREL
08aa5e3f97
ci: update golangci-lint to v2.0.2 and adjust configuration (#16356)
* ci: update golangci-lint to v2.0.2 and adjust configuration

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-04-02 13:05:30 +02:00
Arve Knudsen
56929ffa42 Upgrade to Go v1.24 (#16180)
* Upgrade to Go v1.24
* Upgrade golangci-lint

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-03-07 11:28:26 +01:00
dongjiang
b3a9fa3df9
chore: Upgrade to golangci-lint v1.63.4 (#15799)
update golangci-lint and enable more lntiers

This updates golangci-lint to v1.63.4 and enables linters
`nilnesserr` and `exptostd`

Signed-off-by: dongjiang <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang <dongjiang1989@126.com>
2025-01-14 19:22:22 +01:00
Arve Knudsen
89bbb885e5
Upgrade to golangci-lint v1.62.0 (#15424)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-11-20 17:22:20 +01:00
Ben Kochie
628bbd2682
Update linting (#15369)
* Ignore all node_modules dirs.
* Update Makefile.common golangci-lint to match CI pipeline.

Signed-off-by: SuperQ <superq@gmail.com>
2024-11-12 13:27:39 +01:00
51n15t9r
b6015e7c73
Add support for running govulncheck (#12654)
* Add support for running govulncheck

---------

Signed-off-by: 51n15t9r <utkarsh.khare@gmail.com>
2024-09-16 23:13:04 +02:00
Arve Knudsen
fbcd50f32c Upgrade golangci-lint to v1.60.2
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-21 18:57:17 +02:00
Arve Knudsen
3a78e76282 Upgrade golangci-lint to v1.60.1
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-18 12:13:25 +02:00
Arve Knudsen
0395b04419 golangci-lint: Upgrade to v1.59.1
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-06-24 16:14:22 -07:00
Arve Knudsen
b2396c0c8f Upgrade to golangci-lint v1.59.0
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-05-27 22:38:48 +02:00
SuperQ
f09cf2d9fb
Update promu
Update promu to the latest release.

Signed-off-by: SuperQ <superq@gmail.com>
2024-05-02 00:10:02 +02:00
heyitao
d9e4353520 Fix binary detection in Makefile
Signed-off-by: heyitao <heyitao@uniontech.com>
2024-03-21 11:32:23 +08:00
dongjiang
11fc7b1d83
chores: bump to golangci-lint v1.56.2 (#13753)
bump to golangci-lint to v1.56.2

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2024-03-19 19:24:37 +01:00
SuperQ
2061eb0a6a
Add GitHub action to publish container README
Add a GitHub action to publish the README.md to Docker Hub and Quay.io.

Fixes: https://github.com/prometheus/prometheus/issues/5348

Signed-off-by: SuperQ <superq@gmail.com>
2024-03-12 14:18:52 +01:00
machine424
6998bfab59
add a common-lint-fix make target to make golangci-lint fix found issues if it's supported by the linter
clean up common-lint target

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2024-03-06 12:06:02 +01:00
Arve Knudsen
7d7787f250 Makefile: Support golangci-lint on ARM64
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-02-06 13:51:16 +04:00
Matthieu MOREL
9c4782f1cc
golangci-lint: enable testifylint linter (#13254)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-12-07 11:35:01 +00:00
michalbiesek
d1ff3eb868
Update golangci-lint (#12688)
Signed-off-by: Michal Biesek <michalbiesek@gmail.com>
2023-09-01 12:15:54 +02:00
SuperQ
4edf8999da
Update promu
Update promu to support riscv64.

Signed-off-by: SuperQ <superq@gmail.com>
2023-07-06 10:59:03 +02:00
SuperQ
c18f5b6487
Update golangci-lint
* Update golangci-lint to v1.53.3.
* Update the sync script handler for the old golanci-lint action.

Signed-off-by: SuperQ <superq@gmail.com>
2023-06-27 14:21:39 +02:00
Bartol Deak
95b7d592ba
rewrite which with command -v
Signed-off-by: Bartol Deak <b@bdeak.net>
2023-06-13 11:59:17 +02:00
Bartol Deak
06843db80a
Hide which stderr output
Signed-off-by: Bartol Deak <b@bdeak.net>
2023-06-12 23:00:04 +02:00
SuperQ
f14665b9e3 Fix docker tag sanitizer
Use a `-` instead of `_` to make the docker tag also pass semver checks.

Signed-off-by: SuperQ <superq@gmail.com>
2023-03-21 11:27:25 +01:00
Julien Pivotto
331a7dfd21 Replace '+' with '_' in docker image tag for semver compatibility
This change introduces a new variable, SANITIZED_DOCKER_IMAGE_TAG, which
replaces any '+' characters in the original DOCKER_IMAGE_TAG with '_'
characters. This ensures better compatibility with semver standards,
particularly when using metadata in version tags.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-16 20:31:17 +01:00
SuperQ
65e743719c
Update golangci-lint
Update to the latest release, supports Go 1.20.

Signed-off-by: SuperQ <superq@gmail.com>
2023-02-20 11:17:22 +01:00
Luca Comellini
3e09fd32bb
Bump golangci-lint to v1.50.1
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-12-21 18:35:11 -08:00
Julien Pivotto
a971bdd5f5 Do not build with netgo on Windows
Fix #11480

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-12-12 12:33:18 +01:00
Julien Pivotto
96d5a32659
Update go to 1.19, set min version to 1.18 (#11279)
* Update go to 1.19, set min version to 1.18

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>

* Update golangci-lint

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-09-07 11:30:48 +02:00