coder / coder/vscode-coder

Split remote.ts by topic, starting with migrations

Offen
#1,066 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Improvement tech-debt vs-code
Vorherrschende Sprache
TypeScript
Sterne
130
Forks
48
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
15

Beschreibung

\`src/remote/remote.ts\` is 1,207 lines and mixes every concern of remote setup in one class. Recent work (per-editor SSH configs, legacy authority migration) keeps growing it.

## Topics currently mixed into the class

- Setup orchestration: \`setup\`, \`setupCoderRemote\`
- Migrations: \`migrateLegacyAuthority\` (authority), \`migrateToSecretsStorage\`, \`migrateSessionTokenFile\`, \`migrateSessionAuthFromFiles\` (credentials)
- SSH config assembly: \`updateSSHConfig\`, \`writeRemoteSshConfig\`, \`buildProxyCommand\`, \`getSshConfigPath\`, \`getLogArgs\`, \`getLogDir\`
- Workspace lifecycle: \`lookupWorkspace\`, \`waitForWorkspaceReady\`, \`resolveAgent\`
- Auth/session: \`ensureLoggedInAndRetry\`, \`showSessionExpiredDialog\`, \`watchRemoteSessionAuth\`
- Binary management: \`resolveRemoteBinary\`, \`checkCompatibility\`
- Window/UI glue: \`createAgentMetadataStatusBar\`, \`watchSettings\`, \`registerLabelFormatter\`, \`closeRemote\`, \`reloadWindow\`

## Proposal

1. Extract migrations first, e.g. into \`src/remote/migrations.ts\`. They are self-contained, interact little with the rest of setup, and each has a deletion horizon; keeping them together makes them easy to find and eventually remove.
2. If that lands well, extract SSH config assembly next. It is the most test-heavy area and only needs the path resolver, settings, and logger.
3. Keep orchestration (\`setup\`/\`setupCoderRemote\`) in \`remote.ts\`.

Non-goals: no behavior changes and no new abstractions; move plain methods by topic and keep the telemetry span threading as is.

Filed by Claude Code for @EhabY.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie in src/remote/remote.ts, indem Sie migrateLegacyAuthority, migrateToSecretsStorage, migrateSessionTokenFile und migrateSessionAuthFromFiles sowie deren Aufrufer in setup und setupCoderRemote lesen. Extrahieren Sie diese einfachen Methoden nach src/remote/migrations.ts, wobei Sie das Verhalten, die Löschzeitpunkte und die Weitergabe der Telemetrie-Spans beibehalten; der Migrationsablauf sollte weiterhin unverändert funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
devtools
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.