Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cd00457
feat(workflow): add serial/parallel execute mode for DMS job (#4600)
leebrouse Apr 13, 2026
58f4926
feat: add host agent version drift flag in privateKey list (#4589)
leebrouse Apr 15, 2026
11ed315
support filter by start and end time in release plan list (#4438)
PetrusZ Apr 15, 2026
2989530
change from plutus vendor to plutus enterprise (#4583)
PetrusZ Apr 15, 2026
f73f140
improve codehost error handling for better frontend experience (#4630)
huanghongbo-hhb Apr 15, 2026
3833e69
possibly fix on lark plugin v2 executing workflows (#4632)
jamsman94 Apr 16, 2026
402f34b
support Lark approval cc_groups in release plans (#4627)
Cynthia-0203 Apr 16, 2026
efad106
fix: agent version different issue (#4633)
leebrouse Apr 16, 2026
03e349f
fix output variables for plugin job (#4528)
PetrusZ Apr 17, 2026
85286b6
fix last_login_time when list user by role and sort by order (#4638)
PetrusZ Apr 17, 2026
9849a27
fix get deleted service by openapi (#4563)
PetrusZ Apr 17, 2026
81d8b93
fix workload update stucked in helm deploy (#4636)
PetrusZ Apr 17, 2026
ab5ef64
feat: support manual execution stage notification in workflow notify …
huanghongbo-hhb Apr 22, 2026
76adca9
add codehost-based yaml template support (#4637)
Cynthia-0203 Apr 22, 2026
1a15c54
feat: add independent scale permission (#4598)
leebrouse Apr 22, 2026
a8b3079
fix cleanup helm stuck statefulset in other cluster (#4645)
PetrusZ Apr 22, 2026
f4594df
delete relate deploy when delete vm service (#4639)
PetrusZ Apr 22, 2026
f1ed5e1
add edge case support (resource field) for ingress handling (#4622)
jamsman94 Apr 24, 2026
159c00a
return token when user disable mfa
PetrusZ Apr 15, 2026
a9d96a6
add executing result and description in release plan callback
PetrusZ Apr 15, 2026
3c528d6
fix generate api token
PetrusZ Apr 15, 2026
1798003
add license check for mfa
PetrusZ Apr 15, 2026
50b74e5
fix: allow repeated workflow job retries in release plans
Cynthia-0203 Apr 24, 2026
92d4b26
fix: allow repeated workflow job retries in release plans
Cynthia-0203 Apr 24, 2026
f76c3c1
retry create version not update status
PetrusZ Apr 27, 2026
a7c40df
fix(workflow): use product envs in task filters
huanghongbo-hhb Apr 24, 2026
198836c
fix: update TestType and add Source field in workflow template initia…
leozhang2018 Apr 24, 2026
7cf0e21
fix: enhance Zadig scanning job specification with Source and Scannin…
leozhang2018 Apr 24, 2026
6e79b59
fix:implement workflow task cancellation before deletion in DeleteWor…
leozhang2018 Apr 10, 2026
9b6c22d
remove useless code and database in user (#4648)
PetrusZ Apr 27, 2026
ca2116b
feat: support stage executor notifications for manual execution pause…
huanghongbo-hhb Apr 27, 2026
411dee2
fix(testing): validate generated workflow job names (#4655)
huanghongbo-hhb Apr 27, 2026
536e9b7
feat(permission): support global read-only role visibility across all…
leebrouse Apr 28, 2026
7345e97
add mfa bypass url (#4657)
PetrusZ May 6, 2026
6910a1d
feat(workflow): pass through webhook payload to runtime notifications
huanghongbo-hhb May 7, 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
81 changes: 81 additions & 0 deletions pkg/cli/upgradeassistant/cmd/check.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
Copyright 2021 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 cmd

import (
"fmt"

"github.com/spf13/cobra"

"github.com/koderover/zadig/v2/pkg/shared/client/plutusenterprise"
e "github.com/koderover/zadig/v2/pkg/tool/errors"
"github.com/koderover/zadig/v2/pkg/tool/log"
)

func init() {
rootCmd.AddCommand(checkUpgradeCmd)

checkUpgradeCmd.PersistentFlags().StringP("from-version", "f", oldestVersion, "current version to migrate from")
checkUpgradeCmd.PersistentFlags().StringP("to-version", "t", "", "target version to migrate to")
}

var checkUpgradeCmd = &cobra.Command{
Use: "check",
Short: "check if the upgrade is possible",
Long: `check if the upgrade is possible.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun()
},
Run: func(cmd *cobra.Command, args []string) {
from, _ := cmd.Flags().GetString("from-version")
to, _ := cmd.Flags().GetString("to-version")
if err := runCheckUpgrade(from, to); err != nil {
log.Fatal(err)
}
},
PostRun: func(cmd *cobra.Command, args []string) {
if err := postRun(); err != nil {
fmt.Println(err)
}
},
}

func runCheckUpgrade(from, to string) error {
if len(from) == 0 {
from = oldestVersion
}
if len(to) == 0 {
return fmt.Errorf("target version not assigned")
}

log.Infof("Checking upgrade from %s to %s", from, to)

resp, err := plutusenterprise.New().CheckUpgrade(from, to)
if err != nil {
nerr := e.ErrUpgradeNotAllowed.AddErr(err)
log.Error(nerr)
return nerr
}
if !resp.AllowUpgrade {
nerr := e.ErrUpgradeNotAllowed
log.Error(nerr)
return nerr
}

log.Info("Upgrade check passed")
return nil
}
23 changes: 16 additions & 7 deletions pkg/cli/upgradeassistant/cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ func init() {

migrateCmd.PersistentFlags().StringP("from-version", "f", oldestVersion, "current version to migrate from")
migrateCmd.PersistentFlags().StringP("to-version", "t", "", "target version to migrate to")
_ = viper.BindPFlag("fromVersion", migrateCmd.PersistentFlags().Lookup("from-version"))
_ = viper.BindPFlag("toVersion", migrateCmd.PersistentFlags().Lookup("to-version"))
}

var migrateCmd = &cobra.Command{
Expand All @@ -52,7 +50,9 @@ var migrateCmd = &cobra.Command{
return preRun()
},
Run: func(cmd *cobra.Command, args []string) {
if err := run(); err != nil {
from, _ := cmd.Flags().GetString("from-version")
to, _ := cmd.Flags().GetString("to-version")
if err := run(from, to); err != nil {
log.Fatal(err)
}
},
Expand Down Expand Up @@ -90,10 +90,7 @@ func nextVersionFromList(targetVersion semver.Version, versionList semver.Versio
return targetVersion.FinalizeVersion()
}

func run() error {
from := viper.GetString("fromVersion")
to := viper.GetString("toVersion")

func run(from, to string) error {
log.Infof("Migrating from %s to %s", from, to)

versionSets := sets.NewString()
Expand Down Expand Up @@ -159,6 +156,18 @@ func run() error {
upgradepath.AddHandler(upgradepath.VersionDatas.VersionIndex(rh.FromVersion), upgradepath.VersionDatas.VersionIndex(rh.ToVersion), rh.Fn)
}

// resp, err := plutusenterprise.New().CheckUpgrade(from, to)
// if err != nil {
// nerr := e.ErrUpgradeNotAllowed.AddErr(err)
// log.Error(nerr)
// return nerr
// }
// if !resp.AllowUpgrade {
// nerr := e.ErrUpgradeNotAllowed
// log.Error(nerr)
// return nerr
// }

err := upgradepath.UpgradeWithBestPath(from, to)
if err == nil {
log.Info("Migration finished")
Expand Down
Loading