You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(entity): promote RequestLandStrategy to shared entity/mergestrategy
## Summary
### Why?
The land-merge strategy enum lived in `submitqueue/entity` as `RequestLandStrategy`, but the upcoming runway merge-conflict contract needs the same type, and runway must not import `submitqueue/entity`. Mirroring the `Change` promotion in #240, the strategy belongs in the shared top-level `entity/` so both domains reference one type with no per-domain enum or mapping.
### What?
Moves `RequestLandStrategy` and its constants out of `submitqueue/entity/request.go` into a new top-level `entity/mergestrategy` package as `MergeStrategy` (`MergeStrategyUnknown/Rebase/SquashRebase/Merge`). `Request.LandStrategy` now has type `mergestrategy.MergeStrategy`. All references across the gateway and orchestrator controllers, entities, and tests are updated to the shared type. Pure mechanical refactor — no behavior change.
## Test Plan
✅ `bazel build //...`
✅ `bazel test //... --test_tag_filters=-integration,-e2e` (51 tests pass)
✅ `make gazelle` clean
// Licensed under the Apache License, Version 2.0 (the "License");
4
+
// you may not use this file except in compliance with the License.
5
+
// You may obtain a copy of the License at
6
+
//
7
+
// http://www.apache.org/licenses/LICENSE-2.0
8
+
//
9
+
// Unless required by applicable law or agreed to in writing, software
10
+
// distributed under the License is distributed on an "AS IS" BASIS,
11
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+
// See the License for the specific language governing permissions and
13
+
// limitations under the License.
14
+
15
+
// Package mergestrategy holds the shared source-control integration strategy
16
+
// used across SubmitQueue, runway, and other repo-local domains. It names how a
17
+
// change is integrated into the target branch (rebase, squash-rebase, merge).
18
+
package mergestrategy
19
+
20
+
// MergeStrategy defines the possible source control integration methods.
21
+
typeMergeStrategystring
22
+
23
+
const (
24
+
// MergeStrategyUnknown is the unknown strategy. It is set by default when the structure is initialized. It should never be seen in the system and is used for error control.
25
+
MergeStrategyUnknownMergeStrategy=""
26
+
// MergeStrategyRebase rebases commits onto the target branch before landing.
27
+
MergeStrategyRebaseMergeStrategy="rebase"
28
+
// MergeStrategySquashRebase squashes commits into a single commit before rebasing on top of the target branch.
Copy file name to clipboardExpand all lines: submitqueue/entity/request.go
+2-15Lines changed: 2 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -18,20 +18,7 @@ import (
18
18
"encoding/json"
19
19
20
20
"github.com/uber/submitqueue/entity/change"
21
-
)
22
-
23
-
// RequestLandStrategy defines the possible source control integration methods.
24
-
typeRequestLandStrategystring
25
-
26
-
const (
27
-
// RequestLandStrategyUnknown is the unknown strategy. It is set by default when the structure is initialized. It should never be seen in the system and used for error control.
28
-
RequestLandStrategyUnknownRequestLandStrategy=""
29
-
// RequestLandStrategyRebase rebases commits onto the target branch before landing.
// RequestLandStrategyMerge merges commits into the target branch by creating a separate merge commit, preserving the commit history along with hashes.
// RequestState defines the possible states of a land request. They are internal and used to implement a state machine. A separate RequestStatus type is used to track the customer-friendly status of a request.
@@ -96,7 +83,7 @@ type Request struct {
96
83
// Change is a number of code changes (such as pull requests) to land into the target branch. Target branch is defined by the queue configuration.
97
84
Change change.Change`json:"change"`
98
85
// LandStrategy is the source control integration strategy to use for this land operation.
0 commit comments