zizmorcore / zizmorcore/zizmor

Performance: optimize the fast path for remote audits of only workflows

Open
#1,908 0 comments 0 reactions 1 assignee Claimed by @woodruffw View on GitHub
performance refactor
Dominant language
Rust
Stars
6.5k
Forks
252
Avg merge
1d 5h
Merged PRs (30d)
41

Description

When you do `zizmor org/repo` for a remote audit, we currently take a "fast path" if `--collect=workflows` is given (since we know AOT that the only actual remote content we need is under `.github/workflows`). Consequently, we can use GitHub's content APIs to fetch workflows under that path rather than downloading and extracting an entire copy of the repository (and then scanning it for actions, etc.).

However, we can probably do even better than this: GitHub's content API is still slow and counts against rate limits, so we could avoid it entirely by sticking to the Git layer and issuing raw requests, similar to what we do to speed up/reduce our API quota risk when listing remote refs.

Fetching actual content will be slightly more involved, since we'll need to `fetch` with `blob:none`, parse the packfile, and extract + fetch the corresponding blobs. I suspect this'll be faster than GitHub's REST APIs, but I'm not sure. It'll need benchmarking.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.