Skip to content

Vns aditya02 patch 1 - #1558

Closed
VNSAditya02 wants to merge 3 commits into
sourcebot-dev:mainfrom
GodHands-Org:VNSAditya02-patch-1
Closed

Vns aditya02 patch 1#1558
VNSAditya02 wants to merge 3 commits into
sourcebot-dev:mainfrom
GodHands-Org:VNSAditya02-patch-1

Conversation

@VNSAditya02

@VNSAditya02 VNSAditya02 commented Aug 9, 2026

Copy link
Copy Markdown

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_SECONDS from 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

    • Gitea permission syncing is now fully supported.
  • Bug Fixes

    • Improved repository synchronization reliability by increasing the delay before retrying failed sync attempts.
    • This helps reduce repeated retry activity during temporary synchronization issues.
  • Documentation

    • Updated the platform support documentation to accurately reflect Gitea permission-syncing support.

godhands-bot and others added 3 commits August 9, 2026 21:10
docs: Correct Gitea permission syncing support from 🛑 to ✅ in platform support table
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR marks Gitea permission syncing as fully supported in the documentation and increases the default repository sync retry interval from 60 to 600 seconds.

Changes

Permission Syncing Support

Layer / File(s) Summary
Gitea support status
docs/docs/features/permission-syncing.mdx
The platform support table marks Gitea permission syncing as fully supported.

Repository Sync Retry Timing

Layer / File(s) Summary
Retry interval default
packages/shared/src/env.server.ts
The default repository sync retry base sleep interval increases from 60 to 600 seconds.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: brendan-kellam

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title identifies the contributor and patch number but does not describe the documentation or retry configuration changes. Replace the title with a concise summary, such as "Mark Gitea permission syncing as supported and increase repository sync retry delay."
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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),

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.

@VNSAditya02 VNSAditya02 closed this Aug 9, 2026

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 66ff430 and fe05e17.

📒 Files selected for processing (2)
  • docs/docs/features/permission-syncing.mdx
  • packages/shared/src/env.server.ts

| 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.


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
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.

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.

1 participant