Skip to content

feat(ci): local ACT example, stable id links, and parser fixes#174

Merged
fahimfaisaal merged 13 commits into
mainfrom
feat/act-local-examples
Jun 30, 2026
Merged

feat(ci): local ACT example, stable id links, and parser fixes#174
fahimfaisaal merged 13 commits into
mainfrom
feat/act-local-examples

Conversation

@fahimfaisaal

Copy link
Copy Markdown
Member

Summary

This PR makes the deploy-examples CI pipeline reproducible locally, migrates hosted example dashboards to stable ?id= deep links, and fixes several parser/aggregation bugs uncovered while validating CSV --select behavior in CI.

Motivation

  • Local iteration: Running the full deploy-examples-* matrix in GitHub Actions is slow and opaque. Contributors need a fast loop to validate chart output before pushing.
  • Stable deep links: Example dashboards previously relied on chronological file ordering (?d=N). Renaming or reordering examples broke bookmarks. Explicit --id slugs decouple links from matrix position while keeping chronological prefixes (00-, 01-, …) aligned with ?d=N indices.
  • CI correctness: The life-expectancy scatter example was auto-grouping by Country in CI even though --select was configured — select was not forwarded from the workflow matrix into the composite action.

Changes

Local ACT workflow runner

  • Add scripts/act-examples.sh — runs deploy-examples-{csv,go,rust,javascript,json} via act, merges artifacts into dist/examples/, and opens dist/examples/index.html.
  • Add .actrc with bind-mount and user mapping for reproducible local runs.
  • Add task act:examples shortcut and CONTRIBUTING.md section.
  • Update action-ci.yml to exercise the local action path.
  • Extend .gitignore for act artifacts (dist/examples/, .act/).

Usage:

task act:examples                              # all languages
task act:examples -- --only csv,go             # subset
task act:examples -- --reuse --no-open       # faster reruns

Stable --id deep links

  • Add id input to action.yml; forwarded as --id during JSON conversion.
  • All five deploy-examples-*.yml workflows now set id: and output-json: ${{ matrix.id }}.json instead of relying on output: filename ordering.
  • Drop NN- prefixes from example source files (e.g. 00-hash.txthash.txt); chronological ordering lives in the CI matrix only.
  • Update docs (examples.mdx, README files) with ?id= links.
  • Go examples: HTTP Routing is now the first slot (00-http-routing) — the default landing chart for Go benchmarks.

Parser & aggregation fixes

  • Metric preservation: CollapseDataPointsByKey / AggregateDataPoints now copy Metric so tabular collapse does not lose axis metadata.
  • Auto-group aggregation: Tabular rows auto-grouped onto the X axis are now aggregated correctly; logging refined.
  • CSV --select in CI: Forward select: ${{ matrix.select }} from workflow matrix; pass comma-quoted values safely via INPUT_SELECT env var in action.yml.
  • Add examples/csv/life-expentency-income.csv for the scatter example.

UI improvements

  • Better dataZoom and axis pointer behavior for large categorical datasets (line/bar/scatter).
  • Regenerated embedded UI (vizb-ui.gen.go).

Other

  • fix(action): use per-job temp file for cmd input (avoids cross-job races).
  • Typo/log cleanups in pipeline and parser code.

Id slug convention

Matrix id prefixes match ?d=N index (00?d=0). Semantic ?id= links are stable across reorders as long as the slug is unchanged.

Language Examples
CSV 00-sales-auto-group08-life-expentency-income
Go 00-http-routing, 01-decode, … 07-worker-pools
JS 00-tinybench, 01-vitest
Rust 00-criterion, 01-divan
JSON 00-torvalds06-gvanrossum

How to test

# Local full pipeline
task act:examples -- --only csv

# Verify --id lands in JSON
go build -o bin/vizb . && ./bin/vizb examples/go/hash.txt --id 03-hash -o /tmp/out.json
jq -r '.datasets[0].id' /tmp/out.json   # → 03-hash

# Unit tests
go test ./...
cd ui && pnpm test

Breaking changes

  • Hosted example source filenames no longer carry NN- prefixes (CI matrix owns ordering).
  • Old semantic-only ?id= slugs from brief intermediate states (e.g. ?id=hash) are obsolete; use numbered slugs (?id=03-hash) or ?d=N.
  • ?d=N links continue to work when matrix order is chronological.

Commits (12)

  1. feat(ci): run deploy-examples workflows locally with act
  2. fix(action): use per-job temp file for cmd input
  3. fix(parser): aggregate auto-grouped tabular rows and refine aggregation logs
  4. fix(ui): improve large-category dataZoom and axis pointer behavior
  5. chore: fix some typo and logs
  6. fix(parser): preserve metric when collapsing tabular data points
  7. fix(ci): forward matrix select and safely pass comma-quoted values
  8. feat(ci): migrate example workflows to stable --id deep links
  9. fix(ci): use chronological ids synced with matrix order
  10. fix(ci): move HTTP routing to first Go example slot
  11. ci: used individual chart at go example
  12. docs(ci): add act:examples task and local workflow docs

Add scripts/act-examples.sh to build vizb and run deploy-examples
workflows via act, skipping GitHub Pages and opening a local gallery.

When ACT=true, workflows stage JSON on disk instead of using
upload-artifact (incompatible with act v7), skip Pages deploy, and
use a pre-built local binary via bind mount. action.yml skips remote
version resolution when vizb-binary is provided.
Parallel act matrix jobs with --bind shared one data-input.txt and
corrupted curl JSON before --json-path could parse it.
…on logs

Propagate effective parser config back to the pipeline so inferred group
columns trigger AggregateDataPoints and clear PreserveRows. ParseFunc now
returns ([]DataPoint, Config). Always print the opening aggregation line;
use a distinct completion message when every group key is already unique.
Start category dataZoom at 20% for grouped and mixed charts so dense
datasets do not open at full range. Use axis-triggered tooltips in mixed
mode (shadow for bar, snap line for line/scatter) and theme pointer colors
to axisColor in light and dark mode.
CollapseDataPointsByKey cloned DataPoints without copying Metric, which
stripped the 4th auto-value column from scatter output after the
aggregation pipeline change. Also preserve Metric in AggregateDataPoints
and add regression tests.
Wire matrix.select into the CSV examples workflow and add the life
expectancy vs income scatter example. Pass select through an env var in
the composite action so values like Country,"Life Expectancy",Income are
not broken by bash string interpolation.
Add id input to action.yml and wire it through all deploy-examples
workflows. Replace numbered matrix output keys with semantic ids,
rename benchmark example files to drop NN- prefixes, and update docs
to use ?id= links instead of fragile ?d= index ordering.
Restore numbered id slugs (00-, 01-, …) in deploy-examples workflows
so CI controls both ?id= deep links and ?d= index alignment. Update
docs and README tables to match.
Reorder deploy-examples-go matrix so http-routing is 00-http-routing
and renumber remaining chronological ids.
Document running deploy-examples workflows locally with act, and add a
Taskfile shortcut that delegates to scripts/act-examples.sh.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/cli/pipeline.go 81.81% 3 Missing and 1 partial ⚠️
cmd/ui.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@fahimfaisaal fahimfaisaal changed the title feat(ci): local ACT example workflows, stable --id deep links, and parser fixes feat(ci): local ACT example, stable id links, and parser fixes Jun 30, 2026
@fahimfaisaal
fahimfaisaal merged commit b0972fa into main Jun 30, 2026
13 checks passed
@fahimfaisaal
fahimfaisaal deleted the feat/act-local-examples branch June 30, 2026 06:50
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.

2 participants