-
Notifications
You must be signed in to change notification settings - Fork 907
feat: add release plan collaboration and versioned diffs #4689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
leozhang2018
merged 48 commits into
koderover:main
from
huanghongbo-hhb:feat/release-plan-collaboration-v1
Jul 24, 2026
Merged
Changes from 42 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
cde3380
feat: add release plan collaboration and versioned diffs
huanghongbo-hhb ac78461
chore: remove release plan RFC from PR
huanghongbo-hhb ac6efbe
refactor: simplify release plan version semantics
huanghongbo-hhb 4f71191
chore: extend release plan collaboration ttl
huanghongbo-hhb db5a8c8
fix: align release plan approval logs in watcher
huanghongbo-hhb ebbde9f
fix: harden release plan collaboration flows
huanghongbo-hhb 01e61c6
feat: support ordered release plan diffs
huanghongbo-hhb 950e019
chore: remove diff tests from pr
huanghongbo-hhb 8d3ec5d
refactor: simplify release plan diff labels
huanghongbo-hhb c0bd8a9
fix release plan collaboration cleanup and diff order
huanghongbo-hhb dd011f9
fix: improve release plan target order labels
huanghongbo-hhb 4812543
fix: refine release plan version diff snapshots
huanghongbo-hhb 6ab9efd
fix: polish release plan collaboration follow-ups
huanghongbo-hhb 9739584
fix: harden release plan collaboration lifecycle
huanghongbo-hhb 551e9a9
chore: remove release plan test files from pr
huanghongbo-hhb fac3036
fix: preserve release plan initial diff baseline
huanghongbo-hhb 57fa175
fix: align release plan workflow diff snapshot
huanghongbo-hhb 90b0220
fix: enrich release plan workflow snapshot
huanghongbo-hhb 8b7f058
fix: log workflow snapshot recover events
huanghongbo-hhb f1a5a99
fix: keep workflow skipped flag in release plan snapshot
huanghongbo-hhb 9122345
fix: backfill incomplete workflow diff base snapshot
huanghongbo-hhb ccdf6d0
feat: expose approval snapshot diff display mode
huanghongbo-hhb 38f0eac
fix: preserve rich text release plan diff values
huanghongbo-hhb 5186748
fix: skip empty release plan logs
huanghongbo-hhb cee6350
fix: cap diff depth and batch collab reads
huanghongbo-hhb 928c28c
refactor: align release plan metadata section keys
huanghongbo-hhb 40b6860
fix: skip empty release plan snapshot changes
huanghongbo-hhb fcbb3be
fix: ignore derived approval users in release plan logs
huanghongbo-hhb 1ad1771
fix: refine release plan metadata diff display
huanghongbo-hhb 6ccffce
fix: stabilize release plan workflow diff snapshots
huanghongbo-hhb 8a6be57
fix: compat legacy release plan workflow lookup fields
huanghongbo-hhb 167170e
fix: normalize legacy release plan workflow specs
huanghongbo-hhb 65bf542
perf: optimize release plan workflow snapshots
huanghongbo-hhb 97126c0
fix: normalize release plan rich text diff
huanghongbo-hhb 746117b
fix: isolate release plan workflow snapshot cache
huanghongbo-hhb 408c443
fix: avoid no-op release plan collaboration updates
huanghongbo-hhb f99f5eb
fix: include release jobs in initial release plan diff
huanghongbo-hhb c8d136c
fix: skip empty initial release plan diffs
huanghongbo-hhb 4a46128
fix: treat empty release job rich text as unchanged
huanghongbo-hhb 698c3d1
fix: retain initial release job diffs
huanghongbo-hhb 030cc2a
fix: address release plan review findings
huanghongbo-hhb c34dd06
refactor: simplify release plan diff helpers
huanghongbo-hhb a20ed93
refactor: address release plan review comments
huanghongbo-hhb 3a76e30
fix: use explicit release plan transactions
huanghongbo-hhb 72591c5
fix: retain release plan versions without diffs
huanghongbo-hhb 30fb011
fix: finalize Mongo transaction handling
huanghongbo-hhb fb3cb6d
refactor: simplify release plan path joining
huanghongbo-hhb d856cea
fix: handle nil transaction return error
huanghongbo-hhb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
pkg/microservice/aslan/core/common/repository/mongodb/release_plan_version.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| /* | ||
| * Copyright 2026 The KodeRover Authors. | ||
| * | ||
| * Licensed 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. | ||
| */ | ||
|
|
||
| package mongodb | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/pkg/errors" | ||
| "go.mongodb.org/mongo-driver/bson" | ||
| "go.mongodb.org/mongo-driver/mongo" | ||
| "go.mongodb.org/mongo-driver/mongo/options" | ||
|
|
||
| "github.com/koderover/zadig/v2/pkg/microservice/aslan/config" | ||
| "github.com/koderover/zadig/v2/pkg/microservice/aslan/core/common/repository/models" | ||
| mongotool "github.com/koderover/zadig/v2/pkg/tool/mongo" | ||
| ) | ||
|
|
||
| type ReleasePlanVersionColl struct { | ||
| *mongo.Collection | ||
|
|
||
| coll string | ||
| } | ||
|
|
||
| func NewReleasePlanVersionColl() *ReleasePlanVersionColl { | ||
| name := models.ReleasePlanVersion{}.TableName() | ||
| return &ReleasePlanVersionColl{ | ||
| Collection: mongotool.Database(config.MongoDatabase()).Collection(name), | ||
| coll: name, | ||
| } | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) GetCollectionName() string { | ||
| return c.coll | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) EnsureIndex(ctx context.Context) error { | ||
| mod := []mongo.IndexModel{ | ||
| { | ||
| Keys: bson.D{{Key: "plan_id", Value: 1}, {Key: "version", Value: 1}}, | ||
| Options: options.Index().SetUnique(true), | ||
| }, | ||
| { | ||
| Keys: bson.D{{Key: "plan_id", Value: 1}, {Key: "created_at", Value: -1}}, | ||
| }, | ||
| } | ||
|
|
||
| _, err := c.Indexes().CreateMany(ctx, mod, mongotool.CreateIndexOptions(ctx)) | ||
| return err | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) CreateWithCtx(ctx context.Context, args *models.ReleasePlanVersion) error { | ||
| if args == nil { | ||
| return errors.New("nil ReleasePlanVersion") | ||
| } | ||
|
|
||
| _, err := c.InsertOne(ctx, args) | ||
| return err | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) UpsertWithCtx(ctx context.Context, args *models.ReleasePlanVersion) error { | ||
| if args == nil { | ||
| return errors.New("nil ReleasePlanVersion") | ||
| } | ||
|
|
||
| _, err := c.ReplaceOne(ctx, bson.M{ | ||
| "plan_id": args.PlanID, | ||
| "version": args.Version, | ||
| }, args, options.Replace().SetUpsert(true)) | ||
| return err | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) DeleteWithCtx(ctx context.Context, planID string, version int64) error { | ||
| _, err := c.DeleteOne(ctx, bson.M{ | ||
| "plan_id": planID, | ||
| "version": version, | ||
| }) | ||
| return err | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) Get(planID string, version int64) (*models.ReleasePlanVersion, error) { | ||
| resp := new(models.ReleasePlanVersion) | ||
| err := c.FindOne(context.Background(), bson.M{ | ||
| "plan_id": planID, | ||
| "version": version, | ||
| }).Decode(resp) | ||
| return resp, err | ||
| } | ||
|
|
||
| func (c *ReleasePlanVersionColl) GetLatestBySectionsBefore(planID string, sectionKeys []string, beforeVersion int64) (*models.ReleasePlanVersion, error) { | ||
| resp := new(models.ReleasePlanVersion) | ||
| err := c.FindOne(context.Background(), bson.M{ | ||
| "plan_id": planID, | ||
| "version": bson.M{"$lt": beforeVersion}, | ||
| "section_key": bson.M{ | ||
| "$in": sectionKeys, | ||
| }, | ||
| }, options.FindOne().SetSort(bson.D{{Key: "version", Value: -1}})).Decode(resp) | ||
| return resp, err | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.