Public: anyone can read this; the crew can change it.

A GitHub Actions workflow (`.github/workflows/*.yml`) opens as its jobs: triggers, then each job's runner, needs and steps #11235

opened this

Merged 25d 12h ago, live in production

A file under .github/workflows/ ending .yml or .yaml now opens as its jobs instead of raw YAML. The new test/render-workflow.test.ts and the existing render and kinds tests pass (279 pass). tsc --noEmit, scripts/gate.ts and scripts/design-lint.ts are clean.

Notes

opened this

A file under .github/workflows/ ending .yml or .yaml now opens as its jobs instead of raw YAML.

The new test/render-workflow.test.ts and the existing render and kinds tests pass (279 pass). tsc --noEmit, scripts/gate.ts and scripts/design-lint.ts are clean. I didn't open it in a running preview or browser. I also didn't call keep_plan, which isn't available in this session.

What it draws

  • Triggers: the on: triggers go in one line at the top.
  • Jobs: each job is a block with its runner and its needs. A matrix job shows one entry per axis, with include/exclude shown as a count of entries.
  • Steps: each step is one row, with its name and either uses … or the first line of run.
  • Limits: at most 100 jobs and 200 steps per job are drawn, with a "more not shown" line after.

Where it lives

  • Parser and renderer: the new src/web/render/workflow.ts uses the vendored yaml, so there is no new dependency.
  • File kind: kinds.ts has a new workflow kind, matched by the path .github/workflows/<name>.yml|yaml at any depth. renderers.ts registers it.
  • Type declaration: I added toJS to vendor/yaml.d.mts, since the parser needs it.

Fallback, raw view and escaping

  • Fallback: a file that doesn't parse, has several YAML documents, isn't a map or has no jobs falls back to the source view with one plain line saying why.
  • Raw view: I did not add a raw-view toggle. It relies on the same mechanism the Dockerfile and SQL views use; I didn't check that it gives a one-click raw view for this kind.
  • Escaping: every value is escaped. The test renders <script> in a step name and <img onerror> in a run line and checks both come out escaped.

What I left out

  • I did not follow reusable workflows, composite actions or expression evaluation. ${{ … }} shows as written.
  • The terminal view (tui/screens/workspace.ts) is unchanged.

To try it: open .github/workflows/check.yml, or any other workflow file, in a repository's files. The tests are bun test test/render-workflow.test.ts.

🤖 Generated with Claude Code

Closes #11223

3 earlier comments
commented

A file under .github/workflows/ ending .yml or .yaml now opens as its jobs instead of raw YAML.

The new test/render-workflow.test.ts and the existing render and kinds tests pass (279 pass). tsc --noEmit, scripts/gate.ts and scripts/design-lint.ts are clean. I didn't open it in a running preview or browser. I also didn't call keep_plan, which isn't available in this session.

What it draws

  • Triggers: the on: triggers go in one line at the top.
  • Jobs: each job is a block with its runner and its needs. A matrix job shows one entry per axis, with include/exclude shown as a count of entries.
  • Steps: each step is one row, with its name and either uses … or the first line of run.
  • Limits: at most 100 jobs and 200 steps per job are drawn, with a "more not shown" line after.

Where it lives

  • Parser and renderer: the new src/web/render/workflow.ts uses the vendored yaml, so there is no new dependency.
  • File kind: kinds.ts has a new workflow kind, matched by the path .github/workflows/<name>.yml|yaml at any depth. renderers.ts registers it.
  • Type declaration: I added toJS to vendor/yaml.d.mts, since the parser needs it.

Fallback, raw view and escaping

  • Fallback: a file that doesn't parse, has several YAML documents, isn't a map or has no jobs falls back to the source view with one plain line saying why.
  • Raw view: I did not add a raw-view toggle. It relies on the same mechanism the Dockerfile and SQL views use; I didn't check that it gives a one-click raw view for this kind.
  • Escaping: every value is escaped. The test renders <script> in a step name and <img onerror> in a run line and checks both come out escaped.

What I left out

  • I did not follow reusable workflows, composite actions or expression evaluation. ${{ … }} shows as written.
  • The terminal view (tui/screens/workspace.ts) is unchanged.

To try it: open .github/workflows/check.yml, or any other workflow file, in a repository's files. The tests are bun test test/render-workflow.test.ts.

🤖 Generated with Claude Code

commented

A workflow file now also opens as a table in the terminal, and the web view is changed along the lines of the review. bun test on the workflow and blob-page tests, tsc --noEmit, scripts/gate.ts and design-lint pass. The earlier run of test/tui-workspace.test.ts, before the final tweaks, passed too. I did not re-run tui-workspace.test.ts after the final tweaks or open a running preview with a workflow file.

Terminal

  • workflowTable in src/tui/screens/workspace.ts reuses parseWorkflow. It draws a Job / Kind / Value table: the triggers first, then each job's runs-on, needs, matrix and steps, with a "more" count when the caps cut rows.
  • A workflow that doesn't parse shows the same reason as the web, and s shows the source.
  • The new test in test/tui-workspace.test.ts covers the table and s. The broken-workflow file is committed in it but never opened, so the terminal's fallback path has no test yet.

Web

  • A job's runner, needs and matrix are now dl.status-rows fact rows. Steps stay as the two-column .table with a header row.
  • The fallback line now reads: "This file is shown as YAML because it is not drawn as a workflow: it is not valid YAML (…)." I also cut the parser's trailing "at line N, column M" from the YAML error, since the reason is a short phrase.
  • The new test/blob-workflow-page.test.ts fetches workflow blob pages over HTTP. A good workflow draws as jobs with <script> in a step name escaped. A broken one shows the plain line, with Source marked current as the viewer's own fallback does. The ?view=source link and the Raw link are both in the page.
  • Edge tests in test/render-workflow.test.ts cover include/exclude in a matrix and a two-document file.

Docs

  • docs/features/file-workflow.md is the how-to.
  • docs/design/areas/render.md has a .workflow-view paragraph. It is only a wrapper hook; no new component or CSS.

To try it, open .github/workflows/ci.yml in the terminal workspace or on the web, then press s or choose Source.

🤖 Generated with Claude Code

commented

I've pushed again. The gate's "pipeline first" rule failed because this pull adds docs/features/file-workflow.md and changes nothing in the pipeline. I haven't re-run the gate or the tests since, so the forge's check on this push is the first confirmation.

The pull is not pipeline work. Issue #11223 asks for the workflow view, and the review asked for the how-to doc. So I added the rule's own escape: an empty commit whose message carries a Direction: line saying so. The code and tests are unchanged from the last push.

🤖 Generated with Claude Code

commented

A GitHub Actions workflow file now opens in a repository's files as its jobs: triggers first, then each job's runner, needs, matrix and steps.

What I fixed: the header-width rule failed because the header comment in test/blob-workflow-page.test.ts ran past 160 columns. I wrapped it to three lines. That test and header-width pass here, and tsc --noEmit is clean. I did not run bun scripts/gate.ts, and I ran only those two test files, not the full suite.

The other failure: I did not change anything for "the page offers the three windows…", in test/traffic-history.test.ts. It passes when run on its own here (8 of 8), and nothing in this pull touches traffic history. The check said it did not re-run it alone, so I could not confirm the cause and I'm treating it as flaky. If it fails again on this push, it needs a closer look.

What I chose not to do: nothing in the renderer or its tests changed. The rest of the pull is unchanged: the workflow renderer in src/web/render/workflow.ts, its registration in the file-kind registry, the terminal view, tests, how-to doc and design note.

How to try it: open .github/workflows/check.yml in the repository's files on the preview at https://lab--11235--forge-trevato-apps.open-platform.sh.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs