-
Notifications
You must be signed in to change notification settings - Fork 18
chore: init workflow manager #759
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
Changes from all commits
f81baab
5c31191
1c19027
60383de
8d8b9a1
833a520
0ed372f
f7b078f
474d960
d68c434
2c16dee
cb0df85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package oapi | ||
|
|
||
| func (w *Workflow) Map() map[string]interface{} { | ||
| return structToMap(w) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package argo | ||
|
|
||
| import ( | ||
| "context" | ||
| "workspace-engine/pkg/workspace/jobagents/types" | ||
| "workspace-engine/pkg/workspace/store" | ||
| ) | ||
|
|
||
| var _ types.Dispatchable = &ArgoApplication{} | ||
|
|
||
| type ArgoApplication struct { | ||
| store *store.Store | ||
| } | ||
|
|
||
| func NewArgoApplication(store *store.Store) *ArgoApplication { | ||
| return &ArgoApplication{store: store} | ||
| } | ||
|
|
||
| func (a *ArgoApplication) Type() string { | ||
| return "argo-application" | ||
| } | ||
|
|
||
| func (a *ArgoApplication) Supports() types.Capabilities { | ||
| return types.Capabilities{ | ||
| Workflows: true, | ||
| Deployments: false, | ||
| } | ||
| } | ||
|
|
||
| func (a *ArgoApplication) Dispatch(ctx context.Context, context types.RenderContext) error { | ||
| panic("unimplemented") | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||||||||
| package github | ||||||||||||||||
|
|
||||||||||||||||
| import ( | ||||||||||||||||
| "context" | ||||||||||||||||
| "workspace-engine/pkg/workspace/jobagents/types" | ||||||||||||||||
| "workspace-engine/pkg/workspace/store" | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| var _ types.Dispatchable = &GithubAction{} | ||||||||||||||||
|
|
||||||||||||||||
| type GithubAction struct { | ||||||||||||||||
| store *store.Store | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| func NewGithubAction(store *store.Store) *GithubAction { | ||||||||||||||||
| return &GithubAction{store: store} | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| func (a *GithubAction) Type() string { | ||||||||||||||||
| return "github-action" | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| func (a *GithubAction) Supports() types.Capabilities { | ||||||||||||||||
| return types.Capabilities{ | ||||||||||||||||
| Workflows: true, | ||||||||||||||||
| Deployments: false, | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| // Dispatch implements types.Dispatchable. | ||||||||||||||||
| func (a *GithubAction) Dispatch(ctx context.Context, context types.RenderContext) error { | ||||||||||||||||
| panic("unimplemented") | ||||||||||||||||
|
Comment on lines
+30
to
+32
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. Avoid panic in Dispatch; return an error until implemented. A panic here will crash the process whenever the GitHub agent is selected. Prefer a descriptive error. 🐛 Proposed fix import (
"context"
+ "errors"
"workspace-engine/pkg/workspace/jobagents/types"
"workspace-engine/pkg/workspace/store"
)
@@
func (a *GithubAction) Dispatch(ctx context.Context, context types.RenderContext) error {
- panic("unimplemented")
+ return errors.New("github-action dispatch not implemented")
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| } | ||||||||||||||||
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.
Avoid panic in Dispatch; return a typed error instead.
This dispatcher is registered by default; a panic will crash the workspace engine if the Argo agent is invoked. Return a descriptive error until implemented.
🐛 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents