Skip to content

feat(git): add description to linked repositories - #658

Merged
pikann merged 5 commits into
Paca-AI:masterfrom
gorlix:feat/git-repository-description
Oct 29, 2026
Merged

pikann merged 5 commits into
Paca-AI:masterfrom
gorlix:feat/git-repository-description

Conversation

@gorlix

@gorlix gorlix commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What

Adds an optional description to linked Git repositories, so an agent in a project with several repos can tell which one(s) to work in. Today that context lives only in the project Docs.

How

  • Migration 000076: ALTER TABLE git_repositories ADD COLUMN IF NOT EXISTS description TEXT NOT NULL DEFAULT ''. 000073 is untouched; since v0.20 is not released yet, this could be folded into 000073 if you prefer.
  • API: optional description on link; new PATCH /projects/{id}/git/repositories/{repositoryId} (git:write); description in the repository response. It is trimmed and capped at 1000 characters; over the cap returns 400 GIT_DESCRIPTION_TOO_LONG, mapped in presenter/response.go and apps/web/src/lib/api-error.ts.
  • Agents: the description appears in the repo bullet of the agent prompt, inside an UNTRUSTED fence using the existing fenceText/neutralize. MCP list_repositories returns it (collapsed to one line) and its tool description says to use it to pick the right repo.
  • Web: textarea in the link form, inline edit on each repo row (read-only without git:write), strings in all 9 locales. Long unbroken descriptions wrap instead of overflowing the row.
  • Docs: docs/ai-agent/git-agent-workflow.md.

Tests / checks

  • services/api: go vet ./... and go test ./... pass; store tests, including migration 000076, also run against a throwaway Postgres 16.
  • apps/web: tsc -b clean, biome check no errors, vitest 1353/1354 on the first full run. The one failure was a timeout in ProjectRoleFormDialog.test.tsx under load; it passes on its own (34/34).
  • apps/mcp: build OK, vitest 31 files / 732 tests. biome check src reports 3 errors in workspace.test.ts, ask-tools.test.ts and converters.ts; they also occur without this change.
  • Manual: on a local stack with a real GitLab CE and the GitLab plugin, a repo was linked with a description, edited inline in the UI, shown in French, and returned by the MCP list_repositories. The 1000-character boundary was checked through the API (1000 saved, 1001 gives 400).
  • Not run: Playwright e2e (apps/e2e).

Notes

  • The fence header still says "written on the Git platform", which is slightly off for text written by project members; I left fenceText unchanged.
  • A description typed in the link form is not restored after the "install the app on the owner" redirect, because the pending storage keeps only the repo input and provider.
  • No PATCH-specific router gate test; the generic git:write gate test covers it, as for DELETE.

Refs #649

🤖 Generated with Claude Code

gorlix and others added 5 commits October 28, 2026 13:42
Adds a free-text description (max 1000 chars) set when linking a
repository and editable via PATCH /projects/{id}/git/repositories/{repositoryId}
(git:write). It is shown to agents as fenced untrusted text so they can
pick the right repository.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The description helps an agent choose the right repository.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Optional description when linking a repository, inline editing on each
repository row, and strings for all locales.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An unbroken description (no spaces) overflowed the repository row and
caused horizontal scrolling in Git settings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gorlix

gorlix commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Please note: all the translations were done by Claude and need to be checked.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This adds an optional, member-written description to linked Git repositories and surfaces it to people (web settings) and agents (prompt + MCP). I read the full diff plus the surrounding store/service/prompt/router/web code.

  • Migration 000076 — adds description TEXT NOT NULL DEFAULT '' to git_repositories; ADD COLUMN IF NOT EXISTS, and the number is the next free one after 000075.
  • Domain/store — Repository.Description; SetRepositoryDescription scoped by project_id (returns ErrNotFound for another project's repo); column list, insert and record mapping updated in lockstep.
  • Service — normalizeDescription trims and caps at MaxDescriptionRunes (1000, rune-counted) → ErrDescriptionTooLong; enforced on both link and the new UpdateRepository.
  • HTTP — optional description on link; new PATCH /projects/{id}/git/repositories/{repoId} behind git:write; GIT_DESCRIPTION_TOO_LONG mapped to 400 in the presenter and to a UI string in SETUP_ERROR_KEYS.
  • Agents — the description rides in the event prompt only when non-empty, inside one fenceText/neutralize UNTRUSTED fence; MCP list_repositories appends it collapsed to one line, with the tool description framing it as information, never instructions.
  • Web — link-form textarea plus an inline per-row editor (canWrite-gated), wrapping for long unbroken text, and strings in all 9 locales.
  • Docs/tests — git-agent-workflow.md, ALL_TOOLS.md, and Go/MCP/Web tests updated.

The untrusted-text handling matches the repo's existing convention, and the interface additions (Store, handler GitService) were carried through to the test fakes. The two limitations the author called out (description not restored across the install redirect; the shared fenceText header wording) are accurate and I agree they are not blockers.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit f496205 into Paca-AI:master Oct 29, 2026
8 checks passed
gorlix added a commit to gorlix/paca that referenced this pull request Oct 29, 2026
Resolve conflicts with the repository description (Paca-AI#658) and the
task-ref parser fix (Paca-AI#657): both sides added to the same places.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants