Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build to github action & release 0.8.0 #116

Merged
merged 1 commit into from Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 23 additions & 36 deletions .circleci/config.yml
@@ -1,46 +1,33 @@
---
# Prometheus has switched to GitHub action.
# Circle CI is not disabled repository-wise so that previous pull requests
# continue working.
# This file does not generate any CircleCI workflow.

version: 2.1

orbs:
go: circleci/go@1.7.1
executors:
golang:
docker:
- image: busybox

jobs:
test:
parameters:
go_version:
type: string
use_gomod_cache:
type: boolean
default: true
docker:
- image: cimg/go:<< parameters.go_version >>
noopjob:
executor: golang

steps:
- checkout
- when:
condition: << parameters.use_gomod_cache >>
steps:
- go/load-cache:
key: v1-go<< parameters.go_version >>
- run: make test
- when:
condition: << parameters.use_gomod_cache >>
steps:
- go/save-cache:
key: v1-go<< parameters.go_version >>
- store_test_results:
path: test-results
- run:
command: "true"

workflows:
version: 2
tests:
prometheus:
jobs:
# Support the last two go releases, as per https://golang.org/dl/.
- test:
name: go-1-17
go_version: "1.17"
- test:
name: go-1-18
go_version: "1.18"
- test:
name: go-1-19
go_version: "1.19"
- noopjob
triggers:
- schedule:
cron: "0 0 30 2 *"
filters:
branches:
only:
- main
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,31 @@
---
name: CI
on: # yamllint disable-line rule:truthy
pull_request:
push:
jobs:
test:
name: Test
runs-on: ubuntu-latest
container:
image: quay.io/prometheus/golang-builder:1.19-base
steps:
- uses: actions/checkout@v3
- uses: prometheus/promci@v0.0.2
- uses: ./.github/promci/actions/setup_environment
- run: make test

golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '<1.19'
- name: Lint
uses: golangci/golangci-lint-action@v3.2.0
with:
version: v1.49.0
50 changes: 25 additions & 25 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -34,34 +34,34 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
30 changes: 0 additions & 30 deletions .github/workflows/golangci-lint.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .yamllint
@@ -0,0 +1,28 @@
---
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
commas: disable
comments: disable
comments-indentation: disable
document-start: disable
indentation:
spaces: consistent
indent-sequences: consistent
key-duplicates:
ignore: |
config/testdata/section_key_dup.bad.yml
line-length: disable
truthy:
ignore: |
.github/workflows/codeql-analysis.yml
.github/workflows/funcbench.yml
.github/workflows/fuzzing.yml
.github/workflows/prombench.yml
.github/workflows/golangci-lint.yml
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
## 0.8.0 / 2022-10-10

* [CHANGE] Change some structs suffix from `Struct` to `Config` #114
* [FEATURE] Add multiple listeners and systemd socket support #95
* [FEATURE] Allow TLS parameters to be set in code #110

## 0.7.1 / 2021-12-02

* [BUGFIX] Effectively enable HTTP/2 support. #72
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Expand Up @@ -3,11 +3,11 @@ module github.com/prometheus/exporter-toolkit
go 1.17

require (
github.com/coreos/go-systemd/v22 v22.3.2
github.com/coreos/go-systemd/v22 v22.4.0
github.com/go-kit/log v0.2.1
github.com/prometheus/common v0.37.0
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a
golang.org/x/sync v0.1.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
11 changes: 6 additions & 5 deletions go.sum
Expand Up @@ -89,8 +89,8 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.4.0 h1:y9YHcjnjynCd/DVbg5j9L/33jQM3MxJlbj/zWskzfGU=
github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -302,8 +302,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
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.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg=
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -420,8 +420,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8=
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
8 changes: 4 additions & 4 deletions web/testdata/web_config_auth_clientCAs_invalid.bad.yml
@@ -1,4 +1,4 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_ca_file : "somefile"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_ca_file: "somefile"
8 changes: 4 additions & 4 deletions web/testdata/web_config_auth_clientCAs_missing.bad.yml
@@ -1,4 +1,4 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_auth_type : "RequireAndVerifyClientCert"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_auth_type: "RequireAndVerifyClientCert"
6 changes: 3 additions & 3 deletions web/testdata/web_config_auth_user_list_invalid.bad.yml
@@ -1,5 +1,5 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
basic_auth_users:
john: doe
2 changes: 1 addition & 1 deletion web/testdata/web_config_junk_key.yml
@@ -1,2 +1,2 @@
tls_server_config :
tls_server_config:
cert_filse: "server.crt"
8 changes: 4 additions & 4 deletions web/testdata/web_config_noAuth.bad.yml
@@ -1,4 +1,4 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_ca_file : "/dev/null"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_ca_file: "/dev/null"
8 changes: 4 additions & 4 deletions web/testdata/web_config_noAuth.good.blocking.yml
@@ -1,4 +1,4 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_auth_type : "RequireAndVerifyClientCert"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_auth_type: "RequireAndVerifyClientCert"
8 changes: 4 additions & 4 deletions web/testdata/web_config_noAuth.good.yml
@@ -1,4 +1,4 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_auth_type : "VerifyClientCertIfGiven"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_auth_type: "VerifyClientCertIfGiven"
9 changes: 4 additions & 5 deletions web/testdata/web_config_noAuth_allCiphers.good.yml
@@ -1,7 +1,7 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_auth_type : "VerifyClientCertIfGiven"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_auth_type: "VerifyClientCertIfGiven"
cipher_suites:
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
Expand All @@ -20,4 +20,3 @@ tls_server_config :
- TLS_RSA_WITH_AES_256_CBC_SHA
- TLS_RSA_WITH_AES_128_GCM_SHA256
- TLS_RSA_WITH_AES_256_GCM_SHA384

8 changes: 4 additions & 4 deletions web/testdata/web_config_noAuth_allCurves.good.yml
@@ -1,7 +1,7 @@
tls_server_config :
cert_file : "server.crt"
key_file : "server.key"
client_auth_type : "VerifyClientCertIfGiven"
tls_server_config:
cert_file: "server.crt"
key_file: "server.key"
client_auth_type: "VerifyClientCertIfGiven"
curve_preferences:
- CurveP256
- CurveP384
Expand Down
6 changes: 3 additions & 3 deletions web/testdata/web_config_noAuth_certPath_empty.bad.yml
@@ -1,3 +1,3 @@
tls_server_config :
cert_file : ""
key_file : "server.key"
tls_server_config:
cert_file: ""
key_file: "server.key"
6 changes: 3 additions & 3 deletions web/testdata/web_config_noAuth_certPath_invalid.bad.yml
@@ -1,3 +1,3 @@
tls_server_config :
cert_file : "somefile"
key_file : "server.key"
tls_server_config:
cert_file: "somefile"
key_file: "server.key"
6 changes: 3 additions & 3 deletions web/testdata/web_config_noAuth_certPath_keyPath_empty.bad.yml
@@ -1,4 +1,4 @@
tls_server_config :
cert_file : ""
key_file : ""
tls_server_config:
cert_file: ""
key_file: ""
client_auth_type: "x"