diff --git a/.env.example b/.env.example index 0382615..0d1bb08 100644 --- a/.env.example +++ b/.env.example @@ -25,7 +25,7 @@ BYOK_ENCRYPTION_KEY= AI_GENERATION_ROUTE=claude-openai # GitHub App (Frontend - Vite build-time env var) -# Defaults: gitdogbot-dev in development, gitdogbot in production +# Defaults: gitdogbot-dev in development, gitdogai in production VITE_GITHUB_APP_SLUG= # Lemon Squeezy (Backend - Convex env vars) diff --git a/.github/workflows/deploy-convex.yml b/.github/workflows/deploy-convex.yml index dc257ea..e539027 100644 --- a/.github/workflows/deploy-convex.yml +++ b/.github/workflows/deploy-convex.yml @@ -63,10 +63,15 @@ jobs: production_env["$name"]="$value" done - if [ "${production_env[GITHUB_APP_SLUG]}" != "gitdogbot" ]; then - echo "::error::GITHUB_APP_SLUG must be exactly gitdogbot in production." - exit 1 - fi + # gitdogbot is the production app's former name, accepted while the + # rename to gitdogai rolls out. + case "${production_env[GITHUB_APP_SLUG]}" in + gitdogai | gitdogbot) ;; + *) + echo "::error::GITHUB_APP_SLUG must be gitdogai in production." + exit 1 + ;; + esac if ! DEPLOY_URL_TO_VALIDATE="${production_env[SITE_URL]}" bun run .github/scripts/validateDeployUrl.ts; then echo "::error::SITE_URL must exactly match a public HTTPS origin without a trailing slash in production." diff --git a/README.md b/README.md index 0386451..0fb5b63 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ with the actual code as evidence instead of generic advice. | **Issue assistant** | Turns rough reports into clear, structured issues and answers questions | | **Discussion assistant** | Replies to GitHub Discussions with context from your codebase | | **Pull request reviews** | Reviews changed code against the repository, suggests fixes and approves clean code | -| **Review commands** | `@gitdogbot review`, `full review`, `resolve` and `help` in a pull request, or the CLI | +| **Review commands** | `@gitdogai review`, `full review`, `resolve` and `help` in a pull request, or the CLI | | **Maintainer tagging** | Notifies the right people when a request needs a code change | | **Approval first** | With approval on (the default), drafts wait in your queue until you approve them | | **Your own AI keys** | Run generation on your Anthropic or OpenAI key, encrypted at rest and never shown again | @@ -97,21 +97,22 @@ approval until the new commits are reviewed. Gitdog reviews a pull request once, when it is opened or marked ready for review. After that, ask for more in a pull request comment or from the CLI: -| Pull request comment | CLI | What it does | -| ------------------------ | ------------------------------------------- | ------------------------------------------------ | -| `@gitdogbot review` | `gitdog reviews request ` | Reviews the commits pushed since the last review | -| `@gitdogbot full review` | `gitdog reviews request --full` | Reviews the whole pull request again | -| `@gitdogbot resolve` | `gitdog reviews resolve ` | Resolves every Gitdog review thread | -| `@gitdogbot help` | `gitdog reviews --help` | Lists the commands | +| Pull request comment | CLI | What it does | +| ----------------------- | ------------------------------------------- | ------------------------------------------------ | +| `@gitdogai review` | `gitdog reviews request ` | Reviews the commits pushed since the last review | +| `@gitdogai full review` | `gitdog reviews request --full` | Reviews the whole pull request again | +| `@gitdogai resolve` | `gitdog reviews resolve ` | Resolves every Gitdog review thread | +| `@gitdogai help` | `gitdog reviews --help` | Lists the commands | - **Where**: a comment line in the pull request conversation that starts with the mention, or follows another review bot's command on the same line - (`@coderabbitai review @gitdogbot review`). Replies inside a review thread + (`@coderabbitai review @gitdogai review`). Replies inside a review thread are not read. - **Who**: collaborators can run every command. The pull request author, who may work from a fork, can run all but `full review`. -- **`@gitdog`** works as shorthand, but it also notifies the GitHub user of that - name, so `@gitdogbot` is preferred. +- **Other names**: `@gitdogbot`, the app's former name, still works. `@gitdog` + works as shorthand, but it also notifies the GitHub user of that name, so + `@gitdogai` is preferred. - **Status**: while a review runs, one status comment on the pull request shows whether it is reviewing, waiting for approval, reviewed, or why it could not finish. A review that failed or ran out of tokens can be requested again. For @@ -121,7 +122,7 @@ review. After that, ask for more in a pull request comment or from the CLI: one repository is paused there for 24 hours. Pull requests opened by bots such as Dependabot are not reviewed. -In an issue or discussion, mention `@gitdogbot` with a question to get a reply +In an issue or discussion, mention `@gitdogai` with a question to get a reply grounded in the repository. ## Plans diff --git a/convex/_ai/issueAnalysis/agenticWorkflow.ts b/convex/_ai/issueAnalysis/agenticWorkflow.ts index a27f10c..958f4c6 100644 --- a/convex/_ai/issueAnalysis/agenticWorkflow.ts +++ b/convex/_ai/issueAnalysis/agenticWorkflow.ts @@ -62,7 +62,9 @@ function isResponseIncomplete(response: string): boolean { return false; } -const AGENTIC_SYSTEM_PROMPT = `You are ${getConfiguredGitdogMention() ?? "the Gitdog bot"}, an AI-powered GitHub assistant analyzing issues for THIS SPECIFIC REPOSITORY. +// Built per call so a GITHUB_APP_SLUG change applies without a redeploy. +function agenticSystemPrompt(): string { + return `You are ${getConfiguredGitdogMention() ?? "the Gitdog bot"}, an AI-powered GitHub assistant analyzing issues for THIS SPECIFIC REPOSITORY. ## ⛔ ABSOLUTE PROHIBITION - NEVER VIOLATE ⛔ @@ -703,6 +705,7 @@ When there is **Previous Conversation** context, you are in a DIALOGUE with the **Key principle:** Read the conversation flow. If your previous response answered a question and the follow-up is just adding/correcting details, respond briefly. Only use tools when genuinely new information is being requested. **Note:** Users marked with \`[Maintainer]\` are repository owners/collaborators - they are authoritative about their own codebase.`; +} const ISSUE_ANALYSIS_TYPES = new Set([ "actionable", @@ -1016,7 +1019,7 @@ If the remaining evidence is insufficient, say exactly what could not be verifie } // Build system prompt with optional response style and learned context - let systemPrompt = AGENTIC_SYSTEM_PROMPT; + let systemPrompt = agenticSystemPrompt(); // Add AI guide files content if found if (aiGuides.found && aiGuides.content) { diff --git a/convex/_ai/issueAnalysis/index.ts b/convex/_ai/issueAnalysis/index.ts index 0e460a6..c6db5ea 100644 --- a/convex/_ai/issueAnalysis/index.ts +++ b/convex/_ai/issueAnalysis/index.ts @@ -2,6 +2,6 @@ export { analyzeIssue } from "./workflow"; export type { IssueAnalysisResult, IssueType, IssueInput } from "./types"; export { - ISSUE_ANALYSIS_SYSTEM_PROMPT, + issueAnalysisSystemPrompt, createIssueAnalysisUserPrompt, } from "./prompts"; diff --git a/convex/_ai/issueAnalysis/prompts.ts b/convex/_ai/issueAnalysis/prompts.ts index 9b6d80e..2a2b4df 100644 --- a/convex/_ai/issueAnalysis/prompts.ts +++ b/convex/_ai/issueAnalysis/prompts.ts @@ -1,7 +1,9 @@ // AI prompts for issue analysis import { getConfiguredGitdogMention } from "../../github/botIdentity"; -export const ISSUE_ANALYSIS_SYSTEM_PROMPT = `You are ${getConfiguredGitdogMention() ?? "the Gitdog bot"}, a GitHub Assistant powered by gitdog.dev. +// Built per call so a GITHUB_APP_SLUG change applies without a redeploy. +export function issueAnalysisSystemPrompt(): string { + return `You are ${getConfiguredGitdogMention() ?? "the Gitdog bot"}, a GitHub Assistant powered by gitdog.dev. ## Your Role Analyze GitHub issues and provide accurate, code-grounded responses using codebase context. @@ -79,6 +81,7 @@ Return ONLY valid JSON (no markdown wrapper): "reasoning": "Brief classification reason (1-2 sentences)", "suggestedResponse": "REQUIRED - Your response grounded in codebase context. Include code references where applicable." }`; +} export function createIssueAnalysisUserPrompt( title: string, diff --git a/convex/_ai/issueAnalysis/workflow.ts b/convex/_ai/issueAnalysis/workflow.ts index 9051b73..ec07c1f 100644 --- a/convex/_ai/issueAnalysis/workflow.ts +++ b/convex/_ai/issueAnalysis/workflow.ts @@ -3,7 +3,7 @@ import { Workflow, createChatStep } from "../workflow"; import { parseJsonResponse } from "../utils"; import type { IssueAnalysisResult, IssueInput } from "./types"; import { - ISSUE_ANALYSIS_SYSTEM_PROMPT, + issueAnalysisSystemPrompt, createIssueAnalysisUserPrompt, } from "./prompts"; @@ -23,7 +23,7 @@ export async function analyzeIssue( .addStep( "analyze_issue", createChatStep( - ISSUE_ANALYSIS_SYSTEM_PROMPT, + issueAnalysisSystemPrompt(), (input: unknown) => { const { title, body, codebaseContext } = input as IssueInput; return createIssueAnalysisUserPrompt(title, body, codebaseContext); diff --git a/convex/github/botIdentity.ts b/convex/github/botIdentity.ts index b353aac..1aea7dd 100644 --- a/convex/github/botIdentity.ts +++ b/convex/github/botIdentity.ts @@ -8,6 +8,23 @@ export function getConfiguredGitHubAppSlug( return slug && GITHUB_APP_SLUG_PATTERN.test(slug) ? slug : null; } +// The production app was renamed from gitdogbot to gitdogai. Both names keep +// reaching it, so existing comments, docs and habits still work. Only the +// configured slug is trusted as Gitdog's own bot account. +const PRODUCTION_APP_NAMES = ["gitdogai", "gitdogbot"]; + +/** + * Names a mention can use to address this deployment's app, configured slug + * first. A development app answers only to its own slug. + */ +export function getGitdogMentionNames(configuredSlug?: string): string[] { + const slug = getConfiguredGitHubAppSlug(configuredSlug); + if (!slug) return []; + return PRODUCTION_APP_NAMES.includes(slug) + ? [slug, ...PRODUCTION_APP_NAMES.filter((name) => name !== slug)] + : [slug]; +} + export function getConfiguredGitdogMention( configuredSlug?: string, ): string | null { diff --git a/convex/github/helpers.ts b/convex/github/helpers.ts index 575c917..16b4378 100644 --- a/convex/github/helpers.ts +++ b/convex/github/helpers.ts @@ -1,5 +1,9 @@ import { SignJWT, importPKCS8 } from "jose"; -import { getConfiguredGitHubAppSlug, isGitdogBot } from "./botIdentity"; +import { + getConfiguredGitHubAppSlug, + getGitdogMentionNames, + isGitdogBot, +} from "./botIdentity"; const GITHUB_APP_REQUEST_TIMEOUT_MS = 15_000; const GITHUB_API_REQUEST_TIMEOUT_MS = 30_000; @@ -226,8 +230,10 @@ export async function fetchGitHubAppJsonWithRetry( } function getGitdogMentionPattern(configuredSlug?: string): RegExp | null { - const slug = getConfiguredGitHubAppSlug(configuredSlug); - return slug ? new RegExp(`@${slug}(?=\\s|[:,]|$)`, "i") : null; + const names = getGitdogMentionNames(configuredSlug); + return names.length + ? new RegExp(`@(?:${names.join("|")})(?=\\s|[:,]|$)`, "i") + : null; } export function normalizeGitdogMentionBody( diff --git a/convex/pullRequests/action.ts b/convex/pullRequests/action.ts index e4274a7..745b051 100644 --- a/convex/pullRequests/action.ts +++ b/convex/pullRequests/action.ts @@ -59,7 +59,7 @@ export const recheck = action({ }); /** - * The CLI and web counterpart of the "@gitdogbot review", "full review" and + * The CLI and web counterpart of the "@gitdogai review", "full review" and * "resolve" pull request comments. The command reply is returned instead of * posted. The review itself, a limit notice if it runs out of tokens, and a * note when there is nothing new to review are posted as for comments. diff --git a/convex/pullRequests/commands.ts b/convex/pullRequests/commands.ts index f987c28..c6ba674 100644 --- a/convex/pullRequests/commands.ts +++ b/convex/pullRequests/commands.ts @@ -1,4 +1,7 @@ -import { getConfiguredGitHubAppSlug } from "../github/botIdentity"; +import { + getConfiguredGitHubAppSlug, + getGitdogMentionNames, +} from "../github/botIdentity"; export type ReviewCommand = "review" | "full_review" | "resolve" | "help"; @@ -60,9 +63,9 @@ export function parseReviewCommand( ) .join("\n"); // A command starts a line, or follows another review bot's command on it, - // as in "@coderabbitai review @gitdogbot review". "@gitdog" is shorthand + // as in "@coderabbitai review @gitdogai review". "@gitdog" is shorthand // for the production app only, so a development app never answers it. - const names = slug === "gitdogbot" ? `${slug}|gitdog` : slug; + const names = commandNames(slug).join("|"); const match = new RegExp( `^[ \\t]*((?:@(?:${REVIEW_BOTS})(?:[ \\t]+[a-z-]+){0,2}[ \\t]+){0,3})@(?:${names})(?=\\s|[:,]|$)[:,]?[ \\t]*([^@\\n]*)`, "im", @@ -96,8 +99,16 @@ export function parseReviewCommand( } } +function commandNames(slug: string): string[] { + const names = getGitdogMentionNames(slug); + return names.length > 1 ? [...names, "gitdog"] : names; +} + export function helpText(slug: string): string { const mention = `@${slug}`; + const others = commandNames(slug) + .slice(1) + .map((name) => `\`@${name}\``); return [ "**Gitdog commands**", "Gitdog reviews a pull request once when it is opened or marked ready for review. After that, comment:", @@ -106,7 +117,7 @@ export function helpText(slug: string): string { `- \`${mention} resolve\`: resolve every Gitdog review thread`, `- \`${mention} help\`: show this list`, "Collaborators can run every command; the pull request author can run all but a full review.", - ...(slug === "gitdogbot" ? ["`@gitdog` works as shorthand."] : []), + ...(others.length ? [`${others.join(" and ")} work too.`] : []), ].join("\n"); } diff --git a/convex/pullRequests/internalAction.ts b/convex/pullRequests/internalAction.ts index 694559f..1835539 100644 --- a/convex/pullRequests/internalAction.ts +++ b/convex/pullRequests/internalAction.ts @@ -1170,7 +1170,7 @@ export const dismissStaleApproval = internalAction({ access, args.number, stale, - `New commits were pushed after the commit Gitdog approved. Comment @${getConfiguredGitHubAppSlug() ?? "gitdogbot"} review to review them.`, + `New commits were pushed after the commit Gitdog approved. Comment @${getConfiguredGitHubAppSlug() ?? "gitdogai"} review to review them.`, ); // Remembered until GitHub accepts every dismissal, including any past // the per-run cap, so a later push retries. @@ -1338,7 +1338,7 @@ export function commandReply( } } -/** Run one "@gitdogbot " comment on a pull request and answer it. */ +/** Run one "@gitdogai " comment on a pull request and answer it. */ export const runCommand = internalAction({ args: { repositoryId: v.id("repositories"), diff --git a/convex/pullRequests/internalMutation.ts b/convex/pullRequests/internalMutation.ts index 8233f44..63ca39c 100644 --- a/convex/pullRequests/internalMutation.ts +++ b/convex/pullRequests/internalMutation.ts @@ -984,7 +984,7 @@ export const propose = internalMutation({ (baseFindings === 0 || base.executionResult?.inlineFindings === true))); // A requested follow-up with nothing new still posts when it can - // approve, so "@gitdogbot review" restores an approval a push such as a + // approve, so "@gitdogai review" restores an approval a push such as a // base merge withdrew. const unpublished = verificationOnly || (nothingNew && !coverageComplete); await ctx.db.patch(action._id, { diff --git a/convex/pullRequests/webhook.ts b/convex/pullRequests/webhook.ts index 2adcb05..9eff752 100644 --- a/convex/pullRequests/webhook.ts +++ b/convex/pullRequests/webhook.ts @@ -57,7 +57,7 @@ export async function handlePullRequestEvent( } /** - * A "@gitdogbot " comment on a pull request. Only the PR author and + * A "@gitdogai " comment on a pull request. Only the PR author and * repository collaborators can run commands, and a redelivered comment runs * once. */ diff --git a/convex/schema.ts b/convex/schema.ts index 0f68929..8bf109f 100644 --- a/convex/schema.ts +++ b/convex/schema.ts @@ -970,7 +970,7 @@ const applicationTables = { }), ), reviewVerificationOnly: v.optional(v.boolean()), - // Started by a "@gitdogbot review" comment or the CLI. + // Started by a "@gitdogai review" comment or the CLI. reviewRequested: v.optional(v.boolean()), // The pull request comment that shows this review's progress and outcome. statusCommentId: v.optional(v.number()), @@ -1699,7 +1699,7 @@ const applicationTables = { .index("by_repository_and_user", ["repositoryId", "userId"]), // ============================================ - // PULL REQUEST COMMANDS (@gitdogbot review, ...) + // PULL REQUEST COMMANDS (@gitdogai review, ...) // ============================================ // One row per command comment, kept to drop redeliveries and to pause a // commenter who sends too many. diff --git a/convex/ticketActions/action.ts b/convex/ticketActions/action.ts index 0054562..096ab31 100644 --- a/convex/ticketActions/action.ts +++ b/convex/ticketActions/action.ts @@ -23,8 +23,6 @@ import { CLAIMED_EXECUTION_RECOVERY_GRACE_MS, } from "./executionRecovery"; -const FOOTER_MESSAGE = getGitdogFollowUpFooter(); - /** * Approve a pending action */ @@ -269,7 +267,7 @@ export const approve = action({ const commentBody = buildMarkedResponseComment( ticketAction.proposedChanges.suggestedResponse, typeof authorToMention === "string" ? authorToMention : undefined, - FOOTER_MESSAGE, + getGitdogFollowUpFooter(), executionClaim.idempotencyKey, ); diff --git a/convex/tickets/internalAction.ts b/convex/tickets/internalAction.ts index 6319a05..0447938 100644 --- a/convex/tickets/internalAction.ts +++ b/convex/tickets/internalAction.ts @@ -61,8 +61,6 @@ import { stripExecutionMarkers, } from "../ticketActions/executionRecovery"; -const FOOTER_MESSAGE = getGitdogFollowUpFooter(); - function getProviderRetryAttempt(attempt?: number): number { return attempt !== undefined && Number.isSafeInteger(attempt) && attempt >= 0 ? attempt @@ -1662,7 +1660,7 @@ export const executeAutoApprovedAction = internalAction({ const commentBody = buildMarkedResponseComment( ticketAction.proposedChanges.suggestedResponse, typeof authorToMention === "string" ? authorToMention : undefined, - FOOTER_MESSAGE, + getGitdogFollowUpFooter(), executionClaim.idempotencyKey, ); diff --git a/docs/github-app-setup.md b/docs/github-app-setup.md index 92e5cd5..2e6df99 100644 --- a/docs/github-app-setup.md +++ b/docs/github-app-setup.md @@ -84,7 +84,7 @@ review. Later reviews run when the author or a collaborator comments `@ review` (changes since the last review) or `@ full review`; `@ resolve` resolves Gitdog's threads and `@ help` lists the commands; `gitdog reviews request|resolve` runs the same from the CLI. -A command is a comment line that starts with the mention, or follows another review bot's command on the same line; `@gitdog` works as shorthand in production. The pull request +A command is a comment line that starts with the mention, or follows another review bot's command on the same line; in production, `@gitdogbot` (the app's former name) and the `@gitdog` shorthand also work. The pull request author can run every command except a full review, which needs a collaborator. These arrive through the **Issue comments** event. A commenter who sends more than 10 commands an hour or 40 a day to one @@ -148,7 +148,7 @@ Set the matching Convex environment variable for each backend deployment: ```bash # Production Convex deployment -bunx convex env set GITHUB_APP_SLUG gitdogbot --prod +bunx convex env set GITHUB_APP_SLUG gitdogai --prod ``` The backend fails closed for mentions and bot-authorship checks when this value @@ -161,7 +161,7 @@ authenticate against or mutate the production Convex deployment. Keep the production `VITE_CONVEX_URL` secret reserved for the main-branch deployment. When the frontend `VITE_GITHUB_APP_SLUG` variable is omitted, Gitdog defaults -to `gitdogbot-dev` in development and `gitdogbot` in production. The backend +to `gitdogbot-dev` in development and `gitdogai` in production. The backend variable has no fallback and must match the frontend deployment exactly. ### Verify Environment Variables @@ -203,7 +203,7 @@ Users can install the app on: Each installation is separate with its own installation ID. All installations can be managed at -Do not connect the same repository to both `gitdogbot` and `gitdogbot-dev`. +Do not connect the same repository to both `gitdogai` and `gitdogbot-dev`. Mentions are isolated by `GITHUB_APP_SLUG`, but GitHub sends automatic issue, discussion, repository, and push events to every App installed on that repository. Use a dedicated test repository for the development App. @@ -225,7 +225,7 @@ For production deployment: 2. Update Convex environment variables for production deployment: ```bash - bunx convex env set GITHUB_APP_SLUG gitdogbot --prod + bunx convex env set GITHUB_APP_SLUG gitdogai --prod bunx convex env set GITHUB_APP_ID "your_app_id" --prod bunx convex env set GITHUB_APP_CLIENT_ID "your_client_id" --prod bunx convex env set GITHUB_APP_CLIENT_SECRET --prod < github-app-client-secret.txt diff --git a/packages/cli/README.md b/packages/cli/README.md index f27bc39..a55321a 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -20,7 +20,7 @@

- Gitdog terminal: connect a project, configure automation and review pending actions + Gitdog terminal: connect a project, configure automation and review pending actions

Connect repositories, configure issue, discussion and PR automation, review @@ -69,7 +69,7 @@ Use `npx gitdog@latest --help` to explore commands. Add `--json` for scripts. ```sh npx gitdog@latest keys create --name ci -npx --yes gitdog@0.4.0 --key-file /path/to/key.json projects list --json +npx --yes gitdog@0.4.1 --key-file /path/to/key.json projects list --json npx gitdog@latest keys revoke KEY_ID --yes ``` diff --git a/packages/cli/docs/REFERENCE.md b/packages/cli/docs/REFERENCE.md index eae955a..09d9df8 100644 --- a/packages/cli/docs/REFERENCE.md +++ b/packages/cli/docs/REFERENCE.md @@ -385,13 +385,14 @@ npx gitdog@latest reviews recheck ACTION_ID Gitdog reviews a pull request once, when it is opened or marked ready for review. The `reviews` commands match the pull request comments -`@gitdogbot review` (commits since the last review), `@gitdogbot full review` -and `@gitdogbot resolve` (resolves Gitdog's threads); the CLI prints the result +`@gitdogai review` (commits since the last review), `@gitdogai full review` +and `@gitdogai resolve` (resolves Gitdog's threads); the CLI prints the result instead of replying on GitHub. On GitHub, commands go in the pull request -conversation, not in replies inside a review thread; `@gitdog` works as -shorthand for `@gitdogbot`. `reviews request` asks before spending tokens -(skip with `--yes`) and prints the queued review's action id. `reviews recheck` -reruns a failed review on the latest commit without posting. +conversation, not in replies inside a review thread. `@gitdogbot`, the app's +former name, and the `@gitdog` shorthand also work. `reviews request` asks +before spending tokens (skip with `--yes`) and prints the queued review's action +id. `reviews recheck` reruns a failed review on the latest commit without +posting. Reviews are opt-in and require GitHub App pull-request write permission. Proposals appear in Tickets; approval posts inline comments on the reviewed @@ -401,7 +402,7 @@ or reviewers with write access. Disable them with fully reviewed changes posts at once and approves the reviewed commit when no Gitdog thread is open; a later push, including updating the branch, withdraws the approval while pull -request reviews stay on; `reviews request` (or `@gitdogbot review`) reviews the +request reviews stay on; `reviews request` (or `@gitdogai review`) reviews the new commits and can approve again. Gitdog does not commit changes automatically or execute PR code. Incomplete coverage and failed reviews remain visible. New settings require the corresponding diff --git a/packages/cli/package.json b/packages/cli/package.json index 507a4eb..051fa99 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "gitdog", - "version": "0.4.0", + "version": "0.4.1", "description": "Manage Gitdog projects, GitHub automation and API keys from your terminal", "type": "module", "bin": { diff --git a/packages/cli/src/commands.ts b/packages/cli/src/commands.ts index 6b4cac9..6ab3dd4 100644 --- a/packages/cli/src/commands.ts +++ b/packages/cli/src/commands.ts @@ -1042,12 +1042,12 @@ export function createProgram( const reviews = program .command("reviews") .description( - "Run pull request review commands, like @gitdogbot comments on GitHub", + "Run pull request review commands, like @gitdogai comments on GitHub", ); command( reviews, "request ", - "Review the commits pushed since the last review (@gitdogbot review)", + "Review the commits pushed since the last review (@gitdogai review)", async ({ api, ui }, [ticketId], opts) => { await ui.confirm( "Start a pull request review? It uses tokens.", @@ -1062,12 +1062,12 @@ export function createProgram( }, ).option( "--full", - "Review the whole pull request again (@gitdogbot full review)", + "Review the whole pull request again (@gitdogai full review)", ); service( reviews, "resolve ", - "Resolve every Gitdog review thread (@gitdogbot resolve)", + "Resolve every Gitdog review thread (@gitdogai resolve)", "action", "pullRequests/action:command", ([ticketId]) => ({ ticketId, command: "resolve" }), @@ -1353,7 +1353,7 @@ export function createProgram( "install", "Open GitHub App installation and permission selection", async ({ ui }, _args, opts) => { - const slug = text(opts.app) ?? "gitdogbot"; + const slug = text(opts.app) ?? "gitdogai"; if (!/^[a-z\d][a-z\d-]{0,99}$/.test(slug)) throw new Error("Invalid GitHub App slug."); const url = `https://github.com/apps/${slug}/installations/new`; @@ -1367,7 +1367,7 @@ export function createProgram( .option( "--app ", "GitHub App slug (use gitdogbot-dev for development)", - "gitdogbot", + "gitdogai", ) .option("--print", "Print the installation URL"); command( diff --git a/packages/cli/src/ui.ts b/packages/cli/src/ui.ts index d937ff5..d880327 100644 --- a/packages/cli/src/ui.ts +++ b/packages/cli/src/ui.ts @@ -1,7 +1,7 @@ import { createInterface } from "node:readline/promises"; import { stripVTControlCharacters } from "node:util"; -export const VERSION = "0.4.0"; +export const VERSION = "0.4.1"; export const DOG = String.raw` ▗██▄▄ ▄▄██▖ ██▀▜██▙▄ ▙▄ ▄▟██▛▀██ diff --git a/public/llms-full.txt b/public/llms-full.txt index df9d226..885aa7f 100644 --- a/public/llms-full.txt +++ b/public/llms-full.txt @@ -4,7 +4,7 @@ ## What is Gitdog? -Gitdog is an AI automation platform designed specifically for GitHub repositories. It works by integrating with your GitHub repository through a GitHub App, indexing your codebase, and then providing intelligent, context-aware responses when users mention @gitdogbot in issues or discussions. +Gitdog is an AI automation platform designed specifically for GitHub repositories. It works by integrating with your GitHub repository through a GitHub App, indexing your codebase, and then providing intelligent, context-aware responses when users mention @gitdogai in issues or discussions. The AI understands your codebase structure, dependencies, and code patterns to provide accurate and helpful responses that are specifically tailored to your project. @@ -12,13 +12,13 @@ The AI understands your codebase structure, dependencies, and code patterns to p 1. **Connect Repository**: Install the Gitdog GitHub App on your repository 2. **Automatic Indexing**: Gitdog indexes your codebase to understand the project structure -3. **Mention @gitdogbot**: In any issue or discussion, mention @gitdogbot with your question +3. **Mention @gitdogai**: In any issue or discussion, mention @gitdogai with your question 4. **AI Response**: Gitdog analyzes the context and provides an intelligent, codebase-aware response ## Core Features ### Issue Automation -When someone opens an issue or comments on one, mentioning @gitdogbot will trigger an AI response that: +When someone opens an issue or comments on one, mentioning @gitdogai will trigger an AI response that: - Analyzes the issue content - Searches relevant code in your repository - Provides helpful guidance based on your actual codebase @@ -44,16 +44,16 @@ Gitdog reviews a pull request once, when it is opened or marked ready for review | Pull request comment | CLI | What it does | | --- | --- | --- | -| `@gitdogbot review` | `gitdog reviews request ` | Reviews the commits pushed since the last review | -| `@gitdogbot full review` | `gitdog reviews request --full` | Reviews the whole pull request again | -| `@gitdogbot resolve` | `gitdog reviews resolve ` | Resolves every Gitdog review thread | -| `@gitdogbot help` | `gitdog reviews --help` | Lists the commands | +| `@gitdogai review` | `gitdog reviews request ` | Reviews the commits pushed since the last review | +| `@gitdogai full review` | `gitdog reviews request --full` | Reviews the whole pull request again | +| `@gitdogai resolve` | `gitdog reviews resolve ` | Resolves every Gitdog review thread | +| `@gitdogai help` | `gitdog reviews --help` | Lists the commands | -A command is a comment line that starts with the mention, or follows another review bot's command on the same line. `@gitdog` works as shorthand. While a review runs, Gitdog keeps one status comment on the pull request up to date. Commands go in the pull request conversation; replies inside a review thread are not read, and pull requests opened by bots such as Dependabot are not reviewed. Collaborators can run every command; the pull request author, who may work from a fork, can run all but a full review. A review that failed or ran out of tokens can be requested again. +A command is a comment line that starts with the mention, or follows another review bot's command on the same line. `@gitdogbot`, the app's former name, and the `@gitdog` shorthand also work. While a review runs, Gitdog keeps one status comment on the pull request up to date. Commands go in the pull request conversation; replies inside a review thread are not read, and pull requests opened by bots such as Dependabot are not reviewed. Collaborators can run every command; the pull request author, who may work from a fork, can run all but a full review. A review that failed or ran out of tokens can be requested again. -In issues and discussions, mention `@gitdogbot` with a question to get a reply grounded in the repository. +In issues and discussions, mention `@gitdogai` with a question to get a reply grounded in the repository. -- A review that finds no issues in fully reviewed changes approves the pull request; a later push, including updating the branch, withdraws the approval until `@gitdogbot review` reviews the new commits. +- A review that finds no issues in fully reviewed changes approves the pull request; a later push, including updating the branch, withdraws the approval until `@gitdogai review` reviews the new commits. - When a review cannot finish, for example because the account ran out of tokens, its status comment says why; for automatic reviews Gitdog posts at most one such comment a day per pull request. - Someone who sends more than 10 commands an hour or 40 a day to one repository is paused there for 24 hours. @@ -101,7 +101,7 @@ The `gitdog` npm CLI (`npx gitdog@latest`) covers the same workflows as the web Gitdog is an AI-powered GitHub assistant that automatically responds to issues and discussions by understanding your codebase context. ### How do I get started? -Sign in with your GitHub account at gitdog.dev, connect your repository, and start mentioning @gitdogbot in your issues or discussions. +Sign in with your GitHub account at gitdog.dev, connect your repository, and start mentioning @gitdogai in your issues or discussions. ### Is my code secure? Gitdog processes repository files to build its search index and retains that index while the repository is connected. Access, provider processing, retention, and deletion are described in the Privacy Policy. diff --git a/public/llms.txt b/public/llms.txt index f73b202..ced3182 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -4,7 +4,7 @@ ## About Gitdog -Gitdog is an AI automation platform for GitHub that helps developers automate repetitive tasks. When users mention @gitdogbot in issues or discussions, the AI assistant analyzes the codebase context and provides intelligent, relevant responses. It also reviews pull requests and runs review commands from pull request comments and the gitdog CLI. +Gitdog is an AI automation platform for GitHub that helps developers automate repetitive tasks. When users mention @gitdogai in issues or discussions, the AI assistant analyzes the codebase context and provides intelligent, relevant responses. It also reviews pull requests and runs review commands from pull request comments and the gitdog CLI. ## Core Features @@ -20,16 +20,16 @@ Gitdog reviews a pull request once, when it is opened or marked ready for review | Pull request comment | CLI | What it does | | --- | --- | --- | -| `@gitdogbot review` | `gitdog reviews request ` | Reviews the commits pushed since the last review | -| `@gitdogbot full review` | `gitdog reviews request --full` | Reviews the whole pull request again | -| `@gitdogbot resolve` | `gitdog reviews resolve ` | Resolves every Gitdog review thread | -| `@gitdogbot help` | `gitdog reviews --help` | Lists the commands | +| `@gitdogai review` | `gitdog reviews request ` | Reviews the commits pushed since the last review | +| `@gitdogai full review` | `gitdog reviews request --full` | Reviews the whole pull request again | +| `@gitdogai resolve` | `gitdog reviews resolve ` | Resolves every Gitdog review thread | +| `@gitdogai help` | `gitdog reviews --help` | Lists the commands | -A command is a comment line that starts with the mention, or follows another review bot's command on the same line. `@gitdog` works as shorthand. While a review runs, Gitdog keeps one status comment on the pull request up to date. Commands go in the pull request conversation; replies inside a review thread are not read, and pull requests opened by bots such as Dependabot are not reviewed. Collaborators can run every command; the pull request author, who may work from a fork, can run all but a full review. A review that failed or ran out of tokens can be requested again. +A command is a comment line that starts with the mention, or follows another review bot's command on the same line. `@gitdogbot`, the app's former name, and the `@gitdog` shorthand also work. While a review runs, Gitdog keeps one status comment on the pull request up to date. Commands go in the pull request conversation; replies inside a review thread are not read, and pull requests opened by bots such as Dependabot are not reviewed. Collaborators can run every command; the pull request author, who may work from a fork, can run all but a full review. A review that failed or ran out of tokens can be requested again. -In issues and discussions, mention `@gitdogbot` with a question to get a reply grounded in the repository. +In issues and discussions, mention `@gitdogai` with a question to get a reply grounded in the repository. -- A review that finds no issues in fully reviewed changes approves the pull request; a later push, including updating the branch, withdraws the approval until `@gitdogbot review` reviews the new commits. +- A review that finds no issues in fully reviewed changes approves the pull request; a later push, including updating the branch, withdraws the approval until `@gitdogai review` reviews the new commits. - When a review cannot finish, for example because the account ran out of tokens, its status comment says why; for automatic reviews Gitdog posts at most one such comment a day per pull request. - Someone who sends more than 10 commands an hour or 40 a day to one repository is paused there for 24 hours. diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 7378622..426a141 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -155,7 +155,7 @@ "description": "Install the GitHub App and choose the repositories Gitdog can read." }, "mention": { - "title": "Mention @gitdogbot", + "title": "Mention @gitdogai", "description": "Tag it on GitHub, or let your repository settings start work on new tickets." }, "approve": { diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index a82846b..f75a769 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -155,7 +155,7 @@ "description": "GitHub Appをインストールし、Gitdogが読むリポジトリを選びます。" }, "mention": { - "title": "@gitdogbotをメンション", + "title": "@gitdogaiをメンション", "description": "GitHubでタグ付けするか、リポジトリ設定に従って新しいチケットの処理を自動で始めます。" }, "approve": { diff --git a/src/i18n/locales/ko.json b/src/i18n/locales/ko.json index b256fae..79d669b 100644 --- a/src/i18n/locales/ko.json +++ b/src/i18n/locales/ko.json @@ -155,7 +155,7 @@ "description": "GitHub App을 설치하고 Gitdog이 읽을 저장소를 선택합니다." }, "mention": { - "title": "@gitdogbot 멘션", + "title": "@gitdogai 멘션", "description": "GitHub에서 태그하거나, 저장소 설정에 따라 새 티켓 작업을 자동으로 시작합니다." }, "approve": { diff --git a/src/pages/home/LandingPage.tsx b/src/pages/home/LandingPage.tsx index 673bd3e..dbad1d6 100644 --- a/src/pages/home/LandingPage.tsx +++ b/src/pages/home/LandingPage.tsx @@ -58,7 +58,7 @@ function SampleThread() {

- @gitdogbot + @gitdogai {" "} {t("home.landing.thread.question")}

diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index 9e59450..c0f53cd 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -51,7 +51,7 @@ export function HomePage() { { question: "How does Gitdog work?", answer: - "Connect your GitHub repository, and when users mention @gitdogbot in issues or discussions, the AI analyzes your codebase and provides intelligent, context-aware responses.", + "Connect your GitHub repository, and when users mention @gitdogai in issues or discussions, the AI analyzes your codebase and provides intelligent, context-aware responses.", }, { question: "Is Gitdog free to use?", diff --git a/src/pages/pricing/index.tsx b/src/pages/pricing/index.tsx index 461c139..f7f1f9a 100644 --- a/src/pages/pricing/index.tsx +++ b/src/pages/pricing/index.tsx @@ -116,7 +116,7 @@ export function PricingPage() { { question: "How do I get started with Gitdog?", answer: - "Sign in with your GitHub account at gitdog.dev, connect your repository, and start mentioning @gitdogbot in your issues or discussions.", + "Sign in with your GitHub account at gitdog.dev, connect your repository, and start mentioning @gitdogai in your issues or discussions.", }, { question: "What is the difference between Free and Pro plans?", diff --git a/src/pages/repositories/connectFlow.ts b/src/pages/repositories/connectFlow.ts index 461593a..8a5877a 100644 --- a/src/pages/repositories/connectFlow.ts +++ b/src/pages/repositories/connectFlow.ts @@ -494,7 +494,7 @@ export function resolveGitHubAppSlug( configuredSlug: string | undefined, mode: string, ): string { - const defaultSlug = mode === "production" ? "gitdogbot" : "gitdogbot-dev"; + const defaultSlug = mode === "production" ? "gitdogai" : "gitdogbot-dev"; if (configuredSlug === undefined || configuredSlug === "") { return defaultSlug; } diff --git a/test/convex/pullRequests/commands.test.ts b/test/convex/pullRequests/commands.test.ts index 1ce43e3..a06471e 100644 --- a/test/convex/pullRequests/commands.test.ts +++ b/test/convex/pullRequests/commands.test.ts @@ -42,11 +42,24 @@ describe("pull request commands", () => { ["> @gitdogbot review\n\nquoted only", null], ["```\n@gitdogbot review\n```", null], ])("reads %j as %s", (body, expected) => { + // The production app answers to its former name after the rename. + expect(parseReviewCommand(body, "gitdogai")).toBe(expected); + expect(parseReviewCommand(body, "gitdogbot")).toBe(expected); + }); + it.each([ + ["@gitdogai review", "review"], + ["@gitdogai: full review", "full_review"], + ["@coderabbitai review @gitdogai review", "review"], + ["@gitdogaix review", null], + ])("reads the new app name in %j as %s", (body, expected) => { + expect(parseReviewCommand(body, "gitdogai")).toBe(expected); expect(parseReviewCommand(body, "gitdogbot")).toBe(expected); }); it("uses the configured app slug", () => { // The shorthand belongs to the production app only. expect(parseReviewCommand("@gitdog review", "gitdogbot-dev")).toBeNull(); + expect(parseReviewCommand("@gitdogai review", "gitdogbot-dev")).toBeNull(); + expect(parseReviewCommand("@gitdogbot review", "gitdogbot-dev")).toBeNull(); expect(parseReviewCommand("@gitdogbot-dev review", "gitdogbot-dev")).toBe( "review", ); @@ -62,8 +75,10 @@ describe("pull request commands", () => { expect(commandAccess(undefined, 1, undefined)).toBeNull(); }); it("lists every command with the app mention", () => { - const help = helpText("gitdogbot"); + const help = helpText("gitdogai"); for (const command of ["review", "full review", "resolve", "help"]) - expect(help).toContain(`\`@gitdogbot ${command}\``); + expect(help).toContain(`\`@gitdogai ${command}\``); + expect(help).toContain("`@gitdogbot` and `@gitdog` work too."); + expect(helpText("gitdogbot-dev")).not.toContain("work too"); }); }); diff --git a/test/convex/ticketActions/followUpBotIdentity.test.ts b/test/convex/ticketActions/followUpBotIdentity.test.ts index bc5f430..9ae8eef 100644 --- a/test/convex/ticketActions/followUpBotIdentity.test.ts +++ b/test/convex/ticketActions/followUpBotIdentity.test.ts @@ -17,6 +17,10 @@ describe("follow-up bot identity", () => { expect(isGitdogBot("GitDogBot[bot]", "gitdogbot")).toBe(true); expect(isGitdogBot("gitdogbot-dev[bot]", "gitdogbot")).toBe(false); expect(isGitdogBot("gitdogbot-dev[bot]", "gitdogbot-dev")).toBe(true); + // Only the configured slug is Gitdog's own account. The former name + // could be registered by another app after the rename. + expect(isGitdogBot("gitdogai[bot]", "gitdogai")).toBe(true); + expect(isGitdogBot("gitdogbot[bot]", "gitdogai")).toBe(false); expect(isGitdogBot("gitdogbot[bot]", "gitdogbot-dev")).toBe(false); expect(isGitdogBot("dependabot[bot]", "gitdogbot")).toBe(false); expect(isGitdogBot("github-actions[bot]", "gitdogbot")).toBe(false); @@ -120,6 +124,18 @@ describe("follow-up bot identity", () => { "@gitdog use A", ); expect(hasGitdogMentionBody("@gitdog use A", "gitdogbot")).toBe(false); + // Both production names reach the app, before and after the rename. + expect(hasGitdogMentionBody("@gitdogai use A", "gitdogbot")).toBe(true); + expect(hasGitdogMentionBody("@gitdogbot use A", "gitdogai")).toBe(true); + expect(normalizeGitdogMentionBody("@gitdogbot: use A", "gitdogai")).toBe( + "use A", + ); + expect(hasGitdogMentionBody("@gitdogai use A", "gitdogbot-dev")).toBe( + false, + ); + expect(hasGitdogMentionBody("@gitdogbot-dev use A", "gitdogai")).toBe( + false, + ); expect(hasGitdogMentionBody("@gitdogbot use A", "gitdogbot")).toBe(true); expect(hasGitdogMentionBody("@gitdogbot-dev use A", "gitdogbot")).toBe( false, diff --git a/test/pages/repositoryConnectFlow.test.ts b/test/pages/repositoryConnectFlow.test.ts index 0a6a01d..73d25d1 100644 --- a/test/pages/repositoryConnectFlow.test.ts +++ b/test/pages/repositoryConnectFlow.test.ts @@ -626,7 +626,7 @@ describe("repository connection flow", () => { expect(resolveGitHubAppSlug("custom-gitdog-app", "production")).toBe( "custom-gitdog-app", ); - expect(resolveGitHubAppSlug(undefined, "production")).toBe("gitdogbot"); + expect(resolveGitHubAppSlug(undefined, "production")).toBe("gitdogai"); expect(resolveGitHubAppSlug("", "development")).toBe("gitdogbot-dev"); }); diff --git a/test/workflows/deployConvexPreflight.test.ts b/test/workflows/deployConvexPreflight.test.ts index a276222..8f2f67c 100644 --- a/test/workflows/deployConvexPreflight.test.ts +++ b/test/workflows/deployConvexPreflight.test.ts @@ -112,10 +112,11 @@ describe("Convex production deploy preflight", () => { it("pins production to the production GitHub App identity", () => { expect(workflowSource).toContain( - 'if [ "${production_env[GITHUB_APP_SLUG]}" != "gitdogbot" ]; then', + 'case "${production_env[GITHUB_APP_SLUG]}" in', ); + expect(workflowSource).toContain("gitdogai | gitdogbot) ;;"); expect(workflowSource).toContain( - "GITHUB_APP_SLUG must be exactly gitdogbot in production.", + "GITHUB_APP_SLUG must be gitdogai in production.", ); });