gitlab-labkit 0.36.1 → 0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.copier-answers.yml +15 -0
- data/.editorconfig +28 -0
- data/.gitlab-ci-asdf-versions.yml +5 -0
- data/.gitlab-ci.yml +40 -41
- data/.gitleaks.toml +10 -0
- data/.mise.toml +8 -0
- data/.pre-commit-config.yaml +38 -0
- data/.releaserc.json +19 -0
- data/.rubocop.yml +1 -58
- data/.rubocop_todo.yml +399 -77
- data/.tool-versions +3 -1
- data/.yamllint.yaml +11 -0
- data/CODEOWNERS +4 -0
- data/CONTRIBUTING.md +4 -4
- data/Dangerfile +7 -1
- data/LICENSE +1 -3
- data/README.md +3 -4
- data/Rakefile +14 -24
- data/gitlab-labkit.gemspec +13 -10
- data/lib/gitlab-labkit.rb +1 -0
- data/lib/labkit/logging/sanitizer.rb +8 -0
- data/lib/labkit/metrics/README.md +95 -0
- data/lib/labkit/metrics/client.rb +86 -0
- data/lib/labkit/metrics/null.rb +20 -0
- data/lib/labkit/metrics/rack_exporter.rb +12 -0
- data/lib/labkit/metrics/registry.rb +61 -0
- data/lib/labkit/metrics.rb +19 -0
- data/renovate.json +7 -0
- data/scripts/install-asdf-plugins.sh +13 -0
- data/scripts/prepare-dev-env.sh +68 -0
- data/scripts/update-asdf-version-variables.sh +30 -0
- metadata +96 -40
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c078a5d36ecffe4c1b7decf900279045a99683a4e60ffc28a5e045f9b4e23fc
|
4
|
+
data.tar.gz: 38583a88f2da4682b79d272e53dff3467df4737b46ac59f1e38e86a6aef69d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a399db16f8f8395e9d60ad1a994e888fbeaa5a4d4a97377ed25151f434bdcc9ba4f2ef0abcb7d4bed14a0e8578c8c22fa706b185c1a337bb4f3af204709ee101
|
7
|
+
data.tar.gz: bb760a9bcd6e37d55d231a0d820cc055cfdad381d0d6b784701e4a088a78ccee20d9bae3d510dd970b0ba08276c67b53b3fa0bdc4d9a63bc2e3a9b3715716cac
|
data/.copier-answers.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# This project was initially generated with
|
2
|
+
# https://gitlab.com/gitlab-com/gl-infra/common-template-copier
|
3
|
+
# See the project for instructions on how to update the project
|
4
|
+
#
|
5
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
6
|
+
_commit: v1.31.0
|
7
|
+
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
|
8
|
+
ee_licensed: false
|
9
|
+
golang: false
|
10
|
+
initial_codeowners: '@reprazent @andrewn @mkaeppler @ayufan'
|
11
|
+
jsonnet: false
|
12
|
+
project_name: labkit-ruby
|
13
|
+
ruby: true
|
14
|
+
rubygem: true
|
15
|
+
terraform: false
|
data/.editorconfig
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# EditorConfig is awesome: https://EditorConfig.org
|
2
|
+
|
3
|
+
# top-most EditorConfig file
|
4
|
+
root = true
|
5
|
+
|
6
|
+
# Unix-style newlines with a newline ending every file
|
7
|
+
[*]
|
8
|
+
charset = utf-8
|
9
|
+
end_of_line = lf
|
10
|
+
indent_size = 2
|
11
|
+
indent_style = space
|
12
|
+
insert_final_newline = true
|
13
|
+
insert_final_newline = true
|
14
|
+
trim_trailing_whitespace = true
|
15
|
+
|
16
|
+
[.copier-*.yml]
|
17
|
+
insert_final_newline = unset
|
18
|
+
indent_size = unset
|
19
|
+
|
20
|
+
[*.md]
|
21
|
+
indent_size = unset
|
22
|
+
|
23
|
+
[{Makefile,**.mk}]
|
24
|
+
# Use tabs for indentation (Makefiles require tabs)
|
25
|
+
indent_style = tab
|
26
|
+
|
27
|
+
[*.rego]
|
28
|
+
indent_style = tab
|
data/.gitlab-ci.yml
CHANGED
@@ -1,59 +1,58 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
stages:
|
2
|
+
- validate
|
3
|
+
- release
|
4
|
+
- renovate_bot
|
3
5
|
|
6
|
+
# Prevent double-pipelines for branch pipelines vs. merge request pipelines
|
4
7
|
workflow:
|
5
8
|
rules:
|
6
|
-
|
7
|
-
- if:
|
8
|
-
|
9
|
-
- if:
|
10
|
-
|
11
|
-
|
9
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
10
|
+
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
11
|
+
when: never
|
12
|
+
- if: $CI_COMMIT_BRANCH
|
13
|
+
- if: $CI_COMMIT_TAG
|
14
|
+
|
15
|
+
include:
|
16
|
+
- local: .gitlab-ci-asdf-versions.yml
|
17
|
+
|
18
|
+
# This template should be included in all Infrastructure projects.
|
19
|
+
# It includes standard checks, gitlab-scanners, validations and release processes
|
20
|
+
# common to all projects using this template library.
|
21
|
+
# see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/templates/standard.md
|
22
|
+
- project: "gitlab-com/gl-infra/common-ci-tasks"
|
23
|
+
ref: v2.77 # renovate:managed
|
24
|
+
file: templates/standard.yml
|
25
|
+
|
26
|
+
# Runs rspec tests and rubocop on the project
|
27
|
+
# see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/templates/ruby.md
|
28
|
+
- project: "gitlab-com/gl-infra/common-ci-tasks"
|
29
|
+
ref: v2.77 # renovate:managed
|
30
|
+
file: templates/ruby.yml
|
31
|
+
|
32
|
+
- project: "gitlab-com/gl-infra/common-ci-tasks"
|
33
|
+
ref: v2.77 # renovate:managed
|
34
|
+
file: "danger.yml"
|
12
35
|
|
13
36
|
.test_template: &test_definition
|
37
|
+
extends: .with_bundle
|
14
38
|
image: ruby:${RUBY_VERSION}
|
15
|
-
stage:
|
39
|
+
stage: validate
|
16
40
|
script:
|
17
41
|
- gem install bundler --no-document
|
18
42
|
- bundle config --local path vendor
|
19
43
|
- bundle install
|
20
44
|
- bundle exec rake verify build install
|
21
|
-
|
22
|
-
|
23
|
-
paths:
|
24
|
-
- vendor/ruby
|
25
|
-
ruby:
|
45
|
+
|
46
|
+
ruby-versions:
|
26
47
|
<<: *test_definition
|
27
48
|
parallel:
|
28
49
|
matrix:
|
29
|
-
- RUBY_VERSION: ["3.
|
30
|
-
|
31
|
-
static-analysis:
|
32
|
-
before_script:
|
33
|
-
- bundle install
|
34
|
-
script:
|
35
|
-
- rake verify
|
36
|
-
|
37
|
-
danger-review:
|
38
|
-
stage: test
|
39
|
-
except:
|
40
|
-
- tags
|
41
|
-
- master
|
42
|
-
before_script:
|
43
|
-
- bundle install
|
44
|
-
script:
|
45
|
-
- bundle exec danger --fail-on-errors=true --verbose
|
50
|
+
- RUBY_VERSION: ["3.2", "3.3"]
|
46
51
|
|
47
52
|
deploy:
|
48
|
-
|
53
|
+
rules:
|
54
|
+
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/
|
55
|
+
extends: .with_bundle
|
56
|
+
stage: release
|
49
57
|
script:
|
50
58
|
- tools/deploy-rubygem.sh
|
51
|
-
only:
|
52
|
-
- tags
|
53
|
-
|
54
|
-
release:
|
55
|
-
stage: deploy
|
56
|
-
script:
|
57
|
-
- tools/update-changelog.rb "${CI_COMMIT_TAG}"
|
58
|
-
only:
|
59
|
-
- tags
|
data/.gitleaks.toml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
title = "project-scoped gitleaks config"
|
2
|
+
|
3
|
+
[extend]
|
4
|
+
# useDefault will extend the base configuration with the default gitleaks config:
|
5
|
+
# https://github.com/zricethezav/gitleaks/blob/master/config/gitleaks.toml
|
6
|
+
useDefault = true
|
7
|
+
|
8
|
+
# See https://github.com/zricethezav/gitleaks#configuration
|
9
|
+
# for details of extending this configuration for allowlists,
|
10
|
+
# etc
|
data/.mise.toml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# See https://pre-commit.com for more information
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
3
|
+
---
|
4
|
+
# Use exclude to exclude specific files
|
5
|
+
# exclude: '^fixtures/'
|
6
|
+
repos:
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
8
|
+
rev: v5.0.0 # renovate:managed
|
9
|
+
hooks:
|
10
|
+
- id: trailing-whitespace
|
11
|
+
- id: end-of-file-fixer
|
12
|
+
- id: check-yaml
|
13
|
+
- id: check-case-conflict
|
14
|
+
- id: check-symlinks
|
15
|
+
- id: check-json
|
16
|
+
- id: detect-private-key
|
17
|
+
- id: mixed-line-ending
|
18
|
+
args: ["--fix=lf"]
|
19
|
+
- id: no-commit-to-branch
|
20
|
+
args: [--branch, main]
|
21
|
+
- id: pretty-format-json
|
22
|
+
args: [--autofix, --no-sort-keys]
|
23
|
+
|
24
|
+
# pre-commit tasks from common-ci-tasks
|
25
|
+
# Documentation available at
|
26
|
+
# https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/pre-commit.md
|
27
|
+
- repo: https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks
|
28
|
+
rev: v2.77 # renovate:managed
|
29
|
+
|
30
|
+
hooks:
|
31
|
+
- id: shellcheck # Run shellcheck for changed Shell files
|
32
|
+
- id: shfmt # Run shellcheck for changed Shell files
|
33
|
+
- id: update-asdf-version-variables # Update .gitlab-ci-asdf-versions.yml if .tool-versions has changed
|
34
|
+
|
35
|
+
# - id: gitlint # Checks your git commit messages for style
|
36
|
+
- id: gitleaks # Detect hardcoded secrets using Gitleaks
|
37
|
+
- id: editorconfig # Validate text files against .editorconfig
|
38
|
+
- id: yamllint # Validate YAML files using yamllint
|
data/.releaserc.json
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"branches": ["master"],
|
3
|
+
"plugins": [
|
4
|
+
[
|
5
|
+
"@semantic-release/commit-analyzer",
|
6
|
+
{
|
7
|
+
"preset": "conventionalcommits"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
[
|
11
|
+
"@semantic-release/release-notes-generator",
|
12
|
+
{
|
13
|
+
"preset": "conventionalcommits"
|
14
|
+
}
|
15
|
+
],
|
16
|
+
"@gitlab/truncated-tags",
|
17
|
+
"@semantic-release/gitlab"
|
18
|
+
]
|
19
|
+
}
|
data/.rubocop.yml
CHANGED
@@ -5,61 +5,4 @@ inherit_gem:
|
|
5
5
|
- rubocop-default.yml
|
6
6
|
|
7
7
|
AllCops:
|
8
|
-
|
9
|
-
|
10
|
-
Style/HashSyntax:
|
11
|
-
EnforcedStyle: no_mixed_keys
|
12
|
-
|
13
|
-
Style/SymbolLiteral:
|
14
|
-
Enabled: No
|
15
|
-
|
16
|
-
Style/TrailingCommaInArguments:
|
17
|
-
Enabled: No # Delegated to rufo
|
18
|
-
|
19
|
-
Style/TrailingCommaInHashLiteral:
|
20
|
-
Enabled: No # Delegated to rufo
|
21
|
-
|
22
|
-
Style/FrozenStringLiteralComment:
|
23
|
-
EnforcedStyle: always
|
24
|
-
|
25
|
-
Style/TrailingCommaInArrayLiteral:
|
26
|
-
EnforcedStyleForMultiline: comma
|
27
|
-
|
28
|
-
Style/StringLiterals:
|
29
|
-
EnforcedStyle: double_quotes
|
30
|
-
|
31
|
-
Style/StringLiteralsInInterpolation:
|
32
|
-
EnforcedStyle: double_quotes
|
33
|
-
|
34
|
-
Style/Lambda:
|
35
|
-
Enabled: false
|
36
|
-
|
37
|
-
Layout/LineLength:
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Layout/SpaceInLambdaLiteral:
|
41
|
-
Enabled: No
|
42
|
-
|
43
|
-
Layout/SpaceInsideBlockBraces:
|
44
|
-
Enabled: No
|
45
|
-
|
46
|
-
Layout/FirstParameterIndentation:
|
47
|
-
Enabled: No
|
48
|
-
|
49
|
-
RSpec/ExampleWording:
|
50
|
-
Enabled: false
|
51
|
-
CustomTransform:
|
52
|
-
be: is
|
53
|
-
have: has
|
54
|
-
not: does not
|
55
|
-
IgnoredWords: []
|
56
|
-
|
57
|
-
Lint/HashCompareByIdentity: # (new in 0.93)
|
58
|
-
Enabled: true
|
59
|
-
Lint/RedundantSafeNavigation: # (new in 0.93)
|
60
|
-
Enabled: true
|
61
|
-
Style/ClassEqualityComparison: # (new in 0.93)
|
62
|
-
Enabled: true
|
63
|
-
|
64
|
-
CodeReuse/ActiveRecord:
|
65
|
-
Enabled: false
|
8
|
+
NewCops: enable
|