-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix wasm workflow toml fields #16206
Conversation
WorkflowID string `toml:"-" db:"workflow_id"` // Derived. Do not modify. the CID of the workflow. | ||
WorkflowOwner string `toml:"-" db:"workflow_owner"` // Derived. Do not modify. the owner of the workflow. | ||
WorkflowName string `toml:"-" db:"workflow_name"` // Derived. Do not modify. the name of the workflow. | ||
WorkflowID string `toml:"-" db:"workflow_id"` // Derived. Do not modify. the CID of the workflow. |
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.
hmm. i'm confused
why is there job TOML at all for wasm wfs?
i'm concerned that changing this will break yaml, which is in prod
can this field be extracted from the another part of the existing struct?
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.
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.
Hmm isn't the change here backwards compatible? For TOML Owner + Name will not be empty, so we'll fall through to lines 916-917
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.
Swift do uploads of their WASM workflows via a job spec; this is something we want to move away from but atm they can't add more than one workflow because the Owner + Name isn't being populated from anywhere
@@ -912,8 +912,12 @@ func (w *WorkflowSpec) Validate(ctx context.Context) error { | |||
return err | |||
} | |||
|
|||
w.WorkflowOwner = strings.TrimPrefix(s.Owner, "0x") // the json schema validation ensures it is a hex string with 0x prefix, but the database does not store the prefix | |||
w.WorkflowName = s.Name | |||
if s.Owner+s.Name != "" { |
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.
please add a comment here about the different cases and why we need the s.Owner + s.Name check.
i'm certain i won't understand in a couple weeks.
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.
Done
@@ -347,4 +348,31 @@ func TestWorkflowSpec_Validate(t *testing.T) { | |||
require.NoError(t, err) | |||
require.NotEmpty(t, w.WorkflowID) | |||
}) | |||
|
|||
t.Run("WASM can validate from TOML", func(t *testing.T) { |
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.
ok, i see that the existing test prove backward compatibility, yes?
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.
The yaml-based tests should be undisturbed, assuming that all valid yaml-based workflows have at least one of owner & name fields defined, and wasm-based tests still pass.
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
6a9509b
|
* Fix model fields to parse correctly for a wasm workflow * casing * changeset * add comment * adds tag to changeset --------- Co-authored-by: Bartek Tofel <[email protected]> Co-authored-by: rishabh570 <[email protected]>
* Fix model fields to parse correctly for a wasm workflow * casing * changeset * add comment * adds tag to changeset --------- Co-authored-by: Bartek Tofel <[email protected]> Co-authored-by: rishabh570 <[email protected]>
* Fix model fields to parse correctly for a wasm workflow * casing * changeset * add comment * adds tag to changeset --------- Co-authored-by: Bartek Tofel <[email protected]> Co-authored-by: rishabh570 <[email protected]>
Unblocks wasm workflow users from deploying multiple workflows. Current behavior is workflowName & workflowOwner are empty, causing broken chain write behavior & preventing multiple wasm workflows from being deployed to a single node.