feat!: add the validate argument to reading workflows #180
Labels
No labels
Compat/Breaking
Kind/Bug
Kind
Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo/act!180
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "earl-warren/act:wip-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a followup of #170 so that it is possible to read a workflow without validation. It is not uncommon for Forgejo to read a workflow just to extract a few information from it, knowing it has been validated before. It would be a performance regression if schema validation happened in these cases.
This is a port of https://github.com/nektos/act/pull/2717/files
It is a breaking change in the context of Forgejo and Forgejo runner because it will need to add the new
validateargument when reading workflows.cb3ae8e922c49a3085d8feat: allow to disable workflow schema validation [skip cascade]to feat: allow to disable workflow schema validationc49a3085d88fc5ac4f69cascading-pr updated at forgejo/runner#698
cascading-pr updated at forgejo/runner#698
feat: allow to disable workflow schema validationto feat!: allow to disable workflow schema validationfeat!: allow to disable workflow schema validationto feat!: allow to disable workflow schema validation [skip cascade]8fc5ac4f69309bedff0cotherwise LGTM
@ -109,0 +114,4 @@Definition: "workflow-root-strict",Schema: schema.GetWorkflowSchema(),}).UnmarshalYAML(node); err != nil {return errors.Join(err, fmt.Errorf("Actions YAML Strict Schema Validation Error detected:\nFor more information, see: https://nektosact.com/usage/schema.html"))we should point to a different url
You made me realize that I completely misunderstood the purpose of the ACT PR I cherry picked. It always validates. Only with different methods. I'll change this PR to do what it is meant to do instead of what it currently does. 😊
#180/files
This is the change that matters. Do not add a strict mode. Remove validation from the existing struct (Workflow) and add it to a new struct (WorkflowValidate) and only use it if validate is true.
feat!: allow to disable workflow schema validation [skip cascade]to WIP: feat!: allow to disable workflow schema validation [skip cascade]309bedff0c4db3721331WIP: feat!: allow to disable workflow schema validation [skip cascade]to WIP: feat!: add the validate argument to reading workflows [skip cascade]4db3721331c7b3d225d3lgtm, but multiple test failures
eg:
c7b3d225d3ca963646d4Those tests are the one asserting schema validation detect errors. They now need to explicitly require validation.
c7b3d225d3..ca963646d4makes it greenWIP: feat!: add the validate argument to reading workflows [skip cascade]to feat!: add the validate argument to reading workflows [skip cascade]still failing ci checks
732db6753e34dfb407affeat!: add the validate argument to reading workflows [skip cascade]to feat!: add the validate argument to reading workflowsRebased and green for real now 😁
34dfb407afe278c02468Rebased because the CLI is gone now
cascading-pr updated at forgejo/runner#711
feat!: add the validate argument to reading workflowsto feat!: add the validate argument to reading workflows [skip cascade]e278c02468d4417914bcfeat!: add the validate argument to reading workflows [skip cascade]to feat!: add the validate argument to reading workflows