Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/features/permission-syncing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We are actively working on supporting more code hosts. If you'd like to see a sp
| [Bitbucket Data Center](/docs/features/permission-syncing#bitbucket-data-center) | 🟠 Partial |
| Azure DevOps Cloud | 🛑 |
| Azure DevOps Server | 🛑 |
| Gitea | 🛑 |
| Gitea | |

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Expect: Gitea permission-syncing code, OAuth scope handling, and passing tests.
rg -n -i -C 5 \
  'gitea|permission.?sync|oauth|access.?token|repository.*permission' \
  --glob '!node_modules/**' \
  --glob '!dist/**' \
  --glob '!build/**' \
  .

Repository: sourcebot-dev/sourcebot

Length of output: 50380


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== target doc section =="
sed -n '1,90p' docs/docs/features/permission-syncing.mdx | cat -n

echo
echo "== focused Gitea/permission sync matches (first 200 hits only) =="
rg -n -i -C 4 \
  '\bgitea\b|permissionSync|permission syncing|permission-sync|authorization|repo:' \
  --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' \
  . \
  | head -n 800

echo
echo "== repository permission connector mentions =="
rg -n -i "\b(permission|authorization|permissions|OAuth|OAuth2|OAuth 2|oauth|github|gitlab|bitbucket|azure|gitea)\b" \
  --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' \
  docs packages \
  | head -n 1200

Repository: sourcebot-dev/sourcebot

Length of output: 50382


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docs permissions target =="
sed -n '1,90p' docs/docs/features/permission-syncing.mdx | cat -n

echo
echo "== docs idp Gitea mentions =="
rg -n -C 8 "### Gitea|Gitea" docs/docs/configuration/idp.mdx docs/docs/features/permission-syncing.mdx || true

echo
echo "== Gitea schema files =="
for f in $(fd -a 'gitea\.schema\.ts$|gitea\.ts$|index\.json$' schemas packages shared 2>/dev/null | grep -E 'schemas|packages/shared' | head -n 80); do
  if rg -q -i 'gitea|enforcePermissions|permissionSync' "$f"; then
    echo "-- $f"
    rg -n -C 6 'gitea|enforcePermissions|permissionSync|oauth|scope|repo' "$f" | head -n 240
  fi
done

echo
echo "== focused implementation references by Gitea permission fields =="
rg -n -C 4 'gitea|Gitea|repositoryPermissions|userPermissions|account.*permission|permission.*sync|enforcePermissions' packages --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' | head -n 2000

Repository: sourcebot-dev/sourcebot

Length of output: 50382


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docs idp provider provider enum =="
rg -n -C 6 "### Gitea|provider.*gitea|gitea.*provider|read:organization|read:user|permission syncing" docs/docs/configuration/idp.mdx docs/docs/features/permission-syncing.mdx || true

echo
echo "== shared constants =="
sed -n '1,80p' packages/shared/src/constants.ts | cat -n

echo
echo "== backend permission sync dispatch =="
sed -n '112,180p' packages/backend/src/api.ts | cat -n

echo
echo "== codebase Gitea IDP provider references =="
rg -n '\bgitea\b|\bGitea\b' packages --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' | head -n 250

echo
echo "== repository tests mentioning gitea =="
rg -n -i "gitea" packages --glob '*test*' --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' | head -n 200

Repository: sourcebot-dev/sourcebot

Length of output: 30728


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== docs idp provider enum and provider values =="
sed -n '1,35p' docs/docs/configuration/idp.mdx | cat -n
rg -n 'provider.*?:|provider:"|provider:' docs/docs/configuration/idp.mdx | head -n 80

echo
echo "== identity provider type constant =="
rg -n -C 8 "IdentityProviderType|identityProvider" packages/shared/src/types.ts packages/db/prisma/schema.prisma packages/backend/src | head -n 180

echo
echo "== Gitea repo ACL-related methods =="
cat -n packages/backend/src/gitea.ts | sed -n '1,140p'
rg -n -C 5 "getGitea.*Repo|getGitea.*User|repo|permission|access|org|users|members" packages/backend/src/gitea.ts | head -n 240

Repository: sourcebot-dev/sourcebot

Length of output: 24773


Do not mark Gitea permission syncing as fully supported.

Gitea is supported for connections, but PERMISSION_SYNC_SUPPORTED_IDENTITY_PROVIDERS and PERMISSION_SYNC_SUPPORTED_CODE_HOST_TYPES only include GitHub, GitLab, and Bitbucket. User-driven account permission sync rejects Gitea accounts, and there is no Gitea permission-syncing section or integration test coverage. Keep the table status unsupported or remove this if full end-to-end support is not present.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/docs/features/permission-syncing.mdx` at line 46, Update the Gitea row
in the permission-syncing support table to show it as unsupported, or remove the
row if unsupported providers are omitted. Do not present Gitea as fully
supported while PERMISSION_SYNC_SUPPORTED_IDENTITY_PROVIDERS,
PERMISSION_SYNC_SUPPORTED_CODE_HOST_TYPES, and end-to-end coverage exclude it.

| Gerrit | 🛑 |
| Generic git host | 🛑 |

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ const options = {
REDIS_TLS_KEY_PASSPHRASE: z.string().optional(),

CONNECTION_MANAGER_UPSERT_TIMEOUT_MS: numberSchema.default(300000),
REPO_SYNC_RETRY_BASE_SLEEP_SECONDS: numberSchema.default(60),
REPO_SYNC_RETRY_BASE_SLEEP_SECONDS: numberSchema.default(600),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suspicious retry sleep default change

Low Severity

REPO_SYNC_RETRY_BASE_SLEEP_SECONDS default jumps from 60 to 600 in an unrelated docs PR, with no changelog or rationale. It sits directly above GITLAB_CLIENT_QUERY_TIMEOUT_SECONDS whose default is also 600, and docs/docs/configuration/environment-variables.mdx still documents 60. Nothing in the repo currently reads this env var, so the change looks accidental and creates schema/docs drift.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fe05e17. Configure here.

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Update the documented default.

When REPO_SYNC_RETRY_BASE_SLEEP_SECONDS is unset, this schema uses 600, but docs/docs/configuration/environment-variables.mdx still documents 60. Update the documentation to 600 in the same change. Otherwise, operators may expect one-minute retries while the service uses a ten-minute base retry.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shared/src/env.server.ts` at line 399, Update the documented default
for REPO_SYNC_RETRY_BASE_SLEEP_SECONDS to 600 in the environment variables
documentation, matching the numberSchema.default(600) declaration while leaving
the schema implementation unchanged.


GITLAB_CLIENT_QUERY_TIMEOUT_SECONDS: numberSchema.default(60 * 10),

Expand Down