Skip to content

Commit

Permalink
Allow scheduled release kickoff to start upcoming releases
Browse files Browse the repository at this point in the history
  • Loading branch information
nid90 committed Jan 16, 2025
1 parent 03ff755 commit b9fd35d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions app/libs/coordinators/start_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def call
raise "Could not kickoff a hotfix because the source tag does not exist" if hotfix_from_new_branch? && !hotfix_tag_exists?
raise "Could not kickoff a hotfix because the source release branch does not exist" if hotfix_from_previous_branch? && !hotfix_branch_exists?
raise "Cannot start a train that is not active!" if train.inactive?
raise "No more releases can be started until the ongoing release is finished!" if train.ongoing_release.present? && automatic
raise "No more releases can be started until the ongoing release is finished!" if train.upcoming_release.present? && !hotfix?
raise "Upcoming releases are not allowed for your train." if train.ongoing_release.present? && !train.upcoming_release_startable? && !hotfix?
raise "App is in draft mode, cannot start a release to public channels!" if train.app.in_draft_mode? && train.has_restricted_public_channels?
Expand All @@ -44,7 +43,6 @@ def call
def kickoff
train.with_lock do
raise AppInDraftMode.new("App is in draft mode, cannot start a release!") if train.app.in_draft_mode?
raise ReleaseAlreadyInProgress.new("No more releases can be started until the ongoing release is finished!") if train.ongoing_release.present? && automatic
raise ReleaseAlreadyInProgress.new("No more releases can be started until the ongoing release is finished!") if train.upcoming_release.present? && !hotfix?
raise UpcomingReleaseNotAllowed.new("Upcoming releases are not allowed for your train.") if train.ongoing_release.present? && !train.upcoming_release_startable? && !hotfix?
raise NothingToRelease.new("No diff since last release") if regular_release? && !train.diff_since_last_release?
Expand Down
7 changes: 0 additions & 7 deletions spec/libs/coordinators/start_release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@
}.to raise_error("Cannot start a train that is not active!")
end

it "raises an error when there is an existing ongoing release and the release is automatic" do
_existing_release = create(:release, :on_track, train:)
expect {
described_class.call(train, automatic: true)
}.to raise_error("No more releases can be started until the ongoing release is finished!")
end

it "raises an error when there is an existing upcoming release and the release is not a hotfix" do
_ongoing_release = create(:release, :on_track, train:)
_upcoming_release = create(:release, :on_track, train:)
Expand Down

0 comments on commit b9fd35d

Please sign in to comment.