Skip to content

Commit

Permalink
[Backport 5.3.14141] release: disable promotion of development releas…
Browse files Browse the repository at this point in the history
…e & add --development flag to baseFlags (#62459)

release: disable promotion of development release & add --development flag to baseFlags (#62336)

(cherry picked from commit 90b797b)

Co-authored-by: Bolaji Olajide <25608335+BolajiOlajide@users.noreply.github.com>
  • Loading branch information
sourcegraph-release-bot and BolajiOlajide committed May 6, 2024
1 parent 5d7bfad commit 742b535
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions dev/sg/internal/release/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ func (r *releaseRunner) Test(ctx context.Context) error {
}

func (r *releaseRunner) Promote(ctx context.Context) error {
if r.isDevelopment {
announce2("promote", "Skipping promote, this is a development release")
return nil
}

if err := r.checkRequirements(ctx, stagePromoteCreate); err != nil {
return err
}
Expand All @@ -363,6 +368,11 @@ func (r *releaseRunner) Promote(ctx context.Context) error {
}

func (r *releaseRunner) PromoteFinalize(ctx context.Context) error {
if r.isDevelopment {
announce2("promote", "Skipping promote finalize, this is a development release")
return nil
}

if err := r.checkRequirements(ctx, stagePromoteFinalize); err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions dev/sg/internal/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ var releaseBaseFlags = []cli.Flag{
Value: false,
Usage: "Infer run configuration from last commit instead of flags.",
},
&cli.BoolFlag{
Name: "development",
Aliases: []string{"d"},
Usage: "Create a development release. This is a release that is not meant to be promoted to public, but is meant to be used by other developers to test their changes. It is not meant to be used by customers.",
},
}

// releaseRunFlags are the flags for the release run * subcommands. Version is optional here, because
Expand All @@ -69,11 +74,6 @@ var releaseCreatePromoteFlags = append(releaseBaseFlags, []cli.Flag{
Usage: "Force version (required)",
Required: true,
},
&cli.BoolFlag{
Name: "development",
Aliases: []string{"d"},
Usage: "Create a development release. This is a release that is not meant to be promoted to public, but is meant to be used by other developers to test their changes. It is not meant to be used by customers.",
},
}...)

var Command = &cli.Command{
Expand Down

0 comments on commit 742b535

Please sign in to comment.