From 387b302c7100a297ab81f3d4186488f9df73bef5 Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Fri, 17 Nov 2023 16:14:42 +0100 Subject: [PATCH] fix(docs): use pymdownx.tilde extension to render deleted content --- CHANGELOG.md | 8 ++++---- docs/docs/changelog.md | 8 ++++---- docs/mkdocs.yml | 3 ++- generators/charts/changelog.go | 10 +++++++--- generators/charts/changelog_test.go | 4 ++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37143b2f..cfca62ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [MAJOR.MINOR.PATCH] - YYYY-MM-DD -## v0.15.0 - 2023-11-16 +## v0.15.0 - 2023-11-17 - Upgrade to Go 1.21 - Add option to orphan resources. Thanks to @atarax @@ -28,7 +28,7 @@ URL. By setting this the SASL SSL OAuth2/OIDC authentication is enabled - Add `Kafka` field `userConfig.kafka.sasl_oauthbearer_sub_claim_name`, type `string`: Name of the scope from which to extract the subject claim from the JWT. Defaults to sub -- Change `Kafka` field `userConfig.kafka_version`: enum ~`[3.1, 3.3, 3.4, 3.5]`~ → `[3.1, 3.3, 3.4, +- Change `Kafka` field `userConfig.kafka_version`: enum ~~`[3.1, 3.3, 3.4, 3.5]`~~ → `[3.1, 3.3, 3.4, 3.5, 3.6]` - Change `Kafka` field `userConfig.tiered_storage.local_cache.size`: deprecated - Add `OpenSearch` field `userConfig.opensearch.indices_memory_max_index_buffer_size`, type `integer`: @@ -40,9 +40,9 @@ - Change `OpenSearch` field `userConfig.opensearch.auth_failure_listeners.internal_authentication_backend_limiting.type`: enum `[username]` - Change `OpenSearch` field `userConfig.opensearch.auth_failure_listeners.ip_rate_limiting.type`: enum `[ip]` -- Change `OpenSearch` field `userConfig.opensearch.search_max_buckets`: maximum ~`65536`~ → `1000000` +- Change `OpenSearch` field `userConfig.opensearch.search_max_buckets`: maximum ~~`65536`~~ → `1000000` - Change `ServiceIntegration` field `kafkaMirrormaker.kafka_mirrormaker.producer_max_request_size`: maximum - ~`67108864`~ → `268435456` + ~~`67108864`~~ → `268435456` ## v0.14.0 - 2023-09-21 diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index 169261ad..d720ecfe 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -1,6 +1,6 @@ # Changelog -## v0.15.0 - 2023-11-16 +## v0.15.0 - 2023-11-17 - Upgrade to Go 1.21 - Add option to orphan resources. Thanks to @atarax @@ -26,7 +26,7 @@ URL. By setting this the SASL SSL OAuth2/OIDC authentication is enabled - Add `Kafka` field `userConfig.kafka.sasl_oauthbearer_sub_claim_name`, type `string`: Name of the scope from which to extract the subject claim from the JWT. Defaults to sub -- Change `Kafka` field `userConfig.kafka_version`: enum ~`[3.1, 3.3, 3.4, 3.5]`~ → `[3.1, 3.3, 3.4, +- Change `Kafka` field `userConfig.kafka_version`: enum ~~`[3.1, 3.3, 3.4, 3.5]`~~ → `[3.1, 3.3, 3.4, 3.5, 3.6]` - Change `Kafka` field `userConfig.tiered_storage.local_cache.size`: deprecated - Add `OpenSearch` field `userConfig.opensearch.indices_memory_max_index_buffer_size`, type `integer`: @@ -38,9 +38,9 @@ - Change `OpenSearch` field `userConfig.opensearch.auth_failure_listeners.internal_authentication_backend_limiting.type`: enum `[username]` - Change `OpenSearch` field `userConfig.opensearch.auth_failure_listeners.ip_rate_limiting.type`: enum `[ip]` -- Change `OpenSearch` field `userConfig.opensearch.search_max_buckets`: maximum ~`65536`~ → `1000000` +- Change `OpenSearch` field `userConfig.opensearch.search_max_buckets`: maximum ~~`65536`~~ → `1000000` - Change `ServiceIntegration` field `kafkaMirrormaker.kafka_mirrormaker.producer_max_request_size`: maximum - ~`67108864`~ → `268435456` + ~~`67108864`~~ → `268435456` ## v0.14.0 - 2023-09-21 diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 662aef43..6a51dc52 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -15,9 +15,10 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences + - pymdownx.tilde + - pymdownx.details - tables - admonition - - pymdownx.details - attr_list - toc: permalink: true diff --git a/generators/charts/changelog.go b/generators/charts/changelog.go index 2355142c..1e571886 100644 --- a/generators/charts/changelog.go +++ b/generators/charts/changelog.go @@ -141,7 +141,7 @@ func fmtChanges(was, has *schema) string { return strings.Join(sortedKeys(changes), ", ") } -// fmtChange returns a string like: foo ~`0`~ → `1` or empty string +// fmtChange returns a string like: foo ~~`0`~~ → `1` or empty string func fmtChange[T any](title string, was, has *T) string { if cmp.Equal(was, has) { return "" @@ -167,9 +167,9 @@ func fmtWasHas(sep, was, has string) string { case was: return has case has: - return fmt.Sprintf("~%s~", was) + return fmt.Sprintf("~~%s~~", was) } - return fmt.Sprintf("~%s~%s%s", was, sep, has) + return fmt.Sprintf("~~%s~~%s%s", was, sep, has) } func strSlice(src []any) string { @@ -295,6 +295,10 @@ func updateChangelog(operatorPath, crdCharts string) (func() error, error) { changes = append(changes, kindChanges...) } + if len(changes) == 0 { + return nil + } + // Reads changelogFile changelogPath := path.Join(operatorPath, changelogFile) changelogBody, err := os.ReadFile(changelogPath) diff --git a/generators/charts/changelog_test.go b/generators/charts/changelog_test.go index 38d2bf0b..05f6e31c 100644 --- a/generators/charts/changelog_test.go +++ b/generators/charts/changelog_test.go @@ -75,8 +75,8 @@ func TestGenChangelog(t *testing.T) { require.NoError(t, err) expect := []string{"Add `Kafka` field `disk_space`, type `string`: The disk space of the service", - "Change `Kafka` field `cloudName`: enum ~`[bar, foo]`~ → `[bar, baz, foo]`, maxLength ~`120`~ → `256`, maximum ~`2`~ → `4`, minimum ~`1`~ → `3`", - "Change `Kafka` field `topic_name`: enum `[bar, baz, foo]`, format ~`^[1-9]*(GiB|G)*`~ → `^[1-9][0-9]*(GiB|G)*`, maxLength ~`111`~ → `249`, maximum `1000000`, minLength `1`, minimum `1`", + "Change `Kafka` field `cloudName`: enum ~~`[bar, foo]`~~ → `[bar, baz, foo]`, maxLength ~~`120`~~ → `256`, maximum ~~`2`~~ → `4`, minimum ~~`1`~~ → `3`", + "Change `Kafka` field `topic_name`: enum `[bar, baz, foo]`, format ~~`^[1-9]*(GiB|G)*`~~ → `^[1-9][0-9]*(GiB|G)*`, maxLength ~~`111`~~ → `249`, maximum `1000000`, minLength `1`, minimum `1`", "Remove `Kafka` field `karapace`, type `boolean`: Switch the service to use Karapace for schema registry and REST proxy", }