Skip to content

Commit 5cd1c9d

Browse files
build: automatically generate changelog (#349)
1 parent cb3bade commit 5cd1c9d

File tree

5 files changed

+156
-89
lines changed

5 files changed

+156
-89
lines changed

.circleci/config.yml

+62-3
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,22 @@ workflows:
5252
- test-prebuilt:
5353
name: test-linux-arm64
5454
executor: linux-arm64
55+
os: linux
56+
arch: arm64
5557
requires:
5658
- test-build-arm64-linux
5759
- test-prebuilt:
5860
name: test-mac
5961
executor: mac
62+
os: darwin
63+
arch: amd64
6064
requires:
6165
- test-build-amd64-darwin
6266
- test-prebuilt:
6367
name: test-windows
6468
executor: windows
69+
os: windows
70+
arch: amd64
6571
requires:
6672
- test-build-amd64-windows
6773
release-nightly:
@@ -73,6 +79,7 @@ workflows:
7379
only:
7480
- main
7581
jobs:
82+
- changelog
7683
- lint
7784
- check-openapi
7885
- test-race:
@@ -94,21 +101,28 @@ workflows:
94101
- test-prebuilt:
95102
name: test-linux-arm64
96103
executor: linux-arm64
104+
os: linux
105+
arch: arm64
97106
requires:
98107
- test-build-arm64-linux
99108
- test-prebuilt:
100109
name: test-mac
101110
executor: mac
111+
os: darwin
112+
arch: amd64
102113
requires:
103114
- test-build-amd64-darwin
104115
- test-prebuilt:
105116
name: test-windows
106117
executor: windows
118+
os: windows
119+
arch: amd64
107120
requires:
108121
- test-build-amd64-windows
109122
- release:
110123
is-nightly: true
111124
requires:
125+
- changelog
112126
- lint
113127
- check-openapi
114128
- test-linux-amd64
@@ -117,6 +131,12 @@ workflows:
117131
- test-windows
118132
release-tag:
119133
jobs:
134+
- changelog:
135+
filters:
136+
branches:
137+
ignore: /.*/
138+
tags:
139+
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
120140
- lint:
121141
filters:
122142
branches:
@@ -163,6 +183,8 @@ workflows:
163183
tags:
164184
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
165185
executor: linux-arm64
186+
os: linux
187+
arch: arm64
166188
requires:
167189
- test-build-arm64-linux
168190
- test-prebuilt:
@@ -173,6 +195,8 @@ workflows:
173195
tags:
174196
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
175197
executor: mac
198+
os: darwin
199+
arch: amd64
176200
requires:
177201
- test-build-amd64-darwin
178202
- test-prebuilt:
@@ -183,6 +207,8 @@ workflows:
183207
tags:
184208
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
185209
executor: windows
210+
os: windows
211+
arch: amd64
186212
requires:
187213
- test-build-amd64-windows
188214
- release:
@@ -193,6 +219,7 @@ workflows:
193219
only: /^v[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)[0-9]+)?$/
194220
is-nightly: false
195221
requires:
222+
- changelog
196223
- lint
197224
- check-openapi
198225
- test-linux-amd64
@@ -282,6 +309,8 @@ jobs:
282309
executor: linux-amd64
283310
steps:
284311
- checkout
312+
- attach_workspace:
313+
at: .
285314
- setup
286315
- run:
287316
name: Import GPG key
@@ -323,24 +352,28 @@ jobs:
323352
command: |
324353
export GOOS=<< parameters.os >>
325354
export GOARCH=<< parameters.arch >>
326-
./scripts/ci/build-tests.sh ./test-bin
355+
./scripts/ci/build-tests.sh ./test-bin-"$GOOS"-"$GOARCH"
327356
- persist_to_workspace:
328357
root: .
329358
paths:
330-
- ./test-bin
359+
- ./test-bin*
331360

332361
test-prebuilt:
333362
parameters:
334363
executor:
335364
type: executor
365+
os:
366+
type: string
367+
arch:
368+
type: string
336369
executor: << parameters.executor >>
337370
steps:
338371
- checkout
339372
- attach_workspace:
340373
at: .
341374
- run:
342375
name: Run tests
343-
command: ./scripts/ci/run-prebuilt-tests.sh $(pwd)/test-bin $(pwd)/test-results
376+
command: ./scripts/ci/run-prebuilt-tests.sh $(pwd)/test-bin-<< parameters.os >>-<< parameters.arch >> $(pwd)/test-results
344377
- store_artifacts:
345378
path: ./test-results
346379
destination: raw-test-output
@@ -359,3 +392,29 @@ jobs:
359392
destination: raw-test-output
360393
- store_test_results:
361394
path: ./test-results
395+
396+
changelog:
397+
docker:
398+
- image: quay.io/influxdb/changelogger:a20523cf8594eb93920e74d0189d6602a76a6146
399+
steps:
400+
- checkout
401+
- run:
402+
name: Generate changelog
403+
command: |
404+
CHANGELOG_FILE_NAME="CHANGELOG-CLI"
405+
if [ -n "<< pipeline.git.tag >>" ]; then
406+
CHANGELOG_FILE_NAME="CHANGELOG-CLI-<< pipeline.git.tag >>"
407+
fi
408+
409+
mkdir changelog_artifacts
410+
411+
echo -e "CHANGELOG for influx-cli commit ${CIRCLE_SHA1}\n" > changelog_artifacts/"$CHANGELOG_FILE_NAME".md
412+
echo "In addition to the list of changes below, please also see the [official release notes](https://docs.influxdata.com/influxdb/latest/reference/release-notes/influx-cli/) for other important information about this release." >> changelog_artifacts/"$CHANGELOG_FILE_NAME".md
413+
build-changelog-by-tags.sh HEAD v2.2.1 main >> changelog_artifacts/"$CHANGELOG_FILE_NAME".md
414+
cat ./scripts/ci/CHANGELOG_frozen.md >> changelog_artifacts/"$CHANGELOG_FILE_NAME".md
415+
- store_artifacts:
416+
path: changelog_artifacts/
417+
- persist_to_workspace:
418+
root: .
419+
paths:
420+
- changelog_artifacts

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ dist/
1111
# Test binary, built with `go test -c`
1212
*.test
1313

14+
# Directories mounted during the release process in CI
15+
test-bin-*/
16+
changelog_artifacts/
17+
1418
# Output of the go coverage tool, specifically when used with LiteIDE
1519
*.out
1620

.goreleaser.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
project_name: influx-cli
22

3-
# Do not make github release
3+
# Do not make github release or generate a changelog
44
release:
55
disable: true
6+
changelog:
7+
skip: true
68

79
builds:
810
- id: influx
@@ -87,3 +89,5 @@ blobs:
8789
bucket: dl.influxdata.com
8890
region: us-east-1
8991
folder: '{{if index .Env "IS_NIGHTLY"}}platform/nightlies/{{else}}influxdb/releases/{{end}}'
92+
extra_files:
93+
- glob: ./changelog_artifacts/CHANGELOG*.md

CHANGELOG.md

+3-85
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,5 @@
1-
## v2.2.1 [2021-11-09]
1+
The Changelog has moved!
22

3-
### Bug Fixes
3+
You can find it at the following URL:
44

5-
1. [316](https://github.com/influxdata/influx-cli/pull/316): Return a better error message on unknown subcommands. Thanks @slai!
6-
1. [318](https://github.com/influxdata/influx-cli/pull/318): Fix accidental swap of userID and orgID in `org members remove` API calls. Thanks @geek981108!
7-
8-
## v2.2.0 [2021-10-21]
9-
10-
### Features
11-
12-
1. [259](https://github.com/influxdata/influx-cli/pull/259): Add `-b` shorthand for `--bucket` to `delete`
13-
1. [285](https://github.com/influxdata/influx-cli/pull/285): Add short-hand `--all-access` and `--operator` options to `auth create`.
14-
1. [307](https://github.com/influxdata/influx-cli/pull/307): Handle pagination in `bucket list` to support displaying more than 20 buckets.
15-
16-
### Bug Fixes
17-
18-
1. [297](https://github.com/influxdata/influx-cli/pull/297): Detect and warn when `restore --full` changes the operator token.
19-
1. [302](https://github.com/influxdata/influx-cli/pull/302): Set newly-created config as active in `setup`.
20-
1. [305](https://github.com/influxdata/influx-cli/pull/305): Embed timezone data into Windows builds to avoid errors.
21-
22-
## v2.1.1 [2021-09-22]
23-
24-
### Go Version
25-
26-
This release upgrades the project to `go` version 1.17.
27-
28-
### Bug Fixes
29-
30-
1. [221](https://github.com/influxdata/influx-cli/pull/221): Fix shell completion for top-level `influx` commands.
31-
1. [228](https://github.com/influxdata/influx-cli/pull/228): Make global `--http-debug` flag visible in help text.
32-
1. [232](https://github.com/influxdata/influx-cli/pull/232): Don't set empty strings for IDs in permission resources.
33-
1. [236](https://github.com/influxdata/influx-cli/pull/236): Detect and error out on incorrect positional args.
34-
1. [255](https://github.com/influxdata/influx-cli/pull/255): Respect value of `--host` flag when writing CLI configs in `setup`.
35-
1. [272](https://github.com/influxdata/influx-cli/pull/272): Reduce overuse of "token" in help text.
36-
37-
## v2.1.0 [2021-07-29]
38-
39-
### New Repository
40-
41-
This is the initial release of the `influx` CLI from the [`influxdata/influx-cli`](https://github.com/influxdata/influx-cli/)
42-
GitHub repository.
43-
44-
### Breaking Changes
45-
46-
#### `influx write` skip-header parsing
47-
48-
The `write` command no longer supports `--skipHeader` as short-hand for `--skipHeader 1`. This change was made to
49-
simplify our CLI parser.
50-
51-
#### Stricter input validation for template-related commands
52-
53-
The `apply`, `export`, and `stacks` commands now raise errors when CLI options fail to parse instead of silently
54-
discarding bad inputs. This change was made to help users debug when their commands fail to execute as expected.
55-
56-
#### Server-side template summarization & validation
57-
58-
The `template` and `template validate` commands now use an API request to the server to perform their logic,
59-
instead of performing the work on the client-side. Offline summarization & validation is no longer supported.
60-
This change was made to avoid significant code duplication between `influxdb` and `influx-cli`, and to allow server-
61-
side template logic to evolve without requiring coordinated CLI changes.
62-
63-
#### `influx stacks --json` output conventions
64-
65-
The output of `influx stacks --json` previously used an UpperCamelCase naming convention for most, but not all, keys.
66-
The command now uses lowerCamelCase consistently for all objects keys, matching the schema returned by the API.
67-
68-
### Features
69-
70-
1. [33](https://github.com/influxdata/influx-cli/pull/33): Add global `--http-debug` flag to help inspect communication with InfluxDB servers.
71-
1. [52](https://github.com/influxdata/influx-cli/pull/52): Add `bucket-schema` commands to manage explicit measurement schemas in InfluxDB Cloud.
72-
1. [52](https://github.com/influxdata/influx-cli/pull/52): Update `bucket create` to allow setting a schema type.
73-
1. [52](https://github.com/influxdata/influx-cli/pull/52): Update `bucket list` to display schema types.
74-
1. [116](https://github.com/influxdata/influx-cli/pull/116): Reimplement `backup` to support downloading embedded SQL store from InfluxDB v2.1.x.
75-
1. [116](https://github.com/influxdata/influx-cli/pull/116): Add `--compression` flag to `backup` to support enabling/disabling GZIP compression of downloaded files.
76-
1. [121](https://github.com/influxdata/influx-cli/pull/121): Reimplement `restore` to support uploading embedded SQL store from InfluxDB v2.1.x.
77-
1. [191](https://github.com/influxdata/influx-cli/pull/191): Add `--password` flag to `user password` command to allow bypassing interactive prompt.
78-
1. [208](https://github.com/influxdata/influx-cli/pull/208): Bind `--skip-verify` flag to `INFLUX_SKIP_VERIFY` environment variable.
79-
80-
81-
### Bug Fixes
82-
83-
1. [35](https://github.com/influxdata/influx-cli/pull/35): Fix interactive password collection & color rendering in PowerShell.
84-
1. [97](https://github.com/influxdata/influx-cli/pull/97): `org members list` no longer hangs on organizations with more than 10 members.
85-
1. [109](https://github.com/influxdata/influx-cli/pull/109): Detect & warn when inputs to `write` contain standalone CR characters.
86-
1. [122](https://github.com/influxdata/influx-cli/pull/122): `dashboards` command now accepts `--org` flag, or falls back to default org in config.
87-
1. [140](https://github.com/influxdata/influx-cli/pull/140): Return a consistent error when responses fail to decode, with hints for OSS- our Cloud-only commands.
5+
https://dl.influxdata.com/platform/nightlies/master/CHANGELOG-CLI.md

scripts/ci/CHANGELOG_frozen.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
## v2.2.0 [2021-10-21]
2+
----------------------
3+
4+
### Features
5+
6+
1. [259](https://github.com/influxdata/influx-cli/pull/259): Add `-b` shorthand for `--bucket` to `delete`
7+
1. [285](https://github.com/influxdata/influx-cli/pull/285): Add short-hand `--all-access` and `--operator` options to `auth create`.
8+
1. [307](https://github.com/influxdata/influx-cli/pull/307): Handle pagination in `bucket list` to support displaying more than 20 buckets.
9+
10+
### Bug Fixes
11+
12+
1. [297](https://github.com/influxdata/influx-cli/pull/297): Detect and warn when `restore --full` changes the operator token.
13+
1. [302](https://github.com/influxdata/influx-cli/pull/302): Set newly-created config as active in `setup`.
14+
1. [305](https://github.com/influxdata/influx-cli/pull/305): Embed timezone data into Windows builds to avoid errors.
15+
16+
## v2.1.1 [2021-09-22]
17+
----------------------
18+
19+
### Go Version
20+
21+
This release upgrades the project to `go` version 1.17.
22+
23+
### Bug Fixes
24+
25+
1. [221](https://github.com/influxdata/influx-cli/pull/221): Fix shell completion for top-level `influx` commands.
26+
1. [228](https://github.com/influxdata/influx-cli/pull/228): Make global `--http-debug` flag visible in help text.
27+
1. [232](https://github.com/influxdata/influx-cli/pull/232): Don't set empty strings for IDs in permission resources.
28+
1. [236](https://github.com/influxdata/influx-cli/pull/236): Detect and error out on incorrect positional args.
29+
1. [255](https://github.com/influxdata/influx-cli/pull/255): Respect value of `--host` flag when writing CLI configs in `setup`.
30+
1. [272](https://github.com/influxdata/influx-cli/pull/272): Reduce overuse of "token" in help text.
31+
32+
## v2.1.0 [2021-07-29]
33+
----------------------
34+
35+
### New Repository
36+
37+
This is the initial release of the `influx` CLI from the [`influxdata/influx-cli`](https://github.com/influxdata/influx-cli/)
38+
GitHub repository.
39+
40+
### Breaking Changes
41+
42+
#### `influx write` skip-header parsing
43+
44+
The `write` command no longer supports `--skipHeader` as short-hand for `--skipHeader 1`. This change was made to
45+
simplify our CLI parser.
46+
47+
#### Stricter input validation for template-related commands
48+
49+
The `apply`, `export`, and `stacks` commands now raise errors when CLI options fail to parse instead of silently
50+
discarding bad inputs. This change was made to help users debug when their commands fail to execute as expected.
51+
52+
#### Server-side template summarization & validation
53+
54+
The `template` and `template validate` commands now use an API request to the server to perform their logic,
55+
instead of performing the work on the client-side. Offline summarization & validation is no longer supported.
56+
This change was made to avoid significant code duplication between `influxdb` and `influx-cli`, and to allow server-
57+
side template logic to evolve without requiring coordinated CLI changes.
58+
59+
#### `influx stacks --json` output conventions
60+
61+
The output of `influx stacks --json` previously used an UpperCamelCase naming convention for most, but not all, keys.
62+
The command now uses lowerCamelCase consistently for all objects keys, matching the schema returned by the API.
63+
64+
### Features
65+
66+
1. [33](https://github.com/influxdata/influx-cli/pull/33): Add global `--http-debug` flag to help inspect communication with InfluxDB servers.
67+
1. [52](https://github.com/influxdata/influx-cli/pull/52): Add `bucket-schema` commands to manage explicit measurement schemas in InfluxDB Cloud.
68+
1. [52](https://github.com/influxdata/influx-cli/pull/52): Update `bucket create` to allow setting a schema type.
69+
1. [52](https://github.com/influxdata/influx-cli/pull/52): Update `bucket list` to display schema types.
70+
1. [116](https://github.com/influxdata/influx-cli/pull/116): Reimplement `backup` to support downloading embedded SQL store from InfluxDB v2.1.x.
71+
1. [116](https://github.com/influxdata/influx-cli/pull/116): Add `--compression` flag to `backup` to support enabling/disabling GZIP compression of downloaded files.
72+
1. [121](https://github.com/influxdata/influx-cli/pull/121): Reimplement `restore` to support uploading embedded SQL store from InfluxDB v2.1.x.
73+
1. [191](https://github.com/influxdata/influx-cli/pull/191): Add `--password` flag to `user password` command to allow bypassing interactive prompt.
74+
1. [208](https://github.com/influxdata/influx-cli/pull/208): Bind `--skip-verify` flag to `INFLUX_SKIP_VERIFY` environment variable.
75+
76+
### Bug Fixes
77+
78+
1. [35](https://github.com/influxdata/influx-cli/pull/35): Fix interactive password collection & color rendering in PowerShell.
79+
1. [97](https://github.com/influxdata/influx-cli/pull/97): `org members list` no longer hangs on organizations with more than 10 members.
80+
1. [109](https://github.com/influxdata/influx-cli/pull/109): Detect & warn when inputs to `write` contain standalone CR characters.
81+
1. [122](https://github.com/influxdata/influx-cli/pull/122): `dashboards` command now accepts `--org` flag, or falls back to default org in config.
82+
1. [140](https://github.com/influxdata/influx-cli/pull/140): Return a consistent error when responses fail to decode, with hints for OSS- our Cloud-only commands.

0 commit comments

Comments
 (0)