fabro/lib/crates/fabro-cli
Scott Werner ec0a08afb3
fix: grant organization_projects to auto-created GitHub Apps for Projects V2 (#544)
## What

Adds the `organization_projects: write` permission to the GitHub App
manifest used when Fabro auto-creates a GitHub App, in **both** install
flows:

- `lib/crates/fabro-server/src/install.rs` (web-UI install)
- `lib/crates/fabro-cli/src/commands/install.rs` (CLI install)

A test assertion in the CLI install tests guards the new permission.

## Why

The GitHub Projects V2 tracker mints a scoped installation token
requesting `{ "issues": "write", "organization_projects": "write" }`
(`create_installation_access_token_for_projects`,
`fabro-github/src/lib.rs`). GitHub only lets an installation token
request a **subset** of the permissions the app was granted at install
time — and `organization_projects` was never in the manifest. So on any
auto-created Fabro app, the token request comes back **422** and the
tracker fails before it can make a single GraphQL call.

`issues: write` (also requested by that helper) is already covered by
the manifest; `organization_projects` was the missing piece.

## Note on rollout

Manifest `default_permissions` are applied at **app-creation time**, so
this only affects **newly** auto-created apps. Existing apps need the
permission added manually in their settings, and each installation must
approve it.

## Follow-up (not in this PR)

The `422` branch in `mint_installation_token_with_jwt` reports "GitHub
App does not have access to repository {repo}" — which misattributes a
missing-permission failure to repository access. Worth softening the
message to mention permissions too; left out here to keep this PR
focused on the scope change.

## Test

- `cargo nextest run -p fabro-cli --
manifest_includes_callback_urls_and_setup_url` passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 22:13:26 +00:00
..
src fix: grant organization_projects to auto-created GitHub Apps for Projects V2 (#544) 2026-07-01 22:13:26 +00:00
tests Resolve run.prepare.steps env and interpolation at the run boundary (#530) 2026-07-01 10:31:26 -04:00
build.rs fix(build): refresh embedded git sha on branch commits 2026-05-09 14:10:04 -04:00
Cargo.toml feat(web): add server-managed Environments CRUD settings UI (#462) 2026-06-13 08:44:38 -04:00