docs(git-sync): document GIT_SYNC_BACKEND_TIMEOUT_MS, drop dead consts, fix dangling plan refs
Address the non-red-team documentation/cleanup items from review #1679: - Document the GIT_SYNC_BACKEND_TIMEOUT_MS watchdog (git http-backend) in .env.example and add it to the environment validation schema — it was used (getGitSyncBackendTimeoutMs, default 120000) but undocumented/unvalidated. - Remove the dead GIT_SYNC_DEBOUNCE_MS_DEFAULT / GIT_SYNC_POLL_INTERVAL_MS_DEFAULT exports (never imported; environment.service is the single source of defaults). - Redirect the dangling `plan §X.Y` comment references to issue #194 (the git-sync spec moved there when docs/git-sync-plan.md was deleted by this PR). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -333,7 +333,7 @@ export class EnvironmentService {
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
// --- git-sync (plan §7.2) -------------------------------------------------
|
||||
// --- git-sync (issue #194 §7.2) -------------------------------------------------
|
||||
|
||||
/** Global master switch for the git-sync control plane (default false). */
|
||||
isGitSyncEnabled(): boolean {
|
||||
|
||||
@@ -171,7 +171,7 @@ export class EnvironmentVariables {
|
||||
)
|
||||
CLICKHOUSE_URL: string;
|
||||
|
||||
// --- git-sync (plan §7.2) — all OPTIONAL. The master switch defaults off; a
|
||||
// --- git-sync (issue #194 §7.2) — all OPTIONAL. The master switch defaults off; a
|
||||
// required-if-enabled service user id is validated only when sync is on. ---
|
||||
|
||||
@IsOptional()
|
||||
@@ -202,6 +202,13 @@ export class EnvironmentVariables {
|
||||
@IsString()
|
||||
GIT_SYNC_DEBOUNCE_MS: string;
|
||||
|
||||
// Watchdog timeout (ms) for the spawned `git http-backend` process (default
|
||||
// 120000): a stalled receive-pack is killed so it cannot hold the per-space
|
||||
// lock forever. Optional int (validated as a string env).
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
GIT_SYNC_BACKEND_TIMEOUT_MS: string;
|
||||
|
||||
// Defense-in-depth absolute cap on soft-deletes per push cycle (default 5): a
|
||||
// non-convergent / phantom-absence cycle can never trash more than this many
|
||||
// pages without an explicit override. Optional int (validated as a string env).
|
||||
@@ -210,7 +217,7 @@ export class EnvironmentVariables {
|
||||
GIT_SYNC_MAX_DELETES_PER_CYCLE: string;
|
||||
|
||||
// Required when git-sync is enabled: the service user create/move/rename/delete
|
||||
// are attributed to (plan §7.2). Optional otherwise.
|
||||
// are attributed to (issue #194 §7.2). Optional otherwise.
|
||||
@ValidateIf((obj) => obj.GIT_SYNC_ENABLED === 'true')
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
|
||||
@@ -39,9 +39,3 @@ export const GIT_SYNC_LOCK_PREFIX = 'git-sync:lock:';
|
||||
* and the Redis lock prevents two instances racing the same space.
|
||||
*/
|
||||
export const GIT_SYNC_LOCK_TTL_MS = 5 * 60 * 1000;
|
||||
|
||||
/** Default event-debounce window (ms), overridable via GIT_SYNC_DEBOUNCE_MS. */
|
||||
export const GIT_SYNC_DEBOUNCE_MS_DEFAULT = 2000;
|
||||
|
||||
/** Default poll-safety interval (ms), overridable via GIT_SYNC_POLL_INTERVAL_MS. */
|
||||
export const GIT_SYNC_POLL_INTERVAL_MS_DEFAULT = 15000;
|
||||
|
||||
@@ -423,7 +423,7 @@ export class GitmostDataSourceService {
|
||||
actor: 'git-sync',
|
||||
// PersistenceExtension reads `context.user.id` for lastUpdatedById, so the
|
||||
// service user is required on the context (unlike the bare `{ actor }`
|
||||
// sketch in the plan).
|
||||
// sketch in issue #194).
|
||||
user: { id: userId },
|
||||
});
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user