Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 74cb2dc

Browse files
schmikeivutkindependabot[bot]pelovcaiwc
authored
Remove metric scrape interval (#3)
* remove metric scrape interval as it should be up to the invoker how to run * feat: add gh workflows (iamseth#265) * Bump github.com/BurntSushi/toml from 1.2.0 to 1.2.1 (iamseth#271) Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/BurntSushi/toml/releases) - [Commits](BurntSushi/toml@v1.2.0...v1.2.1) --- updated-dependencies: - dependency-name: github.com/BurntSushi/toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/exporter-toolkit from 0.7.3 to 0.8.2 (iamseth#272) Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.7.3 to 0.8.2. - [Release notes](https://github.com/prometheus/exporter-toolkit/releases) - [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md) - [Commits](prometheus/exporter-toolkit@v0.7.3...v0.8.2) --- updated-dependencies: - dependency-name: github.com/prometheus/exporter-toolkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/client_golang from 1.13.0 to 1.14.0 (iamseth#274) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.13.0 to 1.14.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.13.0...v1.14.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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/common from 0.37.0 to 0.39.0 (iamseth#273) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.37.0 to 0.39.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](prometheus/common@v0.37.0...v0.39.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Fixed github action runs against forked repos (iamseth#280) * chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint fix: fix typo fix: fix typo chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint fix: fix typo * chore: savepoint chore: savepoint feat: test gh action pr-cleanup (#2) * feat: test gh action pr-cleanup * chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint * chore: savepoint * chore: savepoint * chore: savepoint * chore: savepoint * chore: savepoint * chore: savepoint * chore: savepoint * feat: do a release 0.4.1 (#3) * chore: savepoint * chore: savepoint * chore: savepoint * feat: do a release 0.4.2 (iamseth#4) * chore: savepoint * chore: savepoint (iamseth#5) * chore: savepoint * chore: savepoint * chore: savepoint * feat: do release 0.4.4 (iamseth#6) * feat: do a release 0.4.4 * chore: savepoint * chore: savepoint * chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint chore: savepoint * fix: fix GitHub release failed with status: 403 (iamseth#282) * Fix 0.4.0 compilation problem (iamseth#277) * Fix parsing kingpin flags according to exporter-toolkit v0.8.2 Fixes iamseth#275 Signed-off-by: Nikolay Pelov <[email protected]> * Update README file to reflect the changed options from exporter-toolkit. * Update release version to 0.4.1 --------- Signed-off-by: Nikolay Pelov <[email protected]> * Improve logging after the switch to github.com/go-kit/kit/log (iamseth#278) Signed-off-by: Nikolay Pelov <[email protected]> * refact: refact PR/release github-actions (iamseth#286) * refact: refact PR github action a bit * chore: savepoint * chore: savepoint * Caiwc/multi target (iamseth#234) * feat(): support scrape multi target rebase branch && update Makefile version * add multi-target explain to readme * docs: correct dns example port of readme --------- Co-authored-by: wccai <[email protected]> Co-authored-by: wccai <wccai@easyops> * README: add example of image hosted on github image registry * Bump golang.org/x/net from 0.4.0 to 0.7.0 (iamseth#290) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.4.0 to 0.7.0. - [Release notes](https://github.com/golang/net/releases) - [Commits](golang/net@v0.4.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/common from 0.39.0 to 0.40.0 (iamseth#291) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.39.0 to 0.40.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](prometheus/common@v0.39.0...v0.40.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/common from 0.40.0 to 0.41.0 (iamseth#292) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.40.0 to 0.41.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](prometheus/common@v0.40.0...v0.41.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/exporter-toolkit from 0.8.2 to 0.9.0 (iamseth#294) Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.8.2 to 0.9.0. - [Release notes](https://github.com/prometheus/exporter-toolkit/releases) - [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md) - [Commits](prometheus/exporter-toolkit@v0.8.2...v0.9.0) --- updated-dependencies: - dependency-name: github.com/prometheus/exporter-toolkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/exporter-toolkit from 0.9.0 to 0.9.1 (iamseth#295) Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/prometheus/exporter-toolkit/releases) - [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md) - [Commits](prometheus/exporter-toolkit@v0.9.0...v0.9.1) --- updated-dependencies: - dependency-name: github.com/prometheus/exporter-toolkit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github.com/prometheus/common from 0.41.0 to 0.42.0 (iamseth#296) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.41.0 to 0.42.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](prometheus/common@v0.41.0...v0.42.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix broken link (iamseth#298) * 👷 Update packages versions + clean up * Update packages versions + clean up * Use Oracle image to retrieve binaries * Use FQN for docker image * 🐛 Fix oraclelinux image build * 🔧 Use a parameter to set oracle client version * remove percent and hyphen (iamseth#302) Some oracledb tables return names with % and - * try to resolve scrape interval of 0 implications * fix scrape interval nil check * fix synchronization --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Nikolay Pelov <[email protected]> Co-authored-by: Viktor Utkin <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nikolay Pelov <[email protected]> Co-authored-by: caiwc <[email protected]> Co-authored-by: wccai <[email protected]> Co-authored-by: wccai <wccai@easyops> Co-authored-by: Yannig Perré <[email protected]> Co-authored-by: markruler <[email protected]> Co-authored-by: Yannig <[email protected]> Co-authored-by: Egor Sidortsov <[email protected]>
1 parent 6896822 commit 74cb2dc

23 files changed

+1487
-655
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ alpline
33
.*
44
tests
55
*-example.toml
6+
.golangci.yml
67
*.md
78
*.pc
89
dist

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Description
2+
3+
<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
# How Has This Been Tested?
17+
18+
<!--- Please describe in detail how you tested your changes. -->
19+
<!--- Include details of your testing environment, and the tests you ran to -->
20+
<!--- see how your change affects other areas of the code, etc. -->
21+
22+
## Screenshots (if appropriate):
23+
24+
# Checklist:
25+
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my own code
28+
- [ ] I have commented my code, particularly in hard-to-understand areas
29+
- [ ] I have made corresponding changes to the documentation
30+
- [ ] My changes generate no new warnings
31+
- [ ] I have added tests that prove my fix is effective or that my feature works
32+
- [ ] New and existing unit tests pass locally with my changes
33+
- [ ] Any dependent changes have been merged and published in downstream modules
34+
- [ ] Updated version in Makefile respecting [semver v2](https://semver.org/spec/v2.0.0.html)

.github/config/lint/errcheck.exclude.txt

Whitespace-only changes.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
# Check for updates to GitHub Actions every weekday
7+
interval: "daily"

.github/issue_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## I'm submitting a ...
2+
3+
- [ ] bug report
4+
- [ ] feature request
5+
6+
## What is the current behavior?
7+
8+
## If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
9+
10+
## What is the expected behavior?
11+
12+
## What is the motivation / use case for changing the behavior?
13+
14+
## Please tell us about your environment:
15+
16+
Version: X.Y.Z

.github/workflow-config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"go-version": "1.19.4",
3+
"deploy": {
4+
"pull-request": true,
5+
"sign-docker-image": false,
6+
"pull-request-images": [
7+
{
8+
"name": "ubuntu"
9+
}
10+
],
11+
"release-images": [
12+
{
13+
"name": "ubuntu"
14+
},
15+
{
16+
"name": "oraclelinux"
17+
}
18+
]
19+
}
20+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: "[Manual] Pull Request Cleanup"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
pattern:
7+
description: |
8+
Tags pattern filter
9+
required: true
10+
type: string
11+
default: "rc.pr-"
12+
13+
concurrency:
14+
group: ${{ github.workflow }}
15+
cancel-in-progress: false
16+
17+
permissions:
18+
contents: write
19+
packages: write
20+
21+
env:
22+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
23+
PULL_REQUEST_BRANCH: ${{ github.head_ref }}
24+
IMAGE_NAME: "ghcr.io/${{ github.repository }}"
25+
PACKAGE_NAME: oracledb_exporter
26+
PACKAGE_TYPE: container
27+
USERNAME: ${{ github.repository_owner }}
28+
29+
jobs:
30+
cleanup-ghcr:
31+
runs-on: ubuntu-latest
32+
name: "cleanup ghcr / ${{ github.event.inputs.pattern }}"
33+
steps:
34+
- name: Cleanup versions
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
FILTER: ${{ github.event.inputs.pattern }}
38+
run: |
39+
gh api \
40+
-H "Accept: application/vnd.github+json" \
41+
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions" > versions.json
42+
43+
VERSIONS=$(jq -r '.[] | select(.metadata.container.tags[] | test("${{ env.FILTER }}")) | .id' versions.json)
44+
for VERSION in $(echo -n "$VERSIONS")
45+
do
46+
TAG=$(jq -r \
47+
--arg VERSION "$VERSION" \
48+
'.[] | select(.id | tostring | test($VERSION)) | .metadata.container.tags | join(",")' \
49+
versions.json
50+
)
51+
DIGEST=$(jq -r \
52+
--arg VERSION "$VERSION" \
53+
'.[] | select(.id | tostring | test($VERSION)) | .name' \
54+
versions.json
55+
)
56+
echo "deleting ${IMAGE_NAME}:${TAG} with digest=${DIGEST}"
57+
echo "deleting package PACKAGE_VERSION_ID=${VERSION}"
58+
# https://github.com/cli/cli/issues/3937
59+
echo -n | gh api \
60+
--silent \
61+
--method DELETE \
62+
-H "Accept: application/vnd.github+json" \
63+
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions/$VERSION" \
64+
--input -
65+
done
66+
cleanup-pre-releases:
67+
runs-on: ubuntu-latest
68+
name: "cleanup pre-releases / ${{ github.event.inputs.pattern }}"
69+
steps:
70+
- name: Cleanup releases
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
FILTER: ${{ github.event.inputs.pattern }}
74+
run: |
75+
gh api \
76+
-H "Accept: application/vnd.github+json" \
77+
"/repos/${{ github.repository }}/releases" \
78+
--jq='.[] | select(.prerelease=false) | select(.tag_name | test("${{ env.FILTER }}"))' > versions.json
79+
80+
VERSIONS=$(jq -r '.id' versions.json)
81+
for VERSION in $(echo -n "$VERSIONS")
82+
do
83+
RELEASE=$(jq -r \
84+
--arg VERSION "$VERSION" \
85+
'select(.id | tostring | test($VERSION)) | .name' \
86+
versions.json
87+
)
88+
echo "deleting release \"$RELEASE\" with RELEASE_ID=${VERSION}"
89+
# https://github.com/cli/cli/issues/3937
90+
echo -n | gh api \
91+
--silent \
92+
--method DELETE \
93+
-H "Accept: application/vnd.github+json" \
94+
"/repos/${{ github.repository }}/releases/$VERSION" \
95+
--input -
96+
done
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Pull Request Cleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}
9+
cancel-in-progress: false
10+
11+
env:
12+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
13+
PULL_REQUEST_BRANCH: ${{ github.head_ref }}
14+
IMAGE_NAME: "ghcr.io/${{ github.repository }}"
15+
PACKAGE_NAME: oracledb_exporter
16+
PACKAGE_TYPE: container
17+
USERNAME: ${{ github.repository_owner }}
18+
19+
permissions:
20+
contents: write
21+
packages: write
22+
23+
jobs:
24+
cleanup-ghcr:
25+
runs-on: ubuntu-latest
26+
name: "cleanup ghcr"
27+
steps:
28+
- name: Cleanup versions
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
FILTER: rc.pr-${{ env.PULL_REQUEST_NUMBER }}
32+
run: |
33+
gh api \
34+
-H "Accept: application/vnd.github+json" \
35+
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions" > versions.json
36+
37+
VERSIONS=$(jq -r '.[] | select(.metadata.container.tags[] | test("${{ env.FILTER }}")) | .id' versions.json)
38+
for VERSION in $(echo -n "$VERSIONS")
39+
do
40+
TAG=$(jq -r \
41+
--arg VERSION "$VERSION" \
42+
'.[] | select(.id | tostring | test($VERSION)) | .metadata.container.tags | join(",")' \
43+
versions.json
44+
)
45+
DIGEST=$(jq -r \
46+
--arg VERSION "$VERSION" \
47+
'.[] | select(.id | tostring | test($VERSION)) | .name' \
48+
versions.json
49+
)
50+
echo "deleting ${IMAGE_NAME}:${TAG} with digest=${DIGEST}"
51+
echo "deleting package PACKAGE_VERSION_ID=${VERSION}"
52+
# https://github.com/cli/cli/issues/3937
53+
echo -n | gh api \
54+
--silent \
55+
--method DELETE \
56+
-H "Accept: application/vnd.github+json" \
57+
"/users/${{ env.USERNAME }}/packages/${{ env.PACKAGE_TYPE }}/${{ env.PACKAGE_NAME }}/versions/$VERSION" \
58+
--input -
59+
done
60+
cleanup-pre-releases:
61+
runs-on: ubuntu-latest
62+
name: "cleanup pre-releases"
63+
steps:
64+
- name: Cleanup releases
65+
env:
66+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
FILTER: rc.pr-${{ env.PULL_REQUEST_NUMBER }}
68+
run: |
69+
gh api \
70+
-H "Accept: application/vnd.github+json" \
71+
"/repos/${{ github.repository }}/releases" \
72+
--jq='.[] | select(.prerelease=false) | select(.tag_name | test("${{ env.FILTER }}"))' > versions.json
73+
74+
VERSIONS=$(jq -r '.id' versions.json)
75+
for VERSION in $(echo -n "$VERSIONS")
76+
do
77+
RELEASE=$(jq -r \
78+
--arg VERSION "$VERSION" \
79+
'select(.id | tostring | test($VERSION)) | .name' \
80+
versions.json
81+
)
82+
echo "deleting release \"$RELEASE\" with RELEASE_ID=${VERSION}"
83+
# https://github.com/cli/cli/issues/3937
84+
echo -n | gh api \
85+
--silent \
86+
--method DELETE \
87+
-H "Accept: application/vnd.github+json" \
88+
"/repos/${{ github.repository }}/releases/$VERSION" \
89+
--input -
90+
done

0 commit comments

Comments
 (0)