Skip to content

Commit 25fef9c

Browse files
authored
Merge branch 'main' into renovate_golangci-golangci-lint-1.x
2 parents 1ccc4d2 + b301009 commit 25fef9c

18 files changed

+263
-154
lines changed

.github/pull_request_template.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ If this change should be part of the Release Notes,
2222
**replace this entire paragraph** with 1-3 sentences about the changes.
2323
Otherwise, you **MUST** remove this section entirely.
2424

25-
## Breaking Changes
26-
2725
Does this PR contain any breaking changes?
28-
If so **replace this entire paragraph** with a description of these changes.
29-
Otherwise, you **MUST** remove this section entirely.
26+
If so, add `## Breaking Changes` header and list the introduced changes there.
27+

.github/release-drafter.yml

-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ autolabeler:
5555
- label: breaking-change
5656
body:
5757
- '/^## Breaking Changes/im'
58-
- label: release-notes
59-
body:
60-
- '/^## Release Notes/im'
6158
# Version labels.
6259
- label: minor
6360
title:

.github/scripts/release-notes.sh

+5-7
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ extract_header() {
2323
local header_name="$2"
2424
awk "
2525
/^\s?$/ {next}
26-
/## $header_name/ {rn=1}
27-
rn && !/^##/ {print};
28-
/##/ && !/## $header_name/ {rn=0}" <<<"$commit"
26+
/^## $header_name/ {rn=1}
27+
rn && !/^##/ && !/^--+/ {print};
28+
/^--+/ {rn=0};
29+
/^##/ && !/^## $header_name/ {rn=0}" <<<"$commit"
2930
}
3031

3132
indent() {
@@ -45,10 +46,7 @@ while IFS= read -r line; do
4546
fi
4647
rls_header="${BASH_REMATCH[1]}"
4748
fi
48-
if [[ $rls_header == "" ]]; then
49-
continue
50-
fi
51-
if [[ $line != -* ]]; then
49+
if [[ $rls_header == "" ]] || [[ $line != -* ]] || [[ $line == *"@renovate"* ]]; then
5250
continue
5351
fi
5452
if ! [[ $line =~ $commit_message_re ]]; then

.github/workflows/e2e-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- name: Run tests
1818
run: make test/e2e
1919
env:
20-
SLOCTL_CLIENT_ID: ${{ secrets.SLOCTL_CLIENT_ID }}
20+
SLOCTL_CLIENT_ID: ${{ vars.SLOCTL_CLIENT_ID }}
2121
SLOCTL_CLIENT_SECRET: ${{ secrets.SLOCTL_CLIENT_SECRET }}

.github/workflows/pr-title.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
pull_request:
3-
types: [opened, reopened, edited]
3+
types: [opened, reopened, edited, synchronize]
44
merge_group:
55
name: pr-title
66
jobs:

.markdownlint.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
MD010:
2+
code_blocks: false
3+
spaces_per_tab: 1
4+
MD013:
5+
line_length: 80
6+
heading_line_length: 80
7+
code_block_line_length: 120
8+
code_blocks: true
9+
MD024:
10+
siblings_only: true

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ check/trailing:
134134
check/markdown:
135135
$(call _print_step,Verifying Markdown files)
136136
$(call _ensure_installed,yarn,markdownlint)
137-
yarn --silent markdownlint '*.md' --disable MD010 # MD010 does not handle code blocks well.
137+
yarn --silent markdownlint '**/*.md' --ignore node_modules
138138

139139
## Check for potential vulnerabilities across all Go dependencies.
140140
check/vulns:

README.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1-
# sloctl
2-
3-
Sloctl is a command-line interface (CLI) for Nobl9.
1+
<!-- markdownlint-disable line-length html -->
2+
<h1 align="center">
3+
<picture>
4+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/32738712/185149468-dc07f5d9-68c0-4922-a006-7baf6a08eaac.png">
5+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/32738712/185148352-bea80385-c772-4842-8f7b-6838bb08a3f4.png">
6+
<img alt="N9" src="https://user-images.githubusercontent.com/32738712/185148352-bea80385-c772-4842-8f7b-6838bb08a3f4.png" width="500" />
7+
</picture><br/>
8+
</h1>
9+
10+
<div align="center">
11+
<table>
12+
<tr>
13+
<td>
14+
<img alt="checks" src="https://github.com/nobl9/sloctl/actions/workflows/checks.yml/badge.svg?event=push">
15+
</td>
16+
<td>
17+
<img alt="tests" src="https://github.com/nobl9/sloctl/actions/workflows/unit-tests.yml/badge.svg?event=push">
18+
</td>
19+
<td>
20+
<img alt="vulnerabilities" src="https://github.com/nobl9/sloctl/actions/workflows/vulns.yml/badge.svg?event=push">
21+
</td>
22+
</tr>
23+
</table>
24+
</div>
25+
<!-- markdownlint-enable line-length html -->
26+
27+
Sloctl is a command-line interface (CLI) for [Nobl9](https://www.nobl9.com/).
428
You can use the sloctl CLI for creating or updating multiple SLOs and
529
objectives at once as part of CI/CD.
630

DEVELOPMENT.md docs/DEVELOPMENT.md

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Development
22

33
This document describes the intricacies of sloctl development workflow.
4+
If you see anything missing, feel free to contribute :)
5+
6+
## Pull requests
7+
8+
[Pull request template](.github/pull_request_template.md)
9+
is provided when you create new PR.
10+
Section worth noting and getting familiar with is located under
11+
`## Release Notes` header.
412

513
## Makefile
614

@@ -13,6 +21,12 @@ versions declaration located in Makefile.
1321
If you see any discrepancies between CI and your local runs, remove the
1422
binaries from `bin` and let Makefile reinstall them with the latest version.
1523

24+
## CI
25+
26+
Continuous integration pipelines utilize the same Makefile commands which
27+
you run locally. This ensures consistent behavior of the executed checks
28+
and makes local debugging easier.
29+
1630
## Testing
1731

1832
In addition to standard unit tests, sloctl is tested with
@@ -48,22 +62,7 @@ how they're executed.
4862

4963
## Releases
5064

51-
We're using [Release Drafter](https://github.com/release-drafter/release-drafter)
52-
to automate release notes creation. Drafter also does its best to propose
53-
the next release version based on commit messages from `main` branch.
54-
55-
Release Drafter is also responsible for auto-labeling of pull requests.
56-
It checks both title and body of pull request and adds appropriate labels. \
57-
**NOTE:** The auto-labeling mechanism will not remove labels once they're
58-
created. For example, If you end up changing PR title from `sec:` to `fix:`
59-
you'll have to manually remove `security` label.
60-
61-
On each commit to `main` branch, Release Drafter will update the next release
62-
draft. Once you're ready to create new version, simply publish the draft.
63-
64-
In addition to Release Drafter, we're also running a script which extracts
65-
explicitly listed release notes and breaking changes which are optionally
66-
defined in `## Release Notes` and `## Breaking Changes` headers.
65+
Refer to [RELEASE.md](./RELEASE.md) for more information on release process.
6766

6867
## Dependencies
6968

docs/RELEASE.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Release process
2+
3+
The internal release process is described in great detail
4+
[here](http://go/sloctl-release).
5+
6+
## Release automation details
7+
8+
We're using [Release Drafter](https://github.com/release-drafter/release-drafter)
9+
to automate release notes creation. Drafter also does its best to propose
10+
the next release version based on commit messages from `main` branch.
11+
12+
Release Drafter is also responsible for auto-labeling pull requests.
13+
It checks both title and body of the pull request and adds appropriate labels. \
14+
**NOTE:** The auto-labeling mechanism will not remove labels once they're
15+
created. For example, If you end up changing PR title from `sec:` to `fix:`
16+
you'll have to manually remove `security` label.
17+
18+
On each commit to `main` branch, Release Drafter will update the next release
19+
draft. Once you're ready to create new version, simply publish this draft.
20+
21+
In addition to Release Drafter, we're also running a script which extracts
22+
explicitly listed release notes and breaking changes which are optionally
23+
defined in `## Release Notes` and `## Breaking Changes` headers.
24+
It also performs a cleanup of the PR draft mitigating Release Drafter
25+
shortcomings.

go.mod

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ require (
66
github.com/go-playground/validator/v10 v10.18.0
77
github.com/goccy/go-yaml v1.11.3
88
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
9-
github.com/nobl9/nobl9-go v0.77.2
9+
github.com/nobl9/nobl9-go v0.78.0
1010
github.com/pkg/errors v0.9.1
11-
github.com/schollz/progressbar/v3 v3.14.1
11+
github.com/schollz/progressbar/v3 v3.14.2
1212
github.com/spf13/cobra v1.8.0
1313
github.com/stretchr/testify v1.8.4
1414
golang.org/x/sync v0.6.0
1515
)
1616

1717
require (
1818
github.com/BurntSushi/toml v1.3.2 // indirect
19-
github.com/aws/aws-sdk-go v1.49.16 // indirect
19+
github.com/aws/aws-sdk-go v1.50.27 // indirect
2020
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
2121
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2222
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
@@ -43,11 +43,12 @@ require (
4343
github.com/mitchellh/mapstructure v1.5.0 // indirect
4444
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
4545
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
46-
github.com/rivo/uniseg v0.4.4 // indirect
47-
github.com/rs/zerolog v1.31.0 // indirect
46+
github.com/rivo/uniseg v0.4.7 // indirect
47+
github.com/rs/zerolog v1.32.0 // indirect
4848
github.com/spf13/pflag v1.0.5 // indirect
49+
github.com/teambition/rrule-go v1.8.2 // indirect
4950
golang.org/x/crypto v0.19.0 // indirect
50-
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
51+
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
5152
golang.org/x/net v0.21.0 // indirect
5253
golang.org/x/sys v0.17.0 // indirect
5354
golang.org/x/term v0.17.0 // indirect

go.sum

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
22
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
3-
github.com/aws/aws-sdk-go v1.49.16 h1:KAQwhLg296hfffRdh+itA9p7Nx/3cXS/qOa3uF9ssig=
4-
github.com/aws/aws-sdk-go v1.49.16/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
3+
github.com/aws/aws-sdk-go v1.50.27 h1:96ifhrSuja+AzdP3W/T2337igqVQ2FcSIJYkk+0rCeA=
4+
github.com/aws/aws-sdk-go v1.50.27/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
55
github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I=
66
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
77
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
@@ -72,23 +72,23 @@ github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2Em
7272
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
7373
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
7474
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
75-
github.com/nobl9/nobl9-go v0.77.2 h1:EiUNXfc2QECaGZ8jisYdREk8WVksavOlaP7mNfz+IW4=
76-
github.com/nobl9/nobl9-go v0.77.2/go.mod h1:baz6btl+crjNVUPpJB5FPosQJvkh0L3AdNXWiALdj0E=
75+
github.com/nobl9/nobl9-go v0.78.0 h1:HiqU2Kf+fzh4rBpQjG3t3s0IZs2WctU6vVsBwHdCoiQ=
76+
github.com/nobl9/nobl9-go v0.78.0/go.mod h1:ahlPYD5QBWxYo6JO/j8nI4KgFtP6n/heY5e1XtzTwS4=
7777
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
7878
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
7979
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8080
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8181
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
8282
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
8383
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
84-
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
85-
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
84+
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
85+
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
8686
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
87-
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
88-
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
87+
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
88+
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
8989
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
90-
github.com/schollz/progressbar/v3 v3.14.1 h1:VD+MJPCr4s3wdhTc7OEJ/Z3dAeBzJ7yKH/P4lC5yRTI=
91-
github.com/schollz/progressbar/v3 v3.14.1/go.mod h1:Zc9xXneTzWXF81TGoqL71u0sBPjULtEHYtj/WVgVy8E=
90+
github.com/schollz/progressbar/v3 v3.14.2 h1:EducH6uNLIWsr560zSV1KrTeUb/wZGAHqyMFIEa99ks=
91+
github.com/schollz/progressbar/v3 v3.14.2/go.mod h1:aQAZQnhF4JGFtRJiw/eobaXpsqpVQAftEQ+hLGXaRc4=
9292
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
9393
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
9494
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -103,14 +103,16 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
103103
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
104104
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
105105
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
106+
github.com/teambition/rrule-go v1.8.2 h1:lIjpjvWTj9fFUZCmuoVDrKVOtdiyzbzc93qTmRVe/J8=
107+
github.com/teambition/rrule-go v1.8.2/go.mod h1:Ieq5AbrKGciP1V//Wq8ktsTXwSwJHDD5mD/wLBGl3p4=
106108
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
107109
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
108110
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
109111
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
110112
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
111113
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
112-
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM=
113-
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
114+
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA=
115+
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08=
114116
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
115117
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
116118
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -135,15 +137,13 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
135137
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
136138
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
137139
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
138-
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
139140
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
140141
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
141142
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
142143
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
143144
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
144145
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
145146
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
146-
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
147147
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
148148
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
149149
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=

internal/get.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ func (g *GetCmd) getObjects(ctx context.Context, args []string, kind manifest.Ki
358358
return nil, errors.New("'sloctl get alerts' does not support Project filtering," +
359359
" explicitly pass '-A' flag to fetch all Alerts.")
360360
}
361-
query := url.Values{
362-
objectsV1.QueryKeyName: args,
363-
objectsV1.QueryKeyLabels: parseFilterLabel(g.labels),
361+
query := url.Values{objectsV1.QueryKeyName: args}
362+
if len(g.labels) > 0 {
363+
query.Set(objectsV1.QueryKeyLabels, parseFilterLabel(g.labels))
364364
}
365365
header := http.Header{sdk.HeaderProject: []string{g.client.Config.Project}}
366366
objects, err := g.client.Objects().V1().Get(ctx, kind, header, query)
@@ -379,7 +379,7 @@ func (g *GetCmd) getObjects(ctx context.Context, args []string, kind manifest.Ki
379379
return objects, nil
380380
}
381381

382-
func parseFilterLabel(filterLabels []string) []string {
382+
func parseFilterLabel(filterLabels []string) string {
383383
labels := make(v1alpha.Labels)
384384
for _, filterLabel := range filterLabels {
385385
filteredLabels := strings.Split(filterLabel, ",")
@@ -404,7 +404,7 @@ func parseFilterLabel(filterLabels []string) []string {
404404
strLabels = append(strLabels, key)
405405
}
406406
}
407-
return strLabels
407+
return strings.Join(strLabels, ",")
408408
}
409409

410410
func (g *GetCmd) printObjects(objects interface{}) error {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"private": true,
44
"type": "module",
55
"devDependencies": {
6-
"cspell": "8.3.2",
6+
"cspell": "8.4.1",
77
"markdownlint-cli": "0.39.0",
8-
"yaml": "2.3.4"
8+
"yaml": "2.4.0"
99
},
1010
"scripts": {
1111
"check-trailing-whitespaces": "node ./scripts/check-trailing-whitespaces.js",

scripts/check-generate.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
set -e
44

5-
ENUM_PATH="*_enum.go"
65
TMP_DIR=$(mktemp -d)
76

87
cleanup_git() {
@@ -16,7 +15,7 @@ main() {
1615

1716
make -C "$TMP_DIR" generate
1817

19-
CHANGED=$(git -C "$TMP_DIR" diff --name-only "${ENUM_PATH}")
18+
CHANGED=$(git -C "$TMP_DIR" diff --name-only)
2019
if [ -n "${CHANGED}" ]; then
2120
printf >&2 "There are generated changes that are not committed:\n%s\n" "$CHANGED"
2221
exit 1

0 commit comments

Comments
 (0)