Merge pull request 'chore: add changeset + doc update requirements to solve-issue workflow' (#138) from chore/workflow-changeset-docs into main
CI / check (push) Successful in 2m0s
CI / check (push) Successful in 2m0s
Merge PR #138: chore: add changeset + doc update requirements to solve-issue workflow
This commit was merged in pull request #138.
This commit is contained in:
@@ -98,6 +98,18 @@ roles:
|
|||||||
10. Ensure `pnpm run build` passes with no errors
|
10. Ensure `pnpm run build` passes with no errors
|
||||||
11. Run `pnpm test` to verify all tests pass
|
11. Run `pnpm test` to verify all tests pass
|
||||||
|
|
||||||
|
After implementation, before reporting done:
|
||||||
|
12. Add a changeset file (`.changeset/<short-slug>.md`) with correct bump type:
|
||||||
|
- `patch` for bug fixes, internal refactors, test-only changes
|
||||||
|
- `minor` for new features, new CLI commands, new API surfaces
|
||||||
|
- `major` for breaking changes
|
||||||
|
List every affected package in the changeset frontmatter.
|
||||||
|
13. Update documentation if the change affects user-facing behavior:
|
||||||
|
- `README.md` — usage examples, feature descriptions
|
||||||
|
- `.cards/` — architecture decision records (if applicable)
|
||||||
|
- CLI prompt subcommand output (if CLI help text changes)
|
||||||
|
- CLI `--help` text (if flags/commands are added or changed)
|
||||||
|
|
||||||
If you cannot complete the implementation (e.g. the issue is too complex, blocked by external factors,
|
If you cannot complete the implementation (e.g. the issue is too complex, blocked by external factors,
|
||||||
or repeated attempts fail), set $status=failed with a reason.
|
or repeated attempts fail), set $status=failed with a reason.
|
||||||
output: "List all files changed and provide a summary. Set $status to done (with branch/worktree), or failed (with reason)."
|
output: "List all files changed and provide a summary. Set $status to done (with branch/worktree), or failed (with reason)."
|
||||||
@@ -136,6 +148,14 @@ roles:
|
|||||||
- No `console.log` in production code
|
- No `console.log` in production code
|
||||||
- No dynamic imports in production code
|
- No dynamic imports in production code
|
||||||
|
|
||||||
|
Documentation & changeset checks:
|
||||||
|
6. Changeset exists in `.changeset/` with correct bump type (`patch`/`minor`/`major`) and lists all affected packages
|
||||||
|
7. If the change is user-facing, documentation is updated:
|
||||||
|
- `README.md` reflects new/changed behavior
|
||||||
|
- `.cards/` architecture cards updated if design decisions changed
|
||||||
|
- CLI prompt subcommand output updated (if it generates skill/reference content)
|
||||||
|
- CLI `--help` text matches new flags/commands
|
||||||
|
|
||||||
Only review standards compliance. Do NOT test functionality.
|
Only review standards compliance. Do NOT test functionality.
|
||||||
If rejecting, you MUST explain the specific reason in your output.
|
If rejecting, you MUST explain the specific reason in your output.
|
||||||
output: "Explain your decision with specific file/line references. Set $status to approved (with branch/worktree) or rejected (with comments)."
|
output: "Explain your decision with specific file/line references. Set $status to approved (with branch/worktree) or rejected (with comments)."
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ describe("solve-issue workflow: Gitea API PR creation", () => {
|
|||||||
"..",
|
"..",
|
||||||
"..",
|
"..",
|
||||||
"..",
|
"..",
|
||||||
".workflows",
|
"examples",
|
||||||
"solve-issue.yaml",
|
"solve-issue.yaml",
|
||||||
);
|
);
|
||||||
|
|
||||||
test("committer procedure should use curl API instead of tea pr create", async () => {
|
test("committer procedure should create PR via tea pr create", async () => {
|
||||||
const yamlContent = await readFile(workflowPath, "utf-8");
|
const yamlContent = await readFile(workflowPath, "utf-8");
|
||||||
const workflow = parse(yamlContent) as WorkflowPayload;
|
const workflow = parse(yamlContent) as WorkflowPayload;
|
||||||
|
|
||||||
@@ -33,25 +33,22 @@ describe("solve-issue workflow: Gitea API PR creation", () => {
|
|||||||
const committerProcedure = workflow.roles.committer?.procedure;
|
const committerProcedure = workflow.roles.committer?.procedure;
|
||||||
expect(committerProcedure).toBeDefined();
|
expect(committerProcedure).toBeDefined();
|
||||||
|
|
||||||
// Verify the procedure uses curl API, not tea pr create
|
// Verify the procedure uses tea pr create for PR creation
|
||||||
expect(committerProcedure).toContain("curl");
|
expect(committerProcedure).toContain("tea pr create");
|
||||||
expect(committerProcedure).toContain("api/v1/repos");
|
expect(committerProcedure).toContain("git push");
|
||||||
expect(committerProcedure).toContain("/pulls");
|
expect(committerProcedure).toContain("Fixes #N");
|
||||||
|
|
||||||
// Verify it explicitly warns against tea pr create
|
|
||||||
expect(committerProcedure).toMatch(/do NOT use.*tea pr create/i);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("committer procedure should reference repoRemote from task prompt", async () => {
|
test("committer procedure should extract owner/repo from git remote", async () => {
|
||||||
const yamlContent = await readFile(workflowPath, "utf-8");
|
const yamlContent = await readFile(workflowPath, "utf-8");
|
||||||
const workflow = parse(yamlContent) as WorkflowPayload;
|
const workflow = parse(yamlContent) as WorkflowPayload;
|
||||||
|
|
||||||
const committerProcedure = workflow.roles.committer?.procedure;
|
const committerProcedure = workflow.roles.committer?.procedure;
|
||||||
expect(committerProcedure).toBeDefined();
|
expect(committerProcedure).toBeDefined();
|
||||||
|
|
||||||
// Verify the procedure mentions repoRemote is provided in task prompt
|
// Verify the procedure extracts owner/repo from remote
|
||||||
expect(committerProcedure).toMatch(/repo remote.*provided.*task prompt/i);
|
expect(committerProcedure).toContain("git remote get-url origin");
|
||||||
expect(committerProcedure).toMatch(/owner\/repo/i);
|
expect(committerProcedure).toContain("hook_failed");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("committer procedure should include error handling for curl failures", async () => {
|
test("committer procedure should include error handling for curl failures", async () => {
|
||||||
@@ -100,45 +97,42 @@ describe("solve-issue workflow: Gitea API PR creation", () => {
|
|||||||
expect(committedVariant.required).toContain("$status");
|
expect(committedVariant.required).toContain("$status");
|
||||||
});
|
});
|
||||||
|
|
||||||
test("developer procedure should include mandatory verification step", async () => {
|
test("developer procedure should include worktree setup", async () => {
|
||||||
const yamlContent = await readFile(workflowPath, "utf-8");
|
const yamlContent = await readFile(workflowPath, "utf-8");
|
||||||
const workflow = parse(yamlContent) as WorkflowPayload;
|
const workflow = parse(yamlContent) as WorkflowPayload;
|
||||||
|
|
||||||
const developerProcedure = workflow.roles.developer?.procedure;
|
const developerProcedure = workflow.roles.developer?.procedure;
|
||||||
expect(developerProcedure).toBeDefined();
|
expect(developerProcedure).toBeDefined();
|
||||||
|
|
||||||
// Verify the procedure includes mandatory verification step
|
// Verify the procedure includes worktree setup
|
||||||
expect(developerProcedure).toContain("MANDATORY VERIFICATION");
|
expect(developerProcedure).toContain("IMPORTANT");
|
||||||
expect(developerProcedure).toContain("git branch --show-current");
|
expect(developerProcedure).toContain("git worktree add");
|
||||||
expect(developerProcedure).toContain("git status");
|
expect(developerProcedure).toContain("pnpm install");
|
||||||
expect(developerProcedure).toMatch(/ls -la|verify.*exist/i);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("reviewer procedure should enforce worktree path verification", async () => {
|
test("reviewer procedure should verify branch and run checks", async () => {
|
||||||
const yamlContent = await readFile(workflowPath, "utf-8");
|
const yamlContent = await readFile(workflowPath, "utf-8");
|
||||||
const workflow = parse(yamlContent) as WorkflowPayload;
|
const workflow = parse(yamlContent) as WorkflowPayload;
|
||||||
|
|
||||||
const reviewerProcedure = workflow.roles.reviewer?.procedure;
|
const reviewerProcedure = workflow.roles.reviewer?.procedure;
|
||||||
expect(reviewerProcedure).toBeDefined();
|
expect(reviewerProcedure).toBeDefined();
|
||||||
|
|
||||||
// Verify the procedure includes critical enforcement
|
// Verify the procedure includes branch verification and build checks
|
||||||
expect(reviewerProcedure).toContain("CRITICAL");
|
expect(reviewerProcedure).toContain("git branch --show-current");
|
||||||
expect(reviewerProcedure).toMatch(/cd.*pwd/);
|
expect(reviewerProcedure).toContain("pnpm run build");
|
||||||
expect(reviewerProcedure).toContain(
|
expect(reviewerProcedure).toContain("pnpm run check");
|
||||||
"Do NOT report results without running the actual commands",
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("developer procedure should include test debugging escalation", async () => {
|
test("developer procedure should include changeset and failure handling", async () => {
|
||||||
const yamlContent = await readFile(workflowPath, "utf-8");
|
const yamlContent = await readFile(workflowPath, "utf-8");
|
||||||
const workflow = parse(yamlContent) as WorkflowPayload;
|
const workflow = parse(yamlContent) as WorkflowPayload;
|
||||||
|
|
||||||
const developerProcedure = workflow.roles.developer?.procedure;
|
const developerProcedure = workflow.roles.developer?.procedure;
|
||||||
expect(developerProcedure).toBeDefined();
|
expect(developerProcedure).toBeDefined();
|
||||||
|
|
||||||
// Verify the procedure includes test failure guidance
|
// Verify the procedure includes changeset requirement and failure path
|
||||||
expect(developerProcedure).toMatch(/tests fail.*first run/i);
|
expect(developerProcedure).toContain(".changeset/");
|
||||||
expect(developerProcedure).toMatch(/3 test cycles|after 3 attempts/i);
|
|
||||||
expect(developerProcedure).toContain("$status=failed");
|
expect(developerProcedure).toContain("$status=failed");
|
||||||
|
expect(developerProcedure).toContain("pnpm test");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user