-
Notifications
You must be signed in to change notification settings - Fork 0
feat(extension): add BuildManager extension for CI/CD integration #65
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
Closed
+734
−28
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
343fd79
feat(extension): add BuildManager extension for CI/CD integration
djuloori27 6ca9bc9
refactor(extension): simplify BuildManager interface and remove unuse…
djuloori27 936177c
refactor(extension): redesign BuildManager.Schedule to accept changes…
djuloori27 bfb2ba5
feat(extension): enhance BuildManager interface and add BuildStatusAc…
djuloori27 a10c7f9
docs(extension): update BuildManager README with latest interface cha…
djuloori27 025cf2a
refactor(extension): simplify BuildStatus enum and error contract
djuloori27 bf095ca
feat(extension): add metadata to Poll method and reorder BuildAction …
djuloori27 3da9f04
refactor(extension): remove ErrProviderUnavailable from errors.go
djuloori27 d009f94
refactor(entity): rename BuildStatusPassed to BuildStatusSucceeded
djuloori27 fc385f0
refactor(extension): rename parameter from id to buildID in Poll and …
djuloori27 539423f
refactor(entity): rename BuildAction to ChangeAction
djuloori27 4998f0b
refactor(entity): introduce BuildMetadata type for Poll return value
djuloori27 0bf45a8
docs(build): update README to reference BuildMetadata type
djuloori27 9e13403
refactor(build): refine BuildManager interface and documentation
djuloori27 58cebbe
docs(build): improve ChangeActionValidate comment clarity
djuloori27 9b862dc
docs(build): simplify BuildStatusCancelled comment
djuloori27 34d58d9
docs(build): remove context timeout explanation from Close method
djuloori27 1f9d780
refactor(build): remove context parameter from Close method
djuloori27 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,8 @@ func TestBuildStatus_IsTerminal(t *testing.T) { | |
| expected bool | ||
| }{ | ||
| { | ||
| name: "passed is terminal", | ||
| status: BuildStatusPassed, | ||
| name: "succeeded is terminal", | ||
| status: BuildStatusSucceeded, | ||
| expected: true, | ||
| }, | ||
| { | ||
|
|
@@ -28,30 +28,64 @@ func TestBuildStatus_IsTerminal(t *testing.T) { | |
| expected: true, | ||
| }, | ||
| { | ||
| name: "queued is not terminal", | ||
| status: BuildStatusQueued, | ||
| name: "accepted is not terminal", | ||
| status: BuildStatusAccepted, | ||
| expected: false, | ||
| }, | ||
| { | ||
| name: "running is not terminal", | ||
| status: BuildStatusRunning, | ||
| name: "unknown is not terminal", | ||
| status: BuildStatusUnknown, | ||
| expected: false, | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| assert.Equal(t, tt.expected, tt.status.IsTerminal()) | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| func TestBuildChange_Creation(t *testing.T) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change detector |
||
| tests := []struct { | ||
| name string | ||
| change BuildChange | ||
| wantID string | ||
| wantAction ChangeAction | ||
| }{ | ||
| { | ||
| name: "blocked is not terminal", | ||
| status: BuildStatusBlocked, | ||
| expected: false, | ||
| name: "apply action", | ||
| change: BuildChange{ | ||
| ChangeID: "PR-42", | ||
| Action: ChangeActionApply, | ||
| }, | ||
| wantID: "PR-42", | ||
| wantAction: ChangeActionApply, | ||
| }, | ||
| { | ||
| name: "unknown is not terminal", | ||
| status: BuildStatusUnknown, | ||
| expected: false, | ||
| name: "validate action", | ||
| change: BuildChange{ | ||
| ChangeID: "D12345", | ||
| Action: ChangeActionValidate, | ||
| }, | ||
| wantID: "D12345", | ||
| wantAction: ChangeActionValidate, | ||
| }, | ||
| { | ||
| name: "unknown action", | ||
| change: BuildChange{ | ||
| ChangeID: "123", | ||
| Action: ChangeActionUnknown, | ||
| }, | ||
| wantID: "123", | ||
| wantAction: ChangeActionUnknown, | ||
| }, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| assert.Equal(t, tt.expected, tt.status.IsTerminal()) | ||
| assert.Equal(t, tt.wantID, tt.change.ChangeID) | ||
| assert.Equal(t, tt.wantAction, tt.change.Action) | ||
| }) | ||
| } | ||
| } | ||
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,14 @@ | ||
| load("@rules_go//go:def.bzl", "go_library") | ||
|
|
||
| go_library( | ||
| name = "build", | ||
| srcs = [ | ||
| "build_manager.go", | ||
| "errors.go", | ||
| ], | ||
| importpath = "github.com/uber/submitqueue/extension/build", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "//entity", | ||
| ], | ||
| ) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this moment Change is just a list of URLs and provider is encoded into schema part of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't line number 76 good enough?