Skip to content
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

Merged
merged 6 commits into from
Feb 6, 2025
Merged

Conversation

vreff
Copy link
Contributor

@vreff vreff commented Feb 4, 2025

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.

@vreff vreff requested review from a team as code owners February 4, 2025 15:35
@vreff vreff requested a review from ilija42 February 4, 2025 15:35
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.
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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

Copy link
Contributor

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 != "" {
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

@vreff vreff Feb 5, 2025

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.

Copy link
Contributor

github-actions bot commented Feb 5, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@vreff vreff requested review from krehermann and a team February 5, 2025 16:26
krehermann
krehermann previously approved these changes Feb 5, 2025
@jinhoonbang jinhoonbang added this pull request to the merge queue Feb 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2025
@jinhoonbang jinhoonbang added this pull request to the merge queue Feb 6, 2025
github-merge-queue bot pushed a commit that referenced this pull request Feb 6, 2025
* 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]>
Merged via the queue into develop with commit 5175b36 Feb 6, 2025
183 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Feb 6, 2025
* 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]>
@jinhoonbang jinhoonbang deleted the fix-wasm-workflow-toml-fields branch February 6, 2025 18:02
karen-stepanyan pushed a commit that referenced this pull request Feb 10, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants