Vns aditya02 patch 1 - #1558
Conversation
…m support table Finding: 4cc1b8de5ce8368e
docs: Correct Gitea permission syncing support from 🛑 to ✅ in platform support table
WalkthroughThe PR marks Gitea permission syncing as fully supported in the documentation and increases the default repository sync retry interval from 60 to 600 seconds. ChangesPermission Syncing Support
Repository Sync Retry Timing
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fe05e17. Configure here.
|
|
||
| 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), |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit fe05e17. Configure here.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with 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.
Inline comments:
In `@docs/docs/features/permission-syncing.mdx`:
- 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.
In `@packages/shared/src/env.server.ts`:
- 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.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 19286060-8545-4a63-bd47-3f15541a09d8
📒 Files selected for processing (2)
docs/docs/features/permission-syncing.mdxpackages/shared/src/env.server.ts
| | Azure DevOps Cloud | 🛑 | | ||
| | Azure DevOps Server | 🛑 | | ||
| | Gitea | 🛑 | | ||
| | Gitea | ✅ | |
There was a problem hiding this comment.
🎯 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 1200Repository: 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 2000Repository: 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 200Repository: 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 240Repository: 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.
|
|
||
| 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), |
There was a problem hiding this comment.
🗄️ 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.


Note
Low Risk
Documentation and a default env value change only; longer default retry spacing may slow recovery from transient sync failures for deployments that relied on the old 60s default.
Overview
Updates the permission syncing platform table so Gitea is listed as fully supported (✅) instead of not supported (🛑).
Raises the default for
REPO_SYNC_RETRY_BASE_SLEEP_SECONDSfrom 60 to 600 seconds in server env validation, so failed repository sync retries use a longer base delay for exponential backoff when the variable is unset.Reviewed by Cursor Bugbot for commit fe05e17. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation