Thanks for helping improve incident response for AUR supply-chain threats.
- Read
data/docs/sources.mdfor how campaigns, lists, and docs are organized. - Install local Git hooks (once per clone):
fish scripts/install-git-hooks.fishHooks live in .githooks/ (core.hooksPath). Path filters mirror CI (scripts/hooks/classify-paths.fish ↔ .github/workflows/ci.yml):
| Staged changes | pre-commit runs |
|---|---|
| Docs / non-code only | nothing (CI gate jobs still green) |
| Packaging / workflows only | skip local lint/tests (CI still runs) |
Fish / lib / scripts / tests / lists |
fish_indent + lint.fish + tests/run-all.fish |
Env: AUR_HOOK_FULL=1 (always lint+tests), AUR_HOOK_LINT_ONLY=1 (no tests), AUR_SKIP_HOOKS=1 (skip hooks).
- Run the test suite and linter locally:
fish tests/run-all.fish
fish lint.fishParallel suites locally (optional):
set -x AUR_TEST_JOBS 8
fish tests/run-all.fishInstall fishcheck if lint fails:
git clone https://github.com/mattmc3/fishcheck ~/.local/bin/fishcheck
fish_add_path -g ~/.local/bin/fishcheck| Contribution | Where to start |
|---|---|
| New campaign or IOC list | Issue with sources → data/lists/, data/docs/{slug}.md, scripts/check/, scripts/scan/ |
| False positive fix | Issue → adjust heuristics in lib/ or list files with provenance |
| Bug fix | Issue → minimal fix + test in tests/unit/ or tests/integration/ |
| Docs only | README or data/docs/ — keep URLs in docs, not duplicated in README |
- Library entry point is
lib/bootstrap.fish— it loads focused modules (shims,lists,cli,windows,alpm,packages,campaign_runners, …). Prefer editing the relevant module over growing a monolith. - Fish scripts use
aur_*helpers fromlib/— avoid rawgrep,find,curlat call sites. - Scripts live under
scripts/{check,scan,audit,recovery}/and bootstrap viascripts/_init.fish(sourceslib/bootstrap.fish). - User-facing changes: update
CHANGELOG.mdunder## Unreleasedor the next version section. - User-facing release: bump
VERSIONto match CHANGELOG.
Use Conventional Commits:
<type>(optional-scope): <imperative summary>
- Types:
feat,fix,refactor,perf,docs,test,chore,build,ci,style,revert - Imperative mood (“add”, “fix”, “remove”), ≤72 chars on the subject, no trailing period
- Optional scope when it helps (
ci,packaging,alpm, campaign slug, …) - Body only when the why is not obvious (breaking changes, migrations, security notes)
- Breaking changes:
feat(api)!: …and aBREAKING CHANGE:footer
Examples: fix(alpm): finish log collect before cache write, docs: document Conventional Commits, chore(deps): bump actions/checkout.
Validate locally (also enforced on PRs by .github/workflows/commitlint.yml):
fish scripts/check-conventional-commit.fish --message 'feat: add list freshness tip'
git log origin/main..HEAD --format=%s | fish scripts/check-conventional-commit.fishDependabot PRs use chore(deps): via .github/dependabot.yml.
- Bundled list:
data/lists/{slug}-pkgs.txt - Provenance doc:
data/docs/{slug}.md(URLs, date window, license notes) - Index entry in
data/docs/sources.md - Prefer extending
aur_run_optional_campaign_{pkg_check,timeline}inlib/campaign_runners.fish(or shared helpers) instead of forking Chaos/Shai scripts - Thin wrappers:
scripts/check/{slug}-pkgs.fishandscripts/scan/{slug}-timeline.fish - Opt-in flag on
run.fishand config keys inconfig.fish.example - JSON summary fields in
lib/reports.fish - Removal support in
scripts/recovery/remove-packages.fish --list {slug} - Tests: fixtures in
tests/fixtures/, suites undertests/unit/andtests/integration/ - README: short comparison table (keep detailed IOC refs in
data/docs/) - Staleness: call
aur_warn_local_list_stale $list_filewith this campaign’s path - Exit policy: list load/empty → exit
3; optional-campaign hits → exit2; Atomic Arch hits → exit1
tests/run-all.fishdiscoverstest-*.fishundertests/unit/andtests/integration/.- Parallelism:
AUR_TEST_JOBS(defaultnproc/ 4). CI setsAUR_TEST_JOBS=4. - Single suite:
fish tests/unit/lib/test-alpm-cache.fish(anytest-*.fishpath). - Use fixtures in
tests/fixtures/— never point tests at a live system pacman db. - Integration tests should set isolated temp dirs via
tests/support/test-utils.fish. - Mock package state with
AUR_TEST_PKG_INFO,AUR_TEST_INSTALLED_LIST, orAUR_TEST_FOREIGN_LIST; do not call barepacmanfrom new helpers. - Full
run.fishintegration tests must isolate host IOCs: tempHOME,AUR_HELPER_CACHE_ROOTS,AUR_TEST_SYSTEMD_SYSTEM_DIR, andAUR_DEPS_SEARCH_PATHS. - CI runs lint once (Ubuntu), then Ubuntu + Arch test jobs in parallel; gate jobs
ubuntu/archsatisfy branch protection. - fishcheck in CI is installed only for the lint job (
tools/fishcheck; see.github/workflows/ci.yml). - Code-path filter (via
dorny/paths-filter): Fish/lists/packaging/completions/CI workflow; docs-only PRs skip tests but still get greenubuntu/archgates. Weekly schedule andworkflow_dispatchalways run the full suite. - Concurrency: new pushes/PR syncs cancel in-progress runs for the same branch/PR; scheduled weekly runs are never cancelled by a push.
Use the PR template checklist. Title the PR (and commits) with Conventional Commits. CI must pass (lint + Ubuntu/Arch tests) unless the change is docs-only and path filters skip CI. One logical change per PR when possible.
See SECURITY.md for vulnerability disclosure vs public IOC reports.
By contributing, you agree that your contributions are licensed under the MIT License.