Repository navigation
Workflows tab: marketplace and GitHub workflows - #364
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workflows tab: marketplace and GitHub workflows (#364)
A Studio's workflow collection was limited to workflows saved on its account. An entry can now be any of three kinds, the same forms
pw workflows runaccepts:namemarketplace/<slug>github.com/<owner>/<repo>[/path][@ref]Settings, Workflows lists the account's workflows as before, the marketplace's workflow items below them (both filtered by the same box), and a From GitHub field. Adding a GitHub entry first reads its workflow.yaml and refuses it with the reason if it cannot. The settings write validates every entry against the three forms (
server/src/workflowEntries.ts, shared with the routes) and drops anything else, including..segments and other hosts.Definitions. Account workflows come from
pw workflows get, marketplace ones frompw marketplace get <slug> --yamlwith their name, description, and icon frompw marketplace ls(cached five minutes), and GitHub ones from the repository's raw file (workflow.yaml, then workflow.yml). The CLI cannot print a repository's YAML, so the form for a private repository cannot be shown; the run still goes throughpw workflows run, which reads private repositories through the platform's connected account. A GitHub tile's icon is the repository's thumbnail.png by the platform's convention, and a tile whose icon is missing or fails shows its initial.Routes move from
/api/workflows/:name/...to/api/workflows/item/{form,icon,run,install}?w=<entry>, since entries contain slashes. Install answers 409 for marketplace and GitHub entries, and the tab offers it only for account workflows.Verified against a live platform with one entry of each kind: tiles with icons; forms for all three; a GitHub dry run validated by the platform; the catalog listing 76 account and 99 marketplace workflows. New tests: entry parsing and refusal, raw URLs, tiles, forms (including a missing repository), runs passing the entry to the CLI as written, install refused for non-account entries, and the settings write. 213 server and 53 web tests pass.