feat!: validate workflows with a schema #170
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!170
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "earl-warren/act:wip-interpolation-error"
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?
It is a breaking change because it will fail existing workflows that contain errors that were previously undetected.
The associated release note include a strategy and example to verify workflows from the command line.
That verify was applied most repositories in the following organizations and only found a few mistakes that were fixed (e.g.
actions/setup-forgejo@ef6e5bef04).There is proof that the end-to-end run is using this pull request because it failed on both
enable-email-notificationsandcmdin services which do not exist in GitHub Actions and were not in the schema cherry-picked from Nektos ACT.Note that the error returned is displayed in context with the companion pull request of the runner that can be merged afterwards. Without it the error message are displayed in the pre-step output of an invalid workflow but tey are a oneliner that is very difficult to put in context unless you know exactly what it is about.
Closes forgejo/act#169
Closes forgejo/runner#317
cascading-pr updated at forgejo/runner#663
feat!: validate workflows with a schemato feat!: validate workflows with a schema [skip cascade]feat!: validate workflows with a schema [skip cascade]to WIP: feat!: validate workflows with a schema [skip cascade]WIP: feat!: validate workflows with a schema [skip cascade]to WIP: feat!: validate workflows with a schemacascading-pr updated at forgejo/runner#663
0c15daba391ff7540828cascading-pr updated at forgejo/runner#663
cascading-pr updated at forgejo/runner#663
d66c8a80ec0dc6f254accascading-pr updated at forgejo/runner#663
0dc6f254aca97ed12456cascading-pr updated at forgejo/runner#663
a97ed1245621c5eccc5ecascading-pr updated at forgejo/runner#665
21c5eccc5ea8efb77605cascading-pr updated at forgejo/runner#665
WIP: feat!: validate workflows with a schemato feat!: validate workflows with a schemaa8efb77605d196d59e62cascading-pr updated at forgejo/runner#665
d196d59e62a128183f74cascading-pr updated at forgejo/runner#665
a128183f7434a06b01e1cascading-pr updated at forgejo/runner#665
34a06b01e1a134916d8ecascading-pr updated at forgejo/runner#665
@wetneb asking for your review because you contributed a change to improve error reporting on workflows in Forgejo. This is an entirely different codebase though, feel free to decline.
a134916d8e65406c85e3cascading-pr updated at forgejo/runner#689
cascading-pr updated at forgejo/runner#689
i havn't checked the full schme yet. it's very big. we should somehow validate all our existing workflows against this
@ -85,0 +91,4 @@}).UnmarshalYAML(node); err != nil {return err}type ActionDefault Actionwhy this type def? 🤔
@ -95,0 +102,4 @@}).UnmarshalYAML(node); err != nil {return errors.Join(err, fmt.Errorf("Forgejo Actions YAML Schema validation error"))}type WorkflowDefault Workflowsame here
I do not know the rationale for this. It reads like a noop to me but it does not hurt. And maybe I'm missing something subtle.
🤷♂️
oh, I see it comes from upstream. I don't know go good enough 🫣 so probably leave it as is for compabillity
feat!: validate workflows with a schemato WIP: feat!: validate workflows with a schema@viceice wrote in #170 (comment):
I will do that using
forgejo-runner exec --event unknown --workflowson all the repos in Forgejo space. Switching to WIP in the meantime. I may take a minute.@earl-warren wrote in #170 (comment):
sounds like a good idea.
Went through all repositories in:
Found and fixed the following:
forgejo/release-notes-assistant@c848a4db31I also did not browse the entirety of the schema. I adapted it a few times (see the individual commits) and it was rather straightforward. I think it will be a major improvement for people who are faced with silent false positive when they have a typo in the name of a context.
cascading-pr updated at forgejo/runner#689
WIP: feat!: validate workflows with a schemato feat!: validate workflows with a schemaThe description was updated to reflect the latest developments.
That's a big breaking change, there will be consequences. But I'm cautiously optimistic. Thanks for taking the time to review, it was not trivial.