diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c28775f9e442..09610d4cc4d8 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,136 @@ +## [v2.7.0]- 2024-12-23 + +### ✨ New Features + +1. Upgrade dockerfile java runtime version 8 to 17 +2. Upgrade SpringBoot to 3.x +3. Support ShenYu Admin Cluster +4. Upgrade checkstyle plugin to 3.4.0 +5. Datasource support OceanBase +6. Supports batch modification of selector/rule status +7. Supports batch modification of PathAuth status +8. Upgrade apache dubbo version +9. Support `Contribute with Gitpod` +10. Support Configs Export And Import +11. Add shenyu client heartbeat +12. Support Namespace +13. Support k8s dynamically scale +14. Invalidate Previous Tokens on New Login by Implementing Client ID Validation +15. Support for gray release in divide-plugin +16. Support Kubernetes registry +17. Add shenyu-plugin-wasm + +### ⚡Enhancement + +1. Add rocketmq logging e2e test +2. Enhance metrics-ratelimiter collect +3. Enhance metrics collection for Sentinel, Resilience4j, and Hystrix +4. Arrange sofa common tools dependencies +5. Remove expired comments +6. Add missing license +7. Set up callback for send message on Kafka +8. Use the loadbalance configuration from metadata for Dubbo +9. Add non null validation for upstream which obtained from select +10. Set timeout which from rule handle to dubbo rpc context +11. Publish event when enable selector and rule +12. Remove closed session from the NAMESPACE_SESSION_MAP +13. Add test case for ShenyuClientURIExecutorSubscriber +14. Add test case for `ShenyuClientIllegalArgumentException` +15. Add test case for `ShenyuClientRegisterEventPublisher` +16. Add test case for `ShenyuClientMetadataExecutorSubscriber` +17. Add test case for `AbstractWasmPluginDataHandler` +18. Add test case for `ShenyuClientRegisterRepositoryFactoryTest` +19. Add test case for `AbstractWasmDiscoveryHandler` +20. Upgrade sofa rpc version support +21. Add header key of Sign plugin to CrossFilter config +22. Encrypt the password +23. Add AbstractShenyuWasmPluginTest +24. RewritePlugin/ContextPathPlugin supports across application and plugin +25. Remove duplicate path check +26. Remove Alibaba Dubbo Support +27. Support docker env set http path +28. Add some code refactor improve +29. Support get token from cookie\header\param +30. Make the default value of ShenyuDubboService annotation equal to that of DubboService annotation +31. Add db script into admin package +32. Get rid of the dead code and add some improvements +33. MotanServiceEventListenerTest case optimization +34. Delete duplicate maven in shenyu-registry-eureka.xml +35. Jwt dependency updated +36. Print plugin execute time +37. Discovery Local support upstream health check in Admin +38. Close rule cache +39. Less concurrency +40. Optimize logic to avoid "orElse" execution,Update VersionTwoExtractor.java + +### ♻️Refactor + +1. Admin distributed lock by spring-integration-jdbc +2. Refactor beanUtils +3. Remove macos ci +4. Update logging plugin DataBuffer deprecated method +5. Modify e2e k8s to docker compose +6. Migrate Admin swagger from springfox to springdoc +7. Refactor springcloud plugin +8. Refactor some code +9. Delete SO_SNDBUF & SO_RCVBUF +10. Refactor shenyu-sync-data-http : replace log %s -> {}. +11. Optimizing the node type listener +12. Refactor plugin lifecycle +13. Adjust code order and remove invalid input parameters + +### 🐛Bug Fix + +1. Fix duplicate header for request plugin +2. Fix proxy.selector and discovery not delete when delete divide selector +3. Fix LoggingPlugin error log catch +4. Fix logging plugin sample bug +5. Fix memory overflow +6. Fix rewrite integrated test +7. Fix AbstractWasmPluginDataHandlerTest +8. Fix missing PRIMARY KEY in sql-script/h2/schema.sql +9. Fix Data dictionary page data sorting exception +10. FIx doc error +11. Resolve dashboard routing mismatch post context-path update +12. Fix etcd sync config problem +13. Fix consul sync problem +14. Fix the bug of being unable to query without registration +15. Fix Plugin Edit Page Issue by Correcting Plugin ID Query and Updating Data Type +16. Fix class AdminConstants has word spelling error +17. Fix shenyu-examples-springmvc start failed +18. Fix dashboard menu children sort not working problem +19. Fix ShenyuApacheDubboXmlProviderApplication config +20. Fix data sync dataId for proxy selector and discovery is not unique +21. Filter disable dict option +22. Fix SpringCloudParser MetaData null data +23. Fix client register validation +24. Config dubbo serialize-check-status=DISABLE +25. Fix example TestApacheDubboXmlApplication start failed +26. Fix the nacos data sync model missing the contextPath configuration +27. Fix SPI create non singleton objects in multi-threaded scenarios +28. Fix BadSqlGrammarException +29. Fix some word typo error +30. Fix ListUtil->merge exception +31. Fix metaData disable not filtered +32. Fix divide logging request method +33. Fix e2e chunk header error +34. Fix cookie error and sql check +35. Fixed NPE issue +36. Fix Invalid path error +37. Fix hot load issue +38. Fix e2e test case can not run wget command +39. Fix fallback issue +40. Fix some ci bugs +41. Resolve the sql error in rule-sqlmap.xml +42. Fix readYmlBuildRepository NPE +43. Fix nacos cannot be registered in the Shenyu-examples-SpringCloud project +44. Fix springCloud ruleData path setting didn't used +45. Fix shenyu-plugin-logging-elasticsearch : modify setIndexName of ElasticSearchLogConfig +46. Fix Not first offline from the gateway when stopping service +47. Fix k8s liveness probe can not run wget command error +48. Fix AbstractNodeDataSyncService load discoverUpstream on startup + + ## 2.6.1 ### New Features diff --git a/changelog.sh b/changelog.sh new file mode 100644 index 000000000000..2e78d5c09fdf --- /dev/null +++ b/changelog.sh @@ -0,0 +1,207 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# 配置 +FROM_TAG="" +TO_TAG="HEAD" +OUTPUT_FILE="CHANGELOG.md" +IGNORE_TYPES=("sync frontend" "merge") # 使用数组更清晰地管理忽略类型 +DATE_FORMAT="%Y-%m-%d" + +# 函数:处理错误并退出 +handle_error() { + echo "Error: $1" >&2 + exit 1 +} + +# 检查 git 是否安装 +command -v git >/dev/null 2>&1 || handle_error "git is not installed." + +# 生成类型标题 +generate_type_header() { + local type="$1" + case "$type" in + feat) echo "### ✨ New Features";; + fix) echo "### Bug Fixes";; # 修改标题为更常见的 "Bug Fixes" + improve) echo "### ⚡ Improvements";; + chore) echo "### Chore";; + refactor) echo "### ♻️ Refactor";; + docs) echo "### Documentation";; + style) echo "### Styles";; + perf) echo "### ⚡ Performance";; + test) echo "### ✅ Tests";; + build) echo "### Build";; + ci) echo "### CI";; + issue) echo "### Issues";; + task) echo "### Tasks";; + other) echo "### Other Changes";; + *) echo "### ❓ Unknown Type: $type";; + esac +} + +# 初始化变更日志 +initialize_changelog() { + local from="$1" + local to="$2" + local date=$(date +"$DATE_FORMAT") + + echo "# Changelog" > "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + echo "## [$to] - $date" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" +} + +# 规范化类型 +normalize_type() { + local type="$1" + type=$(echo "$type" | tr '[:upper:]' '[:lower:]') + case "$type" in + feature|feat) echo "feat";; + bugfix|fix) echo "fix";; # 将 bugfix 映射到 fix + improve|improvement) echo "improve";; + *) echo "$type";; + esac +} + +# 是否应该忽略类型 +should_ignore_type() { + local message="$1" + + # 精确匹配忽略的提交信息 + for ignore_message in "${IGNORE_TYPES[@]}"; do + if [[ "$message" == "$ignore_message" ]]; then + return 0 + fi + done + + # 忽略以 "Bump" 开头的提交(不区分大小写) + if echo "$message" | grep -qi "^bump"; then + return 0 + fi + return 1 +} + +# 提取类型 +extract_type() { + local message="$1" + local lower_message=$(echo "$message" | tr '[:upper:]' '[:lower:]') + local type=$(echo "$lower_message" | grep -oE '^\[type:([a-zA-Z]+)\]|^type:([a-zA-Z]+)|^\[([a-zA-Z]+)\]|^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|feature|bugfix|improve|task|issue):?' | sed -E 's/^\[type://; s/\]//g; s/^type://; s/^\[//; s/\]//; s/://') + if [ -z "$type" ]; then + echo "other" + else + normalize_type "$type" + fi +} + +# 清理提交信息 +clean_commit_message() { + local message="$1" + echo "$message" | sed -E 's/^\[type:[a-zA-Z]+\]//; s/^type:[a-zA-Z]+//; s/^\[[a-zA-Z]+\]//; s/^[a-zA-Z]+://; s/^ *//' +} + +# 生成变更日志 +generate_changelog() { + local from="$1" + local to="$2" + local tmp_file + + initialize_changelog "$from" "$to" + + git log "$from..$to" --pretty=format:'%s|%h|%an' | while IFS='|' read -r message hash author; do + type=$(extract_type "$message") + + if should_ignore_type "$message"; then # 传递完整的message给should_ignore_type + continue + fi + + clean_message=$(clean_commit_message "$message") + + tmp_file=$(mktemp) || handle_error "Failed to create temporary file." + echo "- ${clean_message} (${hash}) by ${author}" > "$tmp_file" + + if [ ! -f "tmp_${type}.txt" ]; then + mv "$tmp_file" "tmp_${type}.txt" + else + cat "$tmp_file" >> "tmp_${type}.txt" + rm "$tmp_file" + fi + done + + # 合并所有类型的变更 + for type in feat fix improve chore refactor docs style perf test build ci issue task other; do + if [ -f "tmp_${type}.txt" ]; then + generate_type_header "$type" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + cat "tmp_${type}.txt" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + rm "tmp_${type}.txt" + fi + done +} + +# 从最近的标签生成 +generate_from_latest_tag() { + local latest_tag + latest_tag=$(git describe --tags --abbrev=0 2>/dev/null) + + if [ -z "$latest_tag" ]; then + echo "No tags found. Generating changelog for all commits." + generate_changelog "" "$TO_TAG" + else + generate_changelog "$latest_tag" "$TO_TAG" + fi +} + +# 使用方法 +usage() { + echo "Usage: $0 [-f from_tag] [-t to_tag] [-o output_file]" + echo " -f: Starting tag (default: latest tag)" + echo " -t: Ending tag (default: HEAD)" + echo " -o: Output file (default: $OUTPUT_FILE)" + exit 1 +} + +# 解析命令行参数 +while getopts "f:t:o:h" opt; do + case "$opt" in + f) FROM_TAG="$OPTARG";; + t) TO_TAG="$OPTARG";; + o) OUTPUT_FILE="$OPTARG";; + h) usage;; + \?) usage;; + esac +done + +# 验证标签是否存在 +if [ ! -z "$FROM_TAG" ] && ! git rev-parse --verify "$FROM_TAG" > /dev/null 2>&1 ; then + handle_error "Invalid from tag: $FROM_TAG" +fi + +if [ ! -z "$TO_TAG" ] && ! git rev-parse --verify "$TO_TAG" > /dev/null 2>&1 ; then + handle_error "Invalid to tag: $TO_TAG" +fi + +# 执行生成 +if [ -z "$FROM_TAG" ]; then + generate_from_latest_tag +else + generate_changelog "$FROM_TAG" "$TO_TAG" +fi + +echo "Changelog has been generated in $OUTPUT_FILE" \ No newline at end of file