Skip to content

[Feature] vip bundle: build a shareable archive from an allowlist of report artifacts #794

Description

@ian-flores

Follow-up to #620. Its fix (#793) moves the auth cache out of the invocation directory, so zip -r . stops picking up session cookies or a minted Connect API key. The other half of #620 is still open: there's no command that builds an archive of VIP output you can safely send to someone, so users still pick the files by hand.

What's still risky in the directory

vip.toml can hold secrets inline: api_key under [connect] and [workbench] (vip.toml.example:33,46) and password under [auth] (vip.toml.example:154). The config_hygiene/test_secrets scenario warns about this, but it's opt-in and doesn't stop anyone from archiving the file.

Proposal

Add vip bundle [--output PATH]. It writes a zip from an allowlist of known artifacts rather than copying the directory minus a denylist, so a file added to the output later stays out by default. Proposed contents:

  • report/results.json, plus failures.json, junit.xml and results.sarif when present (src/vip/plugin/results.py:419-421)
  • the rendered report under report/_output/ (index.html, the pages it links, and vip-report.pdf; src/vip/cli/report.py:177,188)
  • vip version output and the platform details vip status already collects

Open question: what to do with vip.toml

Leaving it out is the simplest and safest option, but whoever receives the bundle loses the configuration context: which products, which URLs, which auth provider.

Including a redacted copy is more useful. Parse the file, replace every api_key and password value with "<redacted>", and write the result. The cost is a second place that knows which fields are secret. Today that knowledge lives only in the hand-written __repr__ methods from #223 (src/vip/config.py:144,425), one per config class. If we go this way, the bundle shouldn't carry its own list of field names; pull them into one constant in config.py that both the __repr__ methods and the bundle read.

Test requirement

As #620 asks: a selftest that builds a bundle from a directory seeded with every credential-bearing file (vip.toml with secrets, legacy .vip-auth-cache*.json) and checks the archive's actual member list. None of those files may be in it, and for a redacted vip.toml, no secret value may appear in its bytes. This belongs in a test rather than a review checklist, so a new artifact can't slip in unnoticed.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions