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

workflows: Validate workflowName is exactly 10 bytes #824

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

archseer
Copy link
Contributor

@archseer archseer commented Oct 2, 2024

Current validation allowed shorter names which would then later error in consensus phase

Current validation allowed shorter names which would then later error in consensus phase
@cedric-cordenier
Copy link
Contributor

@archseer Hmmm... we should be padding the workflow name in consensus to get to 10. What was the error you experienced?

@archseer
Copy link
Contributor Author

archseer commented Oct 2, 2024

Setting a shorter name will accept the workflow, then fail during workflow execution:

"caller":"ocr3/reporting_plugin.go:426","error":"incorrect length for id WorkflowName"

@@ -63,7 +63,7 @@ func ParseWorkflowSpecYaml(data string) (sdk.WorkflowSpec, error) {
type WorkflowSpecYaml struct {
// NOTE: Name and Owner are constrained the onchain representation in [github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/types/Metadata]

Name string `json:"name,omitempty" jsonschema:"pattern=^[0-9A-Za-z_\\-]+$,maxLength=10"` // plain text string exactly 10 characters long, or empty name allowed for anonymous workflows
Name string `json:"name,omitempty" jsonschema:"pattern=^[0-9A-Za-z_\\-]+$,minLength=10,maxLength=10"` // plain text string exactly 10 characters long, or empty name allowed for anonymous workflows
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about "or empty name allowed for anonymous workflows"?

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.

4 participants