feat(FN-3913): add GitHub tracking guide section to task-management docs
Adds a new GitHub tracking issues guide section to the task management documentation, with a contract test to validate the docs content. Fusion-Task-Id: FN-3913
This commit is contained in:
@@ -376,6 +376,31 @@ Manual/non-auto-merge behavior:
|
||||
- If no PR exists, Fusion pushes the task branch to `origin` before creating the PR.
|
||||
- When buffered actionable PR feedback exists on a PR that is already merged/closed and the task leaves `in-review`, Fusion creates a dependency-linked follow-up task in `triage` so feedback is not stranded.
|
||||
|
||||
## GitHub Tracking Issues
|
||||
|
||||
GitHub tracking issues are optional issues Fusion can create from Fusion tasks. They are **not** the same as imported source issues (`issueInfo` / `sourceIssue`): imported issues represent an existing GitHub issue that created the task, while tracking issues are new GitHub issues opened to track a Fusion task.
|
||||
|
||||
When task creation runs with tracking enabled, Fusion attempts issue creation during task creation flows (including quick create, planning output, and subtask creation paths that create tasks). Creation is best-effort and non-blocking: task creation still succeeds even if repo resolution fails or GitHub calls fail.
|
||||
|
||||
Tracking behavior is controlled per task:
|
||||
|
||||
- `task.githubTracking.enabled` turns tracking on for that task.
|
||||
- `task.githubTracking.repoOverride` optionally forces a specific target repo (`owner/repo`).
|
||||
|
||||
Repository resolution order:
|
||||
|
||||
1. Task override: `task.githubTracking.repoOverride`
|
||||
2. Project default: `githubTrackingDefaultRepo`
|
||||
3. Global default: `githubTrackingDefaultRepo`
|
||||
|
||||
When Fusion creates a tracking issue, it uses:
|
||||
|
||||
- Title: `[FN-XXXX] Task title`
|
||||
- Body prefix: `Fusion task: FN-XXXX`
|
||||
- Body content: bounded plain-text task summary snippet (not full prompt content)
|
||||
|
||||
GitHub authentication/settings are configured in [Settings Reference](./settings-reference.md) via `githubAuthMode` (`gh-cli` or `token`) and `githubAuthToken`.
|
||||
|
||||
## Completion Modes (`mergeStrategy`)
|
||||
|
||||
- **`direct`**: local squash-merge flow into target branch
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// @vitest-environment node
|
||||
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
const repoRoot = path.resolve(__dirname, "../../../../");
|
||||
|
||||
function readDoc(relativePath: string): string {
|
||||
return readFileSync(path.join(repoRoot, relativePath), "utf8");
|
||||
}
|
||||
|
||||
describe("github tracking documentation contract", () => {
|
||||
it("documents the GitHub Tracking Issues section with required behavior", () => {
|
||||
const taskManagement = readDoc("docs/task-management.md");
|
||||
|
||||
expect(taskManagement).toContain("## GitHub Tracking Issues");
|
||||
expect(taskManagement).toContain("They are **not** the same as imported source issues (`issueInfo` / `sourceIssue`)");
|
||||
expect(taskManagement).toContain("task creation flows (including quick create, planning output, and subtask creation paths that create tasks)");
|
||||
expect(taskManagement).toContain("task.githubTracking.enabled");
|
||||
expect(taskManagement).toContain("task.githubTracking.repoOverride");
|
||||
expect(taskManagement).toContain("Repository resolution order");
|
||||
expect(taskManagement).toContain("1. Task override: `task.githubTracking.repoOverride`");
|
||||
expect(taskManagement).toContain("2. Project default: `githubTrackingDefaultRepo`");
|
||||
expect(taskManagement).toContain("3. Global default: `githubTrackingDefaultRepo`");
|
||||
expect(taskManagement).toContain("Creation is best-effort and non-blocking");
|
||||
expect(taskManagement).toContain("Title: `[FN-XXXX] Task title`");
|
||||
expect(taskManagement).toContain("Body prefix: `Fusion task: FN-XXXX`");
|
||||
});
|
||||
|
||||
it("keeps GitHub auth cross-links discoverable from task management docs", () => {
|
||||
const taskManagement = readDoc("docs/task-management.md");
|
||||
const settingsReference = readDoc("docs/settings-reference.md");
|
||||
|
||||
expect(taskManagement).toContain("[Settings Reference](./settings-reference.md)");
|
||||
expect(taskManagement).toContain("`githubAuthMode` (`gh-cli` or `token`) and `githubAuthToken`");
|
||||
|
||||
expect(settingsReference).toContain("`githubAuthMode` | `\"gh-cli\" \\\| \"token\"` | `\"gh-cli\"`");
|
||||
expect(settingsReference).toContain("`githubAuthToken` | `string` | `undefined`");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user