Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0541218
chore(store): add ListResources + align gorm/memory empty-index seman…
mochengqian May 21, 2026
cec939e
fix(discovery): nil-guard zk rule delete + emit registry context on e…
mochengqian May 21, 2026
366033e
feat(versioning): backend immutable release ledger for traffic rules
mochengqian May 21, 2026
43567af
feat(versioning): UI history drawer, diff, and rollback for rule pages
mochengqian May 21, 2026
e1edfa0
test(versioning): end-to-end rollback drill
mochengqian May 21, 2026
3e29abd
fix(versioning): close gaps surfaced by the smoke drill
mochengqian May 22, 2026
c4397fa
fix(traffic): preserve priority/force/configVersion on rule edit forms
mochengqian May 22, 2026
10f17fd
chore: ignore local planning artifacts
mochengqian May 22, 2026
7e59e80
fix(versioning): close owner review correctness gaps
mochengqian May 22, 2026
65a822a
refactor(versioning): drop unused helpers and aliases
mochengqian May 22, 2026
9596f7e
fix(ui): plug rule diff editor leaks
mochengqian May 22, 2026
ee7e603
Remove local working memory files from .gitignore
mochengqian May 22, 2026
d5f034f
fix(versioning): add intent repair and abandon flows
mochengqian May 23, 2026
f131596
Merge pull request #1 from mochengqian/feat/Support-version-history-a…
mochengqian May 23, 2026
eee253e
Revert "feat: support traffic rule version history and rollback"
mochengqian May 23, 2026
d7cd149
Merge pull request #2 from mochengqian/revert-1-feat/Support-version-…
mochengqian May 25, 2026
6f2a8c5
fix(lock): use acquisition-scoped leases
mochengqian Jun 19, 2026
438cac7
refactor(versioning): split resource store responsibilities
mochengqian Jun 19, 2026
e7bca60
refactor(versioning): normalize events and reduce repair APIs
mochengqian Jun 19, 2026
45b3dd3
fix(lock): stop writes after lease loss
mochengqian Jun 19, 2026
ae52ff8
refactor(ui): remove unreachable state and simplify mocks
mochengqian Jun 19, 2026
88e1420
test(versioning): add multi-instance and lease failure coverage
mochengqian Jun 19, 2026
0888e4a
docs(versioning): update default-enabled guarantees
mochengqian Jun 19, 2026
771a523
fix: address rule versioning review blockers
mochengqian Jun 19, 2026
f227c10
fix: harden rule versioning correctness
mochengqian Jun 20, 2026
d49f46c
fix: address rule versioning review issues
mochengqian Jun 20, 2026
368ae9d
Fix rule version commit terminal semantics
mochengqian Jun 20, 2026
4de011a
fix(versioning): harden rule intent recovery
mochengqian Jun 20, 2026
1072ce0
fix(versioning): close intent recovery race windows
mochengqian Jun 20, 2026
1ad7607
Fix rule intent storage CAS and subscriber fallback
mochengqian Jun 20, 2026
53afc2c
Fix rule version committing recovery ordering
mochengqian Jun 20, 2026
1e6f9cd
Fix Go CI cache restore
mochengqian Jun 20, 2026
aaeb108
Clean up PR-only test files
mochengqian Jun 20, 2026
825f51f
docs(versioning): clarify invariants and recovery comments
mochengqian Jun 20, 2026
512cd46
20 maxVersion is suitable
mochengqian Jun 20, 2026
3b5f002
chore: limit rule version retention to 20
mochengqian Jun 21, 2026
f32d45d
refactor: simplify rule version history
mochengqian Jul 1, 2026
99d5218
refactor: restore core mutation and lock interfaces
mochengqian Jul 1, 2026
ca6f1e4
refactor: enforce lightweight rule history semantics
mochengqian Jul 1, 2026
1cc867d
refactor: clean rule history frontend semantics
mochengqian Jul 1, 2026
b9bf0aa
docs: describe lightweight rule history config
mochengqian Jul 1, 2026
e6be832
test: add frontend npm test script
mochengqian Jul 1, 2026
c04897b
fix: address copilot review comments
mochengqian Jul 1, 2026
4b4175b
fix: make rule versioning fail closed
mochengqian Jul 2, 2026
6a9f6f5
refactor: collapse versioning store abstraction
mochengqian Jul 2, 2026
6854b14
refactor: reuse resource helpers in rule versioning
mochengqian Jul 2, 2026
007875c
fix: address traffic rule history review blockers
mochengqian Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,9 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Cache dependencies
# ref: https://github.com/actions/cache/blob/main/examples.md#go---module
uses: actions/cache@v4
with:
# Cache, works only on Linux
path: |
~/.cache/go-build
~/go/pkg/mod
# Cache key
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: |
${{ runner.os }}-go-
cache-dependency-path: go.sum
- name: Check Code Format
run: make fmt && git status && [[ -z `git status -s` ]]
run: make fmt && git status && [[ -z $(git status -s) ]]
Comment on lines -72 to +74

@mochengqian mochengqian Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里修改的原因是,PR CI 在可靠运行 Go 测试之前就已失败(CI failure 有明确日志证据,在failed check 82487011873)。

失败的 GitHub Actions 任务显示了手动 Go 模块缓存恢复时出现的 tar 恢复错误,包括:

Failed to restore: "/usr/bin/tar" failed
Cannot open: File exists

该冲突源于缓存了整个 ~/go/pkg/mod 目录,而 Go 1.24/工具链管理机制以及 actions/setup-go 本身已会在模块缓存下填充由工具链管理的文件。在已存在工具链文件的情况下恢复该缓存,导致 Go 1.24 矩阵任务失败。

本次修复移除了针对 Go 模块的冗余手动 actions/cache 步骤,改为由 actions/setup-go@v5go.sum 作为依赖键来处理 Go 缓存。构建或测试命令本身未作更改:工作流仍然执行相同的前端构建、make fmt checkmake test

变更后,两个 Go CI 矩阵任务均通过:

  • CI(ubuntu-latest - Go 1.24):成功
  • CI(ubuntu-latest - Go 1.23):成功

- name: Run Unit Test
run: make test
# TODO(marsevilspirit): add lint
Expand Down
265 changes: 265 additions & 0 deletions api/mesh/v1alpha1/rule_version.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions api/mesh/v1alpha1/rule_version.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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.
*/

syntax = "proto3";

package dubbo.mesh.v1alpha1;

option go_package = "github.com/apache/dubbo-admin/api/mesh/v1alpha1";

import "google/protobuf/timestamp.proto";

// RuleVersion is a traffic-rule version entry. Entries are immutable after
// creation. Rollback appends a new RuleVersion, while retention may delete the
// oldest entries.
message RuleVersion {
// Parent rule information
string parent_rule_kind = 1; // e.g., "ConditionRoute"
string parent_rule_mesh = 2; // Mesh name
string parent_rule_name = 3; // Rule name

// Version metadata
int64 version_no = 4; // Sequential version number (1, 2, 3...)
string content_hash = 5; // SHA256 of normalized spec JSON

// Spec snapshot
string spec_json = 6; // JSON-serialized rule spec at this version

// Mutation context
string operation = 7; // CREATE, UPDATE, DELETE
string source = 8; // ADMIN, BOOTSTRAP, ROLLBACK
string author = 9; // User or system identifier
string reason = 10; // Change description

// rolled_back_from_id records the historical version whose snapshot was
// re-published to produce this version. It is audit metadata only and MUST NOT
// be used as a live-state pointer.
int64 rolled_back_from_id = 11;

// Timestamps
google.protobuf.Timestamp created_at = 12;
google.protobuf.Timestamp recorded_at = 13;
}
7 changes: 7 additions & 0 deletions app/dubbo-admin/dubbo-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ store:
# type: mysql
# address: root:123456@tcp(127.0.0.1:23306)/dubbo-admin?charset=utf8mb4&parseTime=True&loc=Asia%2FShanghai

# [Optional] version history and rollback for traffic rules.
# This records RuleVersion audit history. Supported governance rule mutations
# fail closed if the version ledger is unavailable or cannot record the
# mutation. Set maxVersionsPerRule to 0 to disable retention trimming.
ruleVersioning:
maxVersionsPerRule: 20

# [Necessary] configs for service discovery
discovery:
# [Necessary] discovery type, options are nacos2, zookeeper, mock(only for dev)
Expand Down
9 changes: 9 additions & 0 deletions docs/server-develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@ If you're using GoLand, you can run it locally by following steps:
2. Fill the block with the config that screenshot shows below:
![ide_configuration.png](./static/images/ide-config.png)
3. Modify the config file(app/dubbo-admin/dubbo-admin.yaml), make sure that the discovery, engine, store is configured.
Traffic-rule version history records RuleVersion audit entries for history, diff, and rollback material. Supported governance rule mutations fail closed if the version ledger is unavailable or cannot record the mutation.
4. Run the application, you can open the browser and visit localhost:8888/admin if everything works.

### Traffic-rule versioning notes

Traffic-rule versioning is always enabled for supported governance rule mutations. It uses the existing `RuleVersion` resource store to create a baseline/import entry for existing `ConditionRoute`, `TagRoute`, and `DynamicConfig` rules that have no history yet. Bootstrap is not reconciliation and does not record external registry changes after history exists.

Version entries are immutable after creation. Create, update, delete, and rollback first record the corresponding ledger entry and then use the normal ResourceManager write path. If the version ledger cannot record the entry, the registry mutation is rejected. DELETE versions are absence markers kept for audit/history continuity and cannot be used as rollback targets. `maxVersionsPerRule` retention may physically delete the oldest entries, so this is a bounded audit history and rollback aid, not a permanent compliance audit log or source of truth for current rule state.

The traffic-form field preservation fix stays with this versioning PR because version history smoke tests depend on round-tripping `priority`, `force`, and `configVersion` without losing fields. These notes document the review boundary instead of splitting the PR.


### Project catalog
We are currently restructuring the entire project, so the directory structure of the project will be changed in the near future.
Expand Down
Loading
Loading