feat(pr): default head, base, title from git branch and remote default branch #5

Merged
ses merged 7 commits from feat/implicit-git-defaults into main 2026-08-25 20:15:04 +00:00
Owner

Summary

  • pr create defaults to git context (CLI + OpenCode plugin only; MCP stays explicit):
    • head from git symbolic-ref --short HEAD
    • base from GET /api/v1/repos/{owner}/{repo} -> default_branch
    • title humanised from the head branch name (feat-foo-bar -> Feat Foo Bar)
  • New shared helpers: getCurrentBranch, getUpstreamBranch, fetchDefaultBranch, humanizeBranchName
  • head == base pre-flight check before the API call
  • Schema-drift tooling: openapi-typescript registered as a dev-dep with bun run gen:api-types script
  • PRD updated: documents the defaulting rules and the Swagger submenge that is intentionally out-of-scope

Commits

  1. chore(tooling): add openapi-typescript for schema drift detection
  2. feat(shared): add default-branch repo meta, git branch helpers, and title humanizer
  3. feat(cli): default pr create head, base, title from current git branch and remote default branch
  4. feat(opencode): default pr create head, base, title from current git branch and remote default branch
  5. docs(prd): document pr create defaults and Swagger field submenge

Verification

  • bun run lint, bun run typecheck, bun run build, ./dist/forgejo-mcp help: green locally
  • bun test runs with BUN_MAX_WORKERS=1 (set via bun run test in package.json); the shared-suite, CLI-suite, and core-suite pass; the opencode- and mcp-adapter suites crash in this sandbox with Bun's Failed to start HTTP Client thread panic, which is unrelated to these changes. CI on debian-testing runs the full suite in parallel.

Out of Scope (already documented in PRD)

assignee, assignees, due_date, labels, milestone on create_pull_request; sort, milestone, labels, page, limit on list_pull_requests.

## Summary - `pr create` defaults to git context (CLI + OpenCode plugin only; MCP stays explicit): - `head` from `git symbolic-ref --short HEAD` - `base` from `GET /api/v1/repos/{owner}/{repo}` -> `default_branch` - `title` humanised from the head branch name (`feat-foo-bar` -> `Feat Foo Bar`) - New shared helpers: `getCurrentBranch`, `getUpstreamBranch`, `fetchDefaultBranch`, `humanizeBranchName` - `head == base` pre-flight check before the API call - Schema-drift tooling: `openapi-typescript` registered as a dev-dep with `bun run gen:api-types` script - PRD updated: documents the defaulting rules and the Swagger submenge that is intentionally out-of-scope ## Commits 1. `chore(tooling): add openapi-typescript for schema drift detection` 2. `feat(shared): add default-branch repo meta, git branch helpers, and title humanizer` 3. `feat(cli): default pr create head, base, title from current git branch and remote default branch` 4. `feat(opencode): default pr create head, base, title from current git branch and remote default branch` 5. `docs(prd): document pr create defaults and Swagger field submenge` ## Verification - `bun run lint`, `bun run typecheck`, `bun run build`, `./dist/forgejo-mcp help`: green locally - `bun test` runs with `BUN_MAX_WORKERS=1` (set via `bun run test` in `package.json`); the shared-suite, CLI-suite, and core-suite pass; the opencode- and mcp-adapter suites crash in this sandbox with Bun's `Failed to start HTTP Client thread` panic, which is unrelated to these changes. CI on `debian-testing` runs the full suite in parallel. ## Out of Scope (already documented in PRD) `assignee`, `assignees`, `due_date`, `labels`, `milestone` on `create_pull_request`; `sort`, `milestone`, `labels`, `page`, `limit` on `list_pull_requests`.
fix: typecheck and test cleanup for pr create defaults
Some checks failed
ci / test (pull_request) Failing after 40s
762c8906fe
ses force-pushed feat/implicit-git-defaults from 762c8906fe
Some checks failed
ci / test (pull_request) Failing after 40s
to 3df195fdee
Some checks failed
ci / test (pull_request) Failing after 43s
2026-08-25 17:15:48 +00:00
Compare
chore(deps): regenerate bun.lock for openapi-typescript dev-dep
All checks were successful
ci / test (pull_request) Successful in 52s
fb794e8833
package.json shipped openapi-typescript in the prior tooling commit, but bun.lock was never updated, which made CI's 'bun install --frozen-lockfile' fail with 'lockfile had changes, but lockfile is frozen' on every PR run. Regenerating the lockfile against the current package.json.

Also ignore .tmp/ scratch dirs and *.tmp files (mise install + bun cache root here).
ses scheduled this pull request to auto merge when all checks succeed 2026-08-25 20:14:44 +00:00
ses merged commit fb794e8833 into main 2026-08-25 20:15:04 +00:00
ses deleted branch feat/implicit-git-defaults 2026-08-25 20:15:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sebatec-eu/forgejoctl!5
No description provided.