feat(prd-1): implement M7 - entry point + mode handler integration
- Tag mode routes to fetchForgejoData vs fetchGitHubData based on platform - createInitialComment auto-detects platform for Forgejo spinner/URL format - update-comment-link uses updateForgejoCommentBody + Forgejo PR compare URL - update-with-branch uses platform-aware branch/job-run link formatting - Agent mode needed NO changes (token in run.ts, rest uses Octokit REST) - 11 new integration tests in test/m7-integration.test.ts - 785 tests pass, typecheck clean, format clean Progress: 78% complete (7/9 milestones) - M3, M8, M9 remaining Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ce1459fe7f
commit
88401255be
7 files changed
+315
-29
No files matched your search
+11
-3
@@ -12,6 +12,8 @@ import {
|
||||
extractOriginalTitle,
|
||||
extractOriginalBody,
|
||||
} from "../../github/data/fetcher";
|
||||
import { fetchForgejoData } from "../../forgejo/data/fetcher";
|
||||
import { detectPlatform } from "../../platform/detector";
|
||||
import { createPrompt } from "../../create-prompt";
|
||||
import { isEntityContext } from "../../github/context";
|
||||
import type { GitHubContext } from "../../github/context";
|
||||
@@ -41,7 +43,7 @@ export async function prepareTagMode({
|
||||
// Check if actor is human
|
||||
await checkHumanActor(octokit.rest, context);
|
||||
|
||||
// Create initial tracking comment
|
||||
// Create initial tracking comment (auto-detects platform for spinner/URL format)
|
||||
const commentData = await createInitialComment(octokit.rest, context);
|
||||
const commentId = commentData.id;
|
||||
|
||||
@@ -49,7 +51,9 @@ export async function prepareTagMode({
|
||||
const originalTitle = extractOriginalTitle(context);
|
||||
const originalBody = extractOriginalBody(context);
|
||||
|
||||
const githubData = await fetchGitHubData({
|
||||
// Platform-aware data fetching: Forgejo uses REST-only, GitHub uses GraphQL
|
||||
const platform = detectPlatform();
|
||||
const fetchParams = {
|
||||
octokits: octokit,
|
||||
repository: `${context.repository.owner}/${context.repository.repo}`,
|
||||
prNumber: context.entityNumber.toString(),
|
||||
@@ -60,7 +64,11 @@ export async function prepareTagMode({
|
||||
originalBody,
|
||||
includeCommentsByActor: context.inputs.includeCommentsByActor,
|
||||
excludeCommentsByActor: context.inputs.excludeCommentsByActor,
|
||||
});
|
||||
};
|
||||
const githubData =
|
||||
platform === "forgejo"
|
||||
? await fetchForgejoData(fetchParams)
|
||||
: await fetchGitHubData(fetchParams);
|
||||
|
||||
// Setup branch
|
||||
const branchInfo = await setupBranch(octokit, githubData, context);
|
||||
|
||||
Reference in new issue
Block a user