-
Notifications
You must be signed in to change notification settings - Fork 2
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
distributed cron via temporal #288
Conversation
all framework changes (proto/scheme/sdktypes) are already merged and this PR was rebased on current main. |
572a06f
to
c45cbb6
Compare
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.
I didn't finish the review, but here are a few comments in the meantime
44ed9e2
to
13313e0
Compare
051993b
to
544fd22
Compare
2babb05
to
f26793c
Compare
a9d3c0b
to
df4a745
Compare
21968d1
to
11bc10e
Compare
@@ -28,10 +28,16 @@ func (ConnectionTraits) Validate(m *ConnectionPB) error { | |||
} | |||
|
|||
func (ConnectionTraits) StrictValidate(m *ConnectionPB) error { | |||
var errProjectID, errIntegrationID error | |||
if m.Name != SchedulerConnectionName { | |||
errProjectID = mandatory("project_id", m.ProjectId) |
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.
i think project id is always needed?
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.
why? in DB we have projectID is optional. moreover cron connection isn't for a project but global one
e4d45dc
to
a5dcaca
Compare
|
||
var createCmd = common.StandardCommand(&cobra.Command{ | ||
Use: "create <--name=...> <--env=...> <--connection=...> <--event=...> <--loc=...>", | ||
Use: `create <--name=...> <--env=...> <--loc=...> { <--connection=...> <--event=...> | <--schedule=...> }`, |
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.
It's a tiny issue, but you shouldn't use `` quotation marks unless there's a specific reasons for it (regex patterns, strings containing "", or multiline strings).
Also, conceptually, the loc
parameter should come last (after defining the trigger conditions, you define what the trigger will do).
} | ||
event = sdktypes.SchedulerEventTriggerType | ||
data[sdktypes.ScheduleExpression] = sdktypes.NewStringValue(schedule) | ||
connection = sdktypes.SchedulerConnectionName // FIXME: fix resolver. resolving by name isn't working |
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.
Is this new? Is there a ticket with details?
data := make(map[string]sdktypes.Value) | ||
if cmd.Flags().Changed("schedule") { | ||
if connection != "" || event != "" { | ||
return fmt.Errorf(`flags(s) "connection", "event" are not compatible with "schedule"`) |
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.
As much as possible, you shouldn't write custom logic for this, you should use Cobra's flag modifiers. See MarkFlagsMutuallyExclusive
and MarkFlagsRequiredTogether
.
I ran a test for another PR in progress (#319): deploy `samples/github`, fire event (new issue comment). I got this error consistently (omitting Temporal from stack trace): ``` 2024-05-21 21:25:40 ERROR temporalclient zap@v0.5.0/logger.go:72 Failed processing event {"Namespace": "default", "WorkerID": "51732@abraham.local@", "WorkflowType": "eventsWorkflow", "WorkflowID": "evt_01hyf8rdzdeasr37rftfh8pnfy", "EventID": "evt_01hyf8rdzdeasr37rftfh8pnfy", "error": "expected DispatchOptions isn't provided", "TaskQueue": "events-task-queue", "RunID": "6d571816-4511-4cb7-997f-005b6817a42a", "Attempt": 1} ... go.autokitteh.dev/autokitteh/internal/backend/dispatcher.(*dispatcher).eventsWorkflow /Users/daniel/git/autokitteh/internal/backend/dispatcher/eventsworkflow.go:295 reflect.Value.call /usr/local/go/src/reflect/value.go:596 reflect.Value.Call /usr/local/go/src/reflect/value.go:380 ... ``` After testing builds of previous merges, the first that worked was pre-#288, so I'm rolling back instead of fixing-forward. Will sync with @ig-ra to understand the root-cause.
No description provided.