From adebb6cdc9b24db4786fbd1409818050f2b84df7 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Tue, 19 Mar 2024 22:32:10 +0400 Subject: [PATCH 1/4] Prepare v1.21.0 release --- CHANGELOG.md | 71 +++++++++++++++++++ website/docusaurus.config.js | 2 +- .../aggregation-operations/_category_.yml | 0 .../aggregation-pipeline-and-commands.md | 0 .../aggregation-stages.md | 0 .../basic-operations/_category_.yml | 0 .../basic-operations/create.md | 0 .../basic-operations/delete.md | 0 .../basic-operations/performing.md | 0 .../basic-operations/read.md | 0 .../basic-operations/update.md | 0 .../configuration/_category_.yml | 0 .../configuration/flags.md | 0 .../configuration/observability.md | 0 .../configuration/operation-modes.md | 15 ++-- .../configuration/oplog-support.md | 0 .../contributing/_category_.yml | 0 .../contributing/how-to-contribute.md | 0 .../contributing/writing-guide.md | 0 .../{version-v1.18 => version-v1.21}/diff.md | 0 .../indexes.md | 0 .../{version-v1.18 => version-v1.21}/main.md | 0 .../migration/_category_.yml | 0 .../migration/migrating-from-mongodb.md | 0 .../migration/premigration-testing.md | 63 +++++----------- .../operators/_category_.yml | 0 .../operators/query/_category_.yml | 0 .../operators/query/array-operators.md | 0 .../operators/query/bitwise-operators.md | 0 .../operators/query/comparison-operators.md | 0 .../operators/query/element-operators.md | 0 .../operators/query/evaluation-operators.md | 0 .../operators/query/logical-operators.md | 0 .../operators/update/_category_.yml | 0 .../update/array-update-operators.md | 0 .../update/field-update-operators.md | 0 .../pushdown.md | 0 .../quickstart-guide/_category_.yml | 0 .../quickstart-guide/deb.md | 0 .../quickstart-guide/docker.md | 0 .../quickstart-guide/go.md | 0 .../quickstart-guide/macos.md | 0 .../quickstart-guide/rpm.md | 0 .../quickstart-guide/windows.md | 0 .../reference/_category_.yml | 0 .../reference/glossary.md | 0 .../reference/supported-commands.md | 38 +++++----- .../security/_category_.yml | 0 .../security/authentication.md | 0 .../security/tls-connections.md | 0 .../telemetry.md | 2 +- .../understanding-ferretdb.md | 0 ...ebars.json => version-v1.21-sidebars.json} | 0 website/versions.json | 4 +- 54 files changed, 118 insertions(+), 77 deletions(-) rename website/versioned_docs/{version-v1.18 => version-v1.21}/aggregation-operations/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/aggregation-operations/aggregation-pipeline-and-commands.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/aggregation-operations/aggregation-stages.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/basic-operations/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/basic-operations/create.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/basic-operations/delete.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/basic-operations/performing.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/basic-operations/read.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/basic-operations/update.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/configuration/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/configuration/flags.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/configuration/observability.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/configuration/operation-modes.md (83%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/configuration/oplog-support.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/contributing/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/contributing/how-to-contribute.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/contributing/writing-guide.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/diff.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/indexes.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/main.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/migration/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/migration/migrating-from-mongodb.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/migration/premigration-testing.md (88%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/array-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/bitwise-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/comparison-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/element-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/evaluation-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/query/logical-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/update/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/update/array-update-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/operators/update/field-update-operators.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/pushdown.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/deb.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/docker.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/go.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/macos.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/rpm.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/quickstart-guide/windows.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/reference/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/reference/glossary.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/reference/supported-commands.md (98%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/security/_category_.yml (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/security/authentication.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/security/tls-connections.md (100%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/telemetry.md (99%) rename website/versioned_docs/{version-v1.18 => version-v1.21}/understanding-ferretdb.md (100%) rename website/versioned_sidebars/{version-v1.18-sidebars.json => version-v1.21-sidebars.json} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 042de036e976..570e97d64f16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,77 @@ +## [v1.21.0](https://github.com/FerretDB/FerretDB/releases/tag/v1.21.0) (2024-02-20) + +### New Features 🎉 + +- Add experimental `SCRAM-SHA-1`/`SCRAM-SHA-256` authentication support by @henvic in https://github.com/FerretDB/FerretDB/pull/4078 + +### Fixed Bugs 🐛 + +- Reorganize and fix `update`/`upsert` logic by @wazir-ahmed in https://github.com/FerretDB/FerretDB/pull/4069 + +### Enhancements 🛠 + +- Improve capped collection cleanup by @wazir-ahmed in https://github.com/FerretDB/FerretDB/pull/4118 +- Make batch sizes configurable by @kropidlowsky in https://github.com/FerretDB/FerretDB/pull/4149 + +### Documentation 📄 + +- Fix Codapi file error by @Fashander in https://github.com/FerretDB/FerretDB/pull/4077 +- Add Tembo QA blog post by @Fashander in https://github.com/FerretDB/FerretDB/pull/4081 +- Update correct image link by @Fashander in https://github.com/FerretDB/FerretDB/pull/4116 +- Add Pulumi blog post by @Fashander in https://github.com/FerretDB/FerretDB/pull/4102 +- Add Tembo to README by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4168 +- Remove some closed issues from documentation by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4172 + +### Other Changes 🤖 + +- Use Go 1.22 and bump deps by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4094 +- Add more fields to requests and responses by @rumyantseva in https://github.com/FerretDB/FerretDB/pull/4096 +- Revert SQLite version bump by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4106 +- Refactor `bson2` package by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4105 +- Use `bson2` package for wire queries and replies by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4108 +- Make logger configurable in the embedded `ferretdb` package by @fadyat in https://github.com/FerretDB/FerretDB/pull/4028 +- Fix `envtool run test` `-run` and `-skip` flags by @henvic in https://github.com/FerretDB/FerretDB/pull/4101 +- Add MySQL backend collection by @adetunjii in https://github.com/FerretDB/FerretDB/pull/4083 +- Ignore `maxTimeMS` argument in `count`, `insert`, `update`, `delete` by @farit2000 in https://github.com/FerretDB/FerretDB/pull/4121 +- Use correct salt length by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4126 +- Skip stuck tailable cursor test by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4131 +- Enforce new authentication by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4075 +- Replace `bson` with `bson2` in `wire` by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4110 +- Improve `OP_MSG` validity checks by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4135 +- Support speculative authenticate by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4111 +- Add MySQL backend by @adetunjii in https://github.com/FerretDB/FerretDB/pull/4137 +- Fix `saslContinue` crashing due to not found authentication conversation by @henvic in https://github.com/FerretDB/FerretDB/pull/4129 +- Cleanup TODO for speculative authenticate by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4143 +- Fix MySQL collection stats by @adetunjii in https://github.com/FerretDB/FerretDB/pull/4145 +- Use Go 1.22.1 by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4155 +- Advertise SCRAM / SASL support in addition to PLAIN by @henvic in https://github.com/FerretDB/FerretDB/pull/4113 +- Add linter to check truncate tag in blog posts by @sbshah97 in https://github.com/FerretDB/FerretDB/pull/4139 +- Fix PLAIN mechanism authentication incorrectly working by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4163 +- Improve `bson2` and `wire` logging by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4148 +- Fix logging of deeply nested documents by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4167 +- Support localhost exception by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4156 +- Do not use the flow style in the diff output by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4170 +- Do not use `fjson` by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4175 +- Remove `fjson` package by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4176 +- Fix `speculativeAuthenticate` panic on empty database by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4178 +- Move old `bson` package by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4177 +- Rename `bson2` to `bson` by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4179 +- Move Docker build files by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4180 +- Bump protobuf dependency to make CI happy by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4187 +- Use authentication enabled docker for integration test by @chilagrow in https://github.com/FerretDB/FerretDB/pull/4160 +- Bump `pgx` by @AlekSi in https://github.com/FerretDB/FerretDB/pull/4190 + +### New Contributors + +- @farit2000 made their first contribution in https://github.com/FerretDB/FerretDB/pull/4121 +- @sbshah97 made their first contribution in https://github.com/FerretDB/FerretDB/pull/4139 + +[All closed issues and pull requests](https://github.com/FerretDB/FerretDB/milestone/63?closed=1). +[All commits](https://github.com/FerretDB/FerretDB/compare/v1.20.1...v1.21.0). + ## [v1.20.1](https://github.com/FerretDB/FerretDB/releases/tag/v1.20.1) (2024-02-19) ### What's Changed diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 04e930bee90a..1aea063c5aa7 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -49,7 +49,7 @@ const config = { versions: { // the latest minus one minor - 'v1.19': { + 'v1.20': { banner: 'none', }, }, diff --git a/website/versioned_docs/version-v1.18/aggregation-operations/_category_.yml b/website/versioned_docs/version-v1.21/aggregation-operations/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/aggregation-operations/_category_.yml rename to website/versioned_docs/version-v1.21/aggregation-operations/_category_.yml diff --git a/website/versioned_docs/version-v1.18/aggregation-operations/aggregation-pipeline-and-commands.md b/website/versioned_docs/version-v1.21/aggregation-operations/aggregation-pipeline-and-commands.md similarity index 100% rename from website/versioned_docs/version-v1.18/aggregation-operations/aggregation-pipeline-and-commands.md rename to website/versioned_docs/version-v1.21/aggregation-operations/aggregation-pipeline-and-commands.md diff --git a/website/versioned_docs/version-v1.18/aggregation-operations/aggregation-stages.md b/website/versioned_docs/version-v1.21/aggregation-operations/aggregation-stages.md similarity index 100% rename from website/versioned_docs/version-v1.18/aggregation-operations/aggregation-stages.md rename to website/versioned_docs/version-v1.21/aggregation-operations/aggregation-stages.md diff --git a/website/versioned_docs/version-v1.18/basic-operations/_category_.yml b/website/versioned_docs/version-v1.21/basic-operations/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/basic-operations/_category_.yml rename to website/versioned_docs/version-v1.21/basic-operations/_category_.yml diff --git a/website/versioned_docs/version-v1.18/basic-operations/create.md b/website/versioned_docs/version-v1.21/basic-operations/create.md similarity index 100% rename from website/versioned_docs/version-v1.18/basic-operations/create.md rename to website/versioned_docs/version-v1.21/basic-operations/create.md diff --git a/website/versioned_docs/version-v1.18/basic-operations/delete.md b/website/versioned_docs/version-v1.21/basic-operations/delete.md similarity index 100% rename from website/versioned_docs/version-v1.18/basic-operations/delete.md rename to website/versioned_docs/version-v1.21/basic-operations/delete.md diff --git a/website/versioned_docs/version-v1.18/basic-operations/performing.md b/website/versioned_docs/version-v1.21/basic-operations/performing.md similarity index 100% rename from website/versioned_docs/version-v1.18/basic-operations/performing.md rename to website/versioned_docs/version-v1.21/basic-operations/performing.md diff --git a/website/versioned_docs/version-v1.18/basic-operations/read.md b/website/versioned_docs/version-v1.21/basic-operations/read.md similarity index 100% rename from website/versioned_docs/version-v1.18/basic-operations/read.md rename to website/versioned_docs/version-v1.21/basic-operations/read.md diff --git a/website/versioned_docs/version-v1.18/basic-operations/update.md b/website/versioned_docs/version-v1.21/basic-operations/update.md similarity index 100% rename from website/versioned_docs/version-v1.18/basic-operations/update.md rename to website/versioned_docs/version-v1.21/basic-operations/update.md diff --git a/website/versioned_docs/version-v1.18/configuration/_category_.yml b/website/versioned_docs/version-v1.21/configuration/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/configuration/_category_.yml rename to website/versioned_docs/version-v1.21/configuration/_category_.yml diff --git a/website/versioned_docs/version-v1.18/configuration/flags.md b/website/versioned_docs/version-v1.21/configuration/flags.md similarity index 100% rename from website/versioned_docs/version-v1.18/configuration/flags.md rename to website/versioned_docs/version-v1.21/configuration/flags.md diff --git a/website/versioned_docs/version-v1.18/configuration/observability.md b/website/versioned_docs/version-v1.21/configuration/observability.md similarity index 100% rename from website/versioned_docs/version-v1.18/configuration/observability.md rename to website/versioned_docs/version-v1.21/configuration/observability.md diff --git a/website/versioned_docs/version-v1.18/configuration/operation-modes.md b/website/versioned_docs/version-v1.21/configuration/operation-modes.md similarity index 83% rename from website/versioned_docs/version-v1.18/configuration/operation-modes.md rename to website/versioned_docs/version-v1.21/configuration/operation-modes.md index 7d3e5c587044..493d8cbf8f55 100644 --- a/website/versioned_docs/version-v1.18/configuration/operation-modes.md +++ b/website/versioned_docs/version-v1.21/configuration/operation-modes.md @@ -35,15 +35,16 @@ Header diff: --- res header +++ proxy header @@ -1 +1 @@ --length: 63, id: 14, response_to: 24, opcode: OP_MSG -+length: 64, id: 229, response_to: 24, opcode: OP_MSG +-length: 63, id: 4, response_to: 13, opcode: OP_MSG ++length: 191, id: 53, response_to: 13, opcode: OP_MSG Body diff: --- res body +++ proxy body -@@ -10,3 +10,3 @@ - ], -- "you": "127.0.0.1:57079", -+ "you": "172.19.0.1:59824", - "ok": { +@@ -7,4 +7,12 @@ + "Document": { +- "you": "127.0.0.1:64795", ++ "you": "192.168.65.1:21365", + "ok": 1.0, + }, ``` diff --git a/website/versioned_docs/version-v1.18/configuration/oplog-support.md b/website/versioned_docs/version-v1.21/configuration/oplog-support.md similarity index 100% rename from website/versioned_docs/version-v1.18/configuration/oplog-support.md rename to website/versioned_docs/version-v1.21/configuration/oplog-support.md diff --git a/website/versioned_docs/version-v1.18/contributing/_category_.yml b/website/versioned_docs/version-v1.21/contributing/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/contributing/_category_.yml rename to website/versioned_docs/version-v1.21/contributing/_category_.yml diff --git a/website/versioned_docs/version-v1.18/contributing/how-to-contribute.md b/website/versioned_docs/version-v1.21/contributing/how-to-contribute.md similarity index 100% rename from website/versioned_docs/version-v1.18/contributing/how-to-contribute.md rename to website/versioned_docs/version-v1.21/contributing/how-to-contribute.md diff --git a/website/versioned_docs/version-v1.18/contributing/writing-guide.md b/website/versioned_docs/version-v1.21/contributing/writing-guide.md similarity index 100% rename from website/versioned_docs/version-v1.18/contributing/writing-guide.md rename to website/versioned_docs/version-v1.21/contributing/writing-guide.md diff --git a/website/versioned_docs/version-v1.18/diff.md b/website/versioned_docs/version-v1.21/diff.md similarity index 100% rename from website/versioned_docs/version-v1.18/diff.md rename to website/versioned_docs/version-v1.21/diff.md diff --git a/website/versioned_docs/version-v1.18/indexes.md b/website/versioned_docs/version-v1.21/indexes.md similarity index 100% rename from website/versioned_docs/version-v1.18/indexes.md rename to website/versioned_docs/version-v1.21/indexes.md diff --git a/website/versioned_docs/version-v1.18/main.md b/website/versioned_docs/version-v1.21/main.md similarity index 100% rename from website/versioned_docs/version-v1.18/main.md rename to website/versioned_docs/version-v1.21/main.md diff --git a/website/versioned_docs/version-v1.18/migration/_category_.yml b/website/versioned_docs/version-v1.21/migration/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/migration/_category_.yml rename to website/versioned_docs/version-v1.21/migration/_category_.yml diff --git a/website/versioned_docs/version-v1.18/migration/migrating-from-mongodb.md b/website/versioned_docs/version-v1.21/migration/migrating-from-mongodb.md similarity index 100% rename from website/versioned_docs/version-v1.18/migration/migrating-from-mongodb.md rename to website/versioned_docs/version-v1.21/migration/migrating-from-mongodb.md diff --git a/website/versioned_docs/version-v1.18/migration/premigration-testing.md b/website/versioned_docs/version-v1.21/migration/premigration-testing.md similarity index 88% rename from website/versioned_docs/version-v1.18/migration/premigration-testing.md rename to website/versioned_docs/version-v1.21/migration/premigration-testing.md index fce33ba77e90..1cacce64e0a2 100644 --- a/website/versioned_docs/version-v1.18/migration/premigration-testing.md +++ b/website/versioned_docs/version-v1.21/migration/premigration-testing.md @@ -121,66 +121,37 @@ Continuing with the same example above, we can further examine the diff output w In the diff output below, however, we have discovered that the query cannot be serviced by our application because the `$first` accumulator operator is not implemented in FerretDB. ```diff -2023-08-29T13:25:09.048+0200 WARN // 127.0.0.1:33522 -> 127.0.0.1:27017 clientconn/conn.go:360 Header diff: +Header diff: --- res header +++ proxy header @@ -1 +1 @@ --length: 140, id: 2, response_to: 156, opcode: OP_MSG -+length: 181, id: 360, response_to: 156, opcode: OP_MSG +-length: 140, id: 8, response_to: 19, opcode: OP_MSG ++length: 306, id: 128, response_to: 19, opcode: OP_MSG Body diff: --- res body +++ proxy body -@@ -7,13 +7,41 @@ - "$k": [ -- "ok", -- "errmsg", -- "code", -- "codeName" -+ "cursor", -+ "ok" - ], +@@ -7,6 +7,25 @@ + "Document": { +- "ok": 0.0, +- "errmsg": "$group accumulator \"$first\" is not implemented yet", +- "code": 238, +- "codeName": "NotImplemented", + "cursor": { -+ "$k": [ -+ "firstBatch", -+ "id", -+ "ns" -+ ], + "firstBatch": [ + { -+ "$k": [ -+ "_id", -+ "firstPost" -+ ], -+ "_id": "Alice", -+ "firstPost": { -+ "$d": 1692527603134 -+ } ++ "_id": "Bob", ++ "firstPost": 2023-08-28T10:33:23.134Z, + }, + { -+ "$k": [ -+ "_id", -+ "firstPost" -+ ], -+ "_id": "Bob", -+ "firstPost": { -+ "$d": 1693218803134 -+ } -+ } ++ "_id": "Alice", ++ "firstPost": 2023-08-20T10:33:23.134Z, ++ }, + ], -+ "id": { -+ "$l": "0" -+ }, -+ "ns": "test.posts" ++ "id": int64(0), ++ "ns": "test.posts", + }, - "ok": { -- "$f": 0 -- }, -- "errmsg": "$group accumulator \"$first\" is not implemented yet", -- "code": 238, -- "codeName": "NotImplemented" -+ "$f": 1 -+ } ++ "ok": 1.0, }, ``` diff --git a/website/versioned_docs/version-v1.18/operators/_category_.yml b/website/versioned_docs/version-v1.21/operators/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/operators/_category_.yml rename to website/versioned_docs/version-v1.21/operators/_category_.yml diff --git a/website/versioned_docs/version-v1.18/operators/query/_category_.yml b/website/versioned_docs/version-v1.21/operators/query/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/_category_.yml rename to website/versioned_docs/version-v1.21/operators/query/_category_.yml diff --git a/website/versioned_docs/version-v1.18/operators/query/array-operators.md b/website/versioned_docs/version-v1.21/operators/query/array-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/array-operators.md rename to website/versioned_docs/version-v1.21/operators/query/array-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/query/bitwise-operators.md b/website/versioned_docs/version-v1.21/operators/query/bitwise-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/bitwise-operators.md rename to website/versioned_docs/version-v1.21/operators/query/bitwise-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/query/comparison-operators.md b/website/versioned_docs/version-v1.21/operators/query/comparison-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/comparison-operators.md rename to website/versioned_docs/version-v1.21/operators/query/comparison-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/query/element-operators.md b/website/versioned_docs/version-v1.21/operators/query/element-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/element-operators.md rename to website/versioned_docs/version-v1.21/operators/query/element-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/query/evaluation-operators.md b/website/versioned_docs/version-v1.21/operators/query/evaluation-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/evaluation-operators.md rename to website/versioned_docs/version-v1.21/operators/query/evaluation-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/query/logical-operators.md b/website/versioned_docs/version-v1.21/operators/query/logical-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/query/logical-operators.md rename to website/versioned_docs/version-v1.21/operators/query/logical-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/update/_category_.yml b/website/versioned_docs/version-v1.21/operators/update/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/operators/update/_category_.yml rename to website/versioned_docs/version-v1.21/operators/update/_category_.yml diff --git a/website/versioned_docs/version-v1.18/operators/update/array-update-operators.md b/website/versioned_docs/version-v1.21/operators/update/array-update-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/update/array-update-operators.md rename to website/versioned_docs/version-v1.21/operators/update/array-update-operators.md diff --git a/website/versioned_docs/version-v1.18/operators/update/field-update-operators.md b/website/versioned_docs/version-v1.21/operators/update/field-update-operators.md similarity index 100% rename from website/versioned_docs/version-v1.18/operators/update/field-update-operators.md rename to website/versioned_docs/version-v1.21/operators/update/field-update-operators.md diff --git a/website/versioned_docs/version-v1.18/pushdown.md b/website/versioned_docs/version-v1.21/pushdown.md similarity index 100% rename from website/versioned_docs/version-v1.18/pushdown.md rename to website/versioned_docs/version-v1.21/pushdown.md diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/_category_.yml b/website/versioned_docs/version-v1.21/quickstart-guide/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/_category_.yml rename to website/versioned_docs/version-v1.21/quickstart-guide/_category_.yml diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/deb.md b/website/versioned_docs/version-v1.21/quickstart-guide/deb.md similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/deb.md rename to website/versioned_docs/version-v1.21/quickstart-guide/deb.md diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/docker.md b/website/versioned_docs/version-v1.21/quickstart-guide/docker.md similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/docker.md rename to website/versioned_docs/version-v1.21/quickstart-guide/docker.md diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/go.md b/website/versioned_docs/version-v1.21/quickstart-guide/go.md similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/go.md rename to website/versioned_docs/version-v1.21/quickstart-guide/go.md diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/macos.md b/website/versioned_docs/version-v1.21/quickstart-guide/macos.md similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/macos.md rename to website/versioned_docs/version-v1.21/quickstart-guide/macos.md diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/rpm.md b/website/versioned_docs/version-v1.21/quickstart-guide/rpm.md similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/rpm.md rename to website/versioned_docs/version-v1.21/quickstart-guide/rpm.md diff --git a/website/versioned_docs/version-v1.18/quickstart-guide/windows.md b/website/versioned_docs/version-v1.21/quickstart-guide/windows.md similarity index 100% rename from website/versioned_docs/version-v1.18/quickstart-guide/windows.md rename to website/versioned_docs/version-v1.21/quickstart-guide/windows.md diff --git a/website/versioned_docs/version-v1.18/reference/_category_.yml b/website/versioned_docs/version-v1.21/reference/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/reference/_category_.yml rename to website/versioned_docs/version-v1.21/reference/_category_.yml diff --git a/website/versioned_docs/version-v1.18/reference/glossary.md b/website/versioned_docs/version-v1.21/reference/glossary.md similarity index 100% rename from website/versioned_docs/version-v1.18/reference/glossary.md rename to website/versioned_docs/version-v1.21/reference/glossary.md diff --git a/website/versioned_docs/version-v1.18/reference/supported-commands.md b/website/versioned_docs/version-v1.21/reference/supported-commands.md similarity index 98% rename from website/versioned_docs/version-v1.18/reference/supported-commands.md rename to website/versioned_docs/version-v1.21/reference/supported-commands.md index e26cc4142d76..bf6fc9ccfcb6 100644 --- a/website/versioned_docs/version-v1.18/reference/supported-commands.md +++ b/website/versioned_docs/version-v1.21/reference/supported-commands.md @@ -43,7 +43,7 @@ Use ❌ for commands and arguments that are not implemented at all. | | `showRecordId` | ✅ | | | | `tailable` | ✅ | | | | `oplogReplay` | ⚠️ | Ignored | -| | `noCursorTimeout` | ❌ | Unimplemented | +| | `noCursorTimeout` | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/4035) | | | `awaitData` | ✅ | | | | `allowPartialResults` | ❌ | Unimplemented | | | `collation` | ❌ | Unimplemented | @@ -66,7 +66,7 @@ Use ❌ for commands and arguments that are not implemented at all. | | `let` | ⚠️ | Unimplemented | | `getMore` | | ✅ | Basic command is fully supported | | | `batchSize` | ✅ | | -| | `maxTimeMS` | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/2984) | +| | `maxTimeMS` | ✅ | | | | `comment` | ⚠️ | Unimplemented | | `insert` | | ✅ | Basic command is fully supported | | | `documents` | ✅ | | @@ -109,7 +109,7 @@ The following operators and modifiers are available in the `update` and `findAnd | `$[]` | | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/824) | | `$addToSet` | | ✅️ | | | `$pop` | | ✅ | | -| `$pull` | | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/826) | +| `$pull` | | ✅ | | | `$push` | | ✅️ | | | `$pullAll` | | ✅️ | | | | `$each` | ✅️ | | @@ -131,8 +131,6 @@ The following operators are available in the `find` command `projection` argumen ## Query Plan Cache Commands -Related [issue](https://github.com/FerretDB/FerretDB/issues/78). - | Command | Argument | Status | Comments | | ----------------------- | ------------ | ------ | --------------------------------------------------------- | | `planCacheClear` | | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1502) | @@ -194,22 +192,22 @@ Related [issue](https://github.com/FerretDB/FerretDB/issues/78). | | `roles` | ⚠️ | | | | `writeConcern` | ⚠️ | | | | `comment` | ⚠️ | | -| `updateUser` | | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1496) | -| | `pwd` | ⚠️ | | -| | `customData` | ⚠️ | | -| | `roles` | ⚠️ | | -| | `digestPassword` | ⚠️ | | -| | `writeConcern` | ⚠️ | | -| | `authenticationRestrictions` | ⚠️ | | -| | `mechanisms` | ⚠️ | | -| | `digestPassword` | ⚠️ | | -| | `comment` | ⚠️ | | +| `updateUser` | | ✅ | | +| | `pwd` | | | +| | `customData` | | | +| | `roles` | | | +| | `digestPassword` | | | +| | `writeConcern` | | | +| | `authenticationRestrictions` | | | +| | `mechanisms` | | | +| | `digestPassword` | | | +| | `comment` | | | | `usersInfo` | | ✅ | | -| | `showCredentials` | ⚠️ | | +| | `showCredentials` | ✅ | | | | `showCustomData` | ⚠️ | | | | `showPrivileges` | ⚠️ | | | | `showAuthenticationRestrictions` | ⚠️ | | -| | `filter` | ⚠️ | | +| | `filter` | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/4141) | | | `comment` | ⚠️ | | ### Authentication Commands @@ -499,7 +497,7 @@ Related [issue](https://github.com/FerretDB/FerretDB/issues/1917). | `$subtract` (arithmetic) | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1453) | | `$subtract` (date) | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1460) | | `$sum` (accumulator) | ✅️ | | -| `$sum` (operator) | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/2680) | +| `$sum` (operator) | ✅️ | | | `$switch` | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1457) | | `$tan` | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1465) | | `$tanh` | ❌ | [Issue](https://github.com/FerretDB/FerretDB/issues/1465) | @@ -568,7 +566,7 @@ Related [issue](https://github.com/FerretDB/FerretDB/issues/1917). | | `expireAfterSeconds` | | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/2415) | | | `clusteredIndex` | | ⚠️ | | | | `changeStreamPreAndPostImages` | | ⚠️ | | -| | `autoIndexId` | | ⚠️ | Ignored | +| | `autoIndexId` | | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/3922) | | | `size` | | ✅️ | | | | `max` | | ✅ | | | | `storageEngine` | | ⚠️ | Ignored | @@ -642,7 +640,7 @@ Related [issue](https://github.com/FerretDB/FerretDB/issues/1917). | | `comment` | | ⚠️ | | | `listCollections` | | | ✅ | | | | `filter` | | ✅ | | -| | `nameOnly` | | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/3624) | +| | `nameOnly` | | ✅ | | | | `authorizedCollections` | | ⚠️ | [Issue](https://github.com/FerretDB/FerretDB/issues/3770) | | | `comment` | | ⚠️ | | | `listDatabases` | | | ✅ | | diff --git a/website/versioned_docs/version-v1.18/security/_category_.yml b/website/versioned_docs/version-v1.21/security/_category_.yml similarity index 100% rename from website/versioned_docs/version-v1.18/security/_category_.yml rename to website/versioned_docs/version-v1.21/security/_category_.yml diff --git a/website/versioned_docs/version-v1.18/security/authentication.md b/website/versioned_docs/version-v1.21/security/authentication.md similarity index 100% rename from website/versioned_docs/version-v1.18/security/authentication.md rename to website/versioned_docs/version-v1.21/security/authentication.md diff --git a/website/versioned_docs/version-v1.18/security/tls-connections.md b/website/versioned_docs/version-v1.21/security/tls-connections.md similarity index 100% rename from website/versioned_docs/version-v1.18/security/tls-connections.md rename to website/versioned_docs/version-v1.21/security/tls-connections.md diff --git a/website/versioned_docs/version-v1.18/telemetry.md b/website/versioned_docs/version-v1.21/telemetry.md similarity index 99% rename from website/versioned_docs/version-v1.18/telemetry.md rename to website/versioned_docs/version-v1.21/telemetry.md index 281fcb991ee7..e5ed588e2f7f 100644 --- a/website/versioned_docs/version-v1.18/telemetry.md +++ b/website/versioned_docs/version-v1.21/telemetry.md @@ -5,7 +5,7 @@ slug: /telemetry/ # referenced in many places; must not change # Telemetry reporting -FerretDB collects basic anonymous usage data and sends them to our telemetry service ([FerretDB Beacon](https://beacon.ferretdb.io)), +FerretDB collects basic anonymous usage data and sends them to our telemetry service ([FerretDB Beacon](https://beacon.ferretdb.com)), which helps us understand its usage, and how we can further increase compatibility and enhance our product. It also enables us to provide you information about available updates. diff --git a/website/versioned_docs/version-v1.18/understanding-ferretdb.md b/website/versioned_docs/version-v1.21/understanding-ferretdb.md similarity index 100% rename from website/versioned_docs/version-v1.18/understanding-ferretdb.md rename to website/versioned_docs/version-v1.21/understanding-ferretdb.md diff --git a/website/versioned_sidebars/version-v1.18-sidebars.json b/website/versioned_sidebars/version-v1.21-sidebars.json similarity index 100% rename from website/versioned_sidebars/version-v1.18-sidebars.json rename to website/versioned_sidebars/version-v1.21-sidebars.json diff --git a/website/versions.json b/website/versions.json index 761f89341462..370ed00fddd9 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,5 +1,5 @@ [ + "v1.21", "v1.20", - "v1.19", - "v1.18" + "v1.19" ] From 752af71d7161384e0ded962e7ebcfdc9d8dddd55 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 20 Mar 2024 07:18:11 +0400 Subject: [PATCH 2/4] Accept update info from the server --- internal/handler/msg_getlog.go | 13 +++++++----- internal/util/state/state.go | 6 ++++-- internal/util/telemetry/reporter.go | 7 +++++++ internal/util/telemetry/reporter_test.go | 25 +++++------------------- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/internal/handler/msg_getlog.go b/internal/handler/msg_getlog.go index 498c9462e9ab..0238d363f45f 100644 --- a/internal/handler/msg_getlog.go +++ b/internal/handler/msg_getlog.go @@ -113,14 +113,17 @@ func (h *Handler) MsgGetLog(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, "The telemetry state is undecided.", "Read more about FerretDB telemetry and how to opt out at https://beacon.ferretdb.com.", ) + case state.UpdateAvailable: - startupWarnings = append( - startupWarnings, - fmt.Sprintf( + msg := state.UpdateInfo + if msg == "" { + msg = fmt.Sprintf( "A new version available! The latest version: %s. The current version: %s.", state.LatestVersion, info.Version, - ), - ) + ) + } + + startupWarnings = append(startupWarnings, msg) } var log types.Array diff --git a/internal/util/state/state.go b/internal/util/state/state.go index 41dfd0a3754a..95a02bc38551 100644 --- a/internal/util/state/state.go +++ b/internal/util/state/state.go @@ -38,6 +38,7 @@ type State struct { // as reported by beacon, if known LatestVersion string `json:"-"` + UpdateInfo string `json:"-"` UpdateAvailable bool `json:"-"` } @@ -56,11 +57,11 @@ func (s *State) TelemetryString() string { // DisableTelemetry disables telemetry. // -// It also sets LatestVersion and UpdateAvailable to zero values -// to avoid stale values when telemetry is re-enabled. +// It also resets other telemetry fields to avoid stale values when telemetry is re-enabled. func (s *State) DisableTelemetry() { s.Telemetry = pointer.ToBool(false) s.LatestVersion = "" + s.UpdateInfo = "" s.UpdateAvailable = false } @@ -95,6 +96,7 @@ func (s *State) deepCopy() *State { BackendName: s.BackendName, BackendVersion: s.BackendVersion, LatestVersion: s.LatestVersion, + UpdateInfo: s.UpdateInfo, UpdateAvailable: s.UpdateAvailable, } } diff --git a/internal/util/telemetry/reporter.go b/internal/util/telemetry/reporter.go index ac71a89c169c..cf22d3fbdcc9 100644 --- a/internal/util/telemetry/reporter.go +++ b/internal/util/telemetry/reporter.go @@ -64,6 +64,7 @@ type request struct { // response represents telemetry response. type response struct { LatestVersion string `json:"latest_version"` + UpdateInfo string `json:"update_info"` UpdateAvailable bool `json:"update_available"` } @@ -296,6 +297,7 @@ func (r *Reporter) report(ctx context.Context) { if err = r.P.Update(func(s *state.State) { s.LatestVersion = response.LatestVersion + s.UpdateInfo = response.UpdateInfo s.UpdateAvailable = response.UpdateAvailable }); err != nil { r.L.Error("Failed to update state with latest version.", zap.Error(err)) @@ -303,6 +305,11 @@ func (r *Reporter) report(ctx context.Context) { } if s.UpdateAvailable { + if s.UpdateInfo != "" { + r.L.Info(s.UpdateInfo) + return + } + r.L.Info( "A new version available!", zap.String("current_version", request.Version), zap.String("latest_version", s.LatestVersion), diff --git a/internal/util/telemetry/reporter_test.go b/internal/util/telemetry/reporter_test.go index 8b87ee56826b..522a595408e0 100644 --- a/internal/util/telemetry/reporter_test.go +++ b/internal/util/telemetry/reporter_test.go @@ -138,61 +138,51 @@ func TestReporterReport(t *testing.T) { r, err := NewReporter(&opts) require.NoError(t, err) - // Check the initial state of the provider, it has not called telemetry yet, - // no update is available and unaware of the latest version. s := r.P.Get() assert.False(t, s.UpdateAvailable) assert.Empty(t, s.LatestVersion) - // Call the telemetry server and check the state of the provider to be updated. r.report(testutil.Ctx(t)) assert.Equal(t, 1, serverCalled) + s = r.P.Get() assert.True(t, s.UpdateAvailable) assert.Equal(t, "v1.2.1", s.LatestVersion) - // Set update available to false on the beacon side, and call the telemetry server again. telemetryResponse.UpdateAvailable = false + r.report(testutil.Ctx(t)) assert.Equal(t, 2, serverCalled) - // Expect the state of provider to be updated. s = r.P.Get() assert.False(t, s.UpdateAvailable) assert.Equal(t, "v1.2.1", s.LatestVersion) - // Set update available to true and update version, and call the telemetry server again. telemetryResponse.UpdateAvailable = true telemetryResponse.LatestVersion = "v1.2.0" + r.report(testutil.Ctx(t)) assert.Equal(t, 3, serverCalled) - // Expect the state and the version to be updated. s = r.P.Get() assert.True(t, s.UpdateAvailable) assert.Equal(t, "v1.2.0", s.LatestVersion) - // Disable telemetry and call the telemetry server again. require.NoError(t, sp.Update(func(s *state.State) { s.DisableTelemetry() })) - r.report(testutil.Ctx(t)) - // Expect no call to the telemetry server (number of calls should not change). + r.report(testutil.Ctx(t)) assert.Equal(t, 3, serverCalled) - // Expect no update available and latest version equal to the previous state. s = r.P.Get() assert.False(t, s.UpdateAvailable) assert.Empty(t, s.LatestVersion) - // Enable telemetry require.NoError(t, sp.Update(func(s *state.State) { s.EnableTelemetry() })) - - // Set a newer version to expect. telemetryResponse.LatestVersion = "v1.2.2" + r.report(testutil.Ctx(t)) assert.Equal(t, 4, serverCalled) - // Expect no update available and latest version equal to the previous state. s = r.P.Get() assert.True(t, s.UpdateAvailable) assert.Equal(t, "v1.2.2", s.LatestVersion) @@ -223,16 +213,11 @@ func TestReporterReport(t *testing.T) { r, err := NewReporter(&opts) require.NoError(t, err) - // Check the initial state of the provider, it has not called telemetry yet, - // no update is available and unaware of the latest version. s := r.P.Get() assert.False(t, s.UpdateAvailable) assert.Empty(t, s.LatestVersion) - // Call the telemetry server, as telemetry is disabled, expect no update to the provider. r.report(testutil.Ctx(t)) - - // Expect no call to the telemetry server (number of calls should not change). assert.Equal(t, 0, serverCalled) s = r.P.Get() From b47b762db9e11012c4aaa90cb12bce110b92d4e1 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 20 Mar 2024 09:21:01 +0400 Subject: [PATCH 3/4] Tweak logging --- internal/handler/msg_getlog.go | 2 +- internal/util/telemetry/reporter.go | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/handler/msg_getlog.go b/internal/handler/msg_getlog.go index 0238d363f45f..25ee42ebf047 100644 --- a/internal/handler/msg_getlog.go +++ b/internal/handler/msg_getlog.go @@ -114,7 +114,7 @@ func (h *Handler) MsgGetLog(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, "Read more about FerretDB telemetry and how to opt out at https://beacon.ferretdb.com.", ) - case state.UpdateAvailable: + case state.UpdateInfo != "", state.UpdateAvailable: msg := state.UpdateInfo if msg == "" { msg = fmt.Sprintf( diff --git a/internal/util/telemetry/reporter.go b/internal/util/telemetry/reporter.go index cf22d3fbdcc9..45541527522c 100644 --- a/internal/util/telemetry/reporter.go +++ b/internal/util/telemetry/reporter.go @@ -304,15 +304,12 @@ func (r *Reporter) report(ctx context.Context) { return } - if s.UpdateAvailable { - if s.UpdateInfo != "" { - r.L.Info(s.UpdateInfo) - return + if s.UpdateInfo != "" || s.UpdateAvailable { + msg := s.UpdateInfo + if msg == "" { + msg = "A new version available!" } - r.L.Info( - "A new version available!", - zap.String("current_version", request.Version), zap.String("latest_version", s.LatestVersion), - ) + r.L.Info(msg, zap.String("current_version", request.Version), zap.String("latest_version", s.LatestVersion)) } } From 1153fbf8880606b9cd3e4a58a7a9edb7f55a0fcb Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Wed, 20 Mar 2024 09:32:37 +0400 Subject: [PATCH 4/4] Tweak --- internal/util/telemetry/reporter.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/internal/util/telemetry/reporter.go b/internal/util/telemetry/reporter.go index 45541527522c..7dd75303fa51 100644 --- a/internal/util/telemetry/reporter.go +++ b/internal/util/telemetry/reporter.go @@ -290,9 +290,13 @@ func (r *Reporter) report(ctx context.Context) { r.L.Debug("Read telemetry response.", zap.Any("response", response)) - if response.LatestVersion == "" { - r.L.Debug("No latest version in telemetry response.") - return + if response.UpdateInfo != "" || response.UpdateAvailable { + msg := response.UpdateInfo + if msg == "" { + msg = "A new version available!" + } + + r.L.Info(msg, zap.String("current_version", request.Version), zap.String("latest_version", response.LatestVersion)) } if err = r.P.Update(func(s *state.State) { @@ -303,13 +307,4 @@ func (r *Reporter) report(ctx context.Context) { r.L.Error("Failed to update state with latest version.", zap.Error(err)) return } - - if s.UpdateInfo != "" || s.UpdateAvailable { - msg := s.UpdateInfo - if msg == "" { - msg = "A new version available!" - } - - r.L.Info(msg, zap.String("current_version", request.Version), zap.String("latest_version", s.LatestVersion)) - } }