Skip to content

Contributing to vz ​

Thank you for helping. vz is a small project, and every bug report, tested image, example lab and doc fix makes it better for the next person.

This page covers how to report problems, how to send changes, and what a pull request needs. The detailed developer pages are linked from Development setup.

Ways to help ​

You canHow
Report a bugOpen an issue with the details listed below
Test an OS imagePull an image from vz image ls, boot it on your Mac, and report what does not work
Add an example labFollow Writing examples
Improve the docsFix anything that is wrong, unclear or missing. Small pull requests are welcome
Add an OS imageFollow Adding an OS image
Add a lab file featureOpen an issue first to agree on the design, then follow Adding a lab file key

A good bug report ​

Please include:

  • [ ] vz version
  • [ ] sw_vers and your Mac's chip (for example M2 or M4)
  • [ ] How you installed vz (release tarball or built from source)
  • [ ] The lab.yaml, or the smallest lab file that shows the problem
  • [ ] The exact command and its full output (add --json if it helps)
  • [ ] The lab process log: <state>/lab.log, by default ~/.vz/state/<lab name>/lab.log
  • [ ] For boot problems, the console log (vz node logs <node> with consoleLog: true)

Development setup ​

You need an Apple silicon Mac with macOS 27 and Xcode 27 (or the Command Line Tools).

bash
git clone https://github.com/rayanparsa/vz.git
cd vz
make build        # debug build, signed with the virtualization entitlement
make test-core    # fast tests, no VMs needed
.build/debug/vz version

The details:

Pull requests ​

  1. Fork the repository and create a branch from main with a short descriptive name, for example fix-port-forward-ipv6 or image-opensuse.

  2. Make your change. Keep one topic per pull request.

  3. Run the checks:

    bash
    make check   # lint, fast tests, schema and examples, repository rules

    make schema-check needs check-jsonschema (pipx install check-jsonschema).

  4. If you changed behavior, update the docs in the same pull request: CLI reference, Lab file reference, or the matching guide.

  5. Open the pull request against main. Say what changed, why, and how you tested it (for runtime changes, which labs you booted).

TIP

For anything bigger than a bug fix (a new command, a new lab file key, a change to the layers), open an issue first. It saves you from writing code that has to be redone.

What CI runs ​

Every pull request runs these workflows. All of them must pass before a merge.

WorkflowJobWhat it checks
ciformat (Linux)swift format lint --strict, in the Swift 6.4 Linux image
build and test (macOS 27)A build with warnings as errors, the fast test targets, a smoke test of the vz binary (help, schema, image ls --json, validate on every example, exit codes), and a release build, so a release never fails at tag time
schema, examples, docs and rules (Linux)docs/reference/schema.md is current, every example and fixture matches the JSON Schema, scripts/check-repo.sh (no em dashes, no AI attribution in commits), links between docs
securitycodeql (swift)CodeQL static analysis of the Swift code. Weekly and on demand (Run workflow), not on pull requests: its traced build takes 10 to 15 minutes
workflow auditzizmor on the GitHub Actions workflows
secretsgitleaks over the whole history
pagesbuild site, deployBuilds the website when docs/, examples/ or site/ change; deploys from main

Scorecard rates the repository's security practices weekly for the README badge, and Dependabot opens one pull request a week for new action versions and one for package versions.

A newer push to a pull request cancels its older runs. Runs on main always finish.

The runtime tests need a signed binary and real VMs, so CI does not run them. Run make test locally when you change LabRuntime.

Code style ​

  • Format with swift-format: make format rewrites files, make lint checks them. The settings are in .swift-format: 4 spaces, 120 columns.
  • Respect the layers: each target depends only on the ones below it, and the engine has no per-OS code. See Architecture overview.
  • Comments say why, not what. Keep them short. New files start with a short header comment that says what they are for.
  • Error messages are for users: say what is wrong and what to do, for example "Rebuild with: make build".
  • Validation collects every problem and reports it with a path into the file (nodes[2].interfaces[1].attach), so users see all of them at once.
  • Commands that print output also support --json.

Commit messages ​

  • Use the imperative mood and keep the subject short: "Add Rocky Linux 10 image", "Fix port forwarding on IPv6".
  • Explain the reason in the body when it is not obvious.
  • Do not add AI attribution trailers such as Co-Authored-By lines for AI tools, or "Generated with" footers.

License ​

vz is licensed under the Apache License 2.0. By contributing, you agree that your contributions are licensed under the same license.

See also ​