Compare commits

..
2 Commits
Author SHA1 Message Date
Daniel SamsonandClaude Opus 4.6 81aee2f7fc Route spec PR review feedback to rework-spec instead of rework-pr
Publish Image / publish (push) Successful in 23s
When a review requests changes on a docs/ branch (architect PR), trigger
the rework-spec task type instead of rework-pr. This re-runs the architect
persona to fix the design docs based on review feedback.

- Add rework-spec to Coder template task_type options and lightweight stages
- Detect architect PRs via docs/ branch prefix in pr-rework handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 16:18:00 +01:00
Daniel SamsonandClaude Opus 4.6 f495ea391f Fix issue-label and pr-rework webhook handlers
Publish Image / publish (push) Successful in 22s
- issue-label: Accept action "created" from Gitea (in addition to
  "labeled" and "label_updated") — Gitea sends "created" for new labels
- pr-rework: Guard against missing review object to prevent TypeError
  crash when Gitea sends review webhook without review data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 16:12:04 +01:00
3 changed files with 13 additions and 3 deletions
+5 -1
View File
@@ -128,6 +128,10 @@ data "coder_parameter" "task_type" {
name = "Rework PR" name = "Rework PR"
value = "rework-pr" value = "rework-pr"
} }
option {
name = "Rework Spec"
value = "rework-spec"
}
option { option {
name = "Release" name = "Release"
value = "release" value = "release"
@@ -470,7 +474,7 @@ resource "coder_agent" "main" {
git fetch origin develop 2>/dev/null && git checkout develop 2>/dev/null || true git fetch origin develop 2>/dev/null && git checkout develop 2>/dev/null || true
# Lightweight stages only need the code, not a full build # Lightweight stages only need the code, not a full build
LIGHT_STAGES="analyse architect release maintenance" LIGHT_STAGES="analyse architect rework-spec release maintenance"
if echo "$LIGHT_STAGES" | grep -qw "$TASK_TYPE"; then if echo "$LIGHT_STAGES" | grep -qw "$TASK_TYPE"; then
echo "Lightweight stage ($TASK_TYPE) — skipping build" echo "Lightweight stage ($TASK_TYPE) — skipping build"
else else
+1 -1
View File
@@ -24,7 +24,7 @@ export function issueLabel(config: Config, queue: TaskQueue) {
console.log(`[issue-label] action="${event.action}" issue=#${event.issue.number} labels=[${event.issue.labels.map((l) => l.name).join(", ")}]`); console.log(`[issue-label] action="${event.action}" issue=#${event.issue.number} labels=[${event.issue.labels.map((l) => l.name).join(", ")}]`);
if (event.action !== "label_updated" && event.action !== "labeled") { if (!["labeled", "label_updated", "created"].includes(event.action)) {
return c.text("ignored: not a label event", 200); return c.text("ignored: not a label event", 200);
} }
+7 -1
View File
@@ -16,15 +16,21 @@ export function prRework(config: Config, queue: TaskQueue) {
return c.text("ignored: not a reviewed event", 200); return c.text("ignored: not a reviewed event", 200);
} }
if (!event.review) {
return c.text("ignored: no review data", 200);
}
const [org, repo] = event.repository.full_name.split("/"); const [org, repo] = event.repository.full_name.split("/");
const prNumber = event.pull_request.number; const prNumber = event.pull_request.number;
const reviewState = event.review.state.toLowerCase(); const reviewState = event.review.state.toLowerCase();
let taskType: string | null = null; let taskType: string | null = null;
let giteaToken: string; let giteaToken: string;
const branch = event.pull_request.head.ref;
const isArchitectPR = branch.startsWith("docs/");
if (reviewState === "request_changes") { if (reviewState === "request_changes") {
taskType = "rework-pr"; taskType = isArchitectPR ? "rework-spec" : "rework-pr";
giteaToken = config.giteaDevToken; giteaToken = config.giteaDevToken;
} else if (reviewState === "approved") { } else if (reviewState === "approved") {
taskType = "test"; taskType = "test";