-
[OPIK-7105] [BE] [FE] refactor: remove Opik V1 workspace-version and project-migration machinery (#7724)
发布于
2026-08-04 14:24:14 +00:00 - [OPIK-7105] [BE] [FE] refactor: remove Opik V1 workspace-version and project-migration machinery
Opik V2 (project-first navigation) is the only supported experience, so the backend
machinery that decided V1-vs-V2 and the project-id migration pipelines are dead weight.
This removes them end-to-end and forces V2 on the client.Backend — version determination:
- Remove GET /v1/private/workspaces/versions, WorkspaceVersionService (+ Abstract/Auth/Unauth
impls), api/OpikVersion, api/WorkspaceVersion, and the AuthModule binding. - Drop opikVersion from the auth chain (RequestContext, RemoteAuthService, CacheService,
AuthCredentialsCacheService). Both surfaces stay backward/forward compatible: the EM
AuthResponse ignores unknown JSON fields, and the Redis auth cache reads/writes only the
surviving hash fields (a stale opikVersion field on old records is ignored and ages out). - Remove serviceToggles.forceWorkspaceVersion and the v1/v2 workspace allowlists, plus the
workspace_version cache group, from config.yml and config-test.yml. No client reads them;
lingering env overrides are ignored. - Remove the now-unused version-determination DAO methods (hasVersion1* and FeedbackScoreDAO's
legacy-scores ClickHouse probe) and the version-only writers upsertVersion / upsertHasLegacyScores.
Keep the has_legacy_scores reader — trace/span stats union gating still uses it (out of scope here). - Drop the now-orphaned WorkspacesService/DAO findById and the Workspace record.
- Liquibase 000093 drops workspaces.last_known_version and version_determined_at;
first_trace_reported_at and has_legacy_scores are kept.
Backend — project-migration pipelines (safe because project-id migration is complete across all
deployments; the jobs were the only code assigning project_id to legacy entities):- Remove all six pipelines (Experiment, Dataset, Optimization, Prompt, AutomationRule, Alert):
services, scheduled jobs, per-entity + shared config, AutomationRuleMigrationDAO, the
migration-only DAO methods/SQL and DTO records, and their tests. Kept: general project_id-null
fallbacks, the stalled-optimization reaper, ProjectService.DEFAULT_PROJECT, and the
dataset-versioning migration.
Frontend (minimal by design — full V1 UI deletion is a separate ticket):
- fetchWorkspaceVersion no longer calls the removed endpoint, and every workspace is pinned to V2 at
both resolution points (resolveSyncWorkspaceVersion and the post-mount WorkspaceVersionResolver).
This fixes the Opik Connect pairing page, which showed a "requires Opik 2.0" error when a workspace
resolved to V1 from stale local state.
Deployment:
- Remove TOGGLE_FORCE_WORKSPACE_VERSION from docker-compose.
Tests:
- Add compatibility coverage: the EM auth response tolerates unknown fields, the Redis cache tolerates
a stale opikVersion field on pre-upgrade records, and a frontend test asserts the version is forced to v2.
Out of scope (unchanged): the V1 frontend structure, SDK/OpenAPI/docs regeneration, and E2E seeding cleanup.
- test(auth): address Baz review on the opikVersion compatibility tests
- Remove ProjectsResourceTest#getProjects__whenHasLegacyScoresGateOn__thenStatsStayConsistent:
it was the neutered remnant of the removed has_legacy_scores flip test and could not
exercise the legacy UNION, so it would pass even if the gate/UNION reader broke. That path
is covered by the baseline getProjects__whenLegacyScoresHasData__thenStatsIncludeThem (same
class) and by MultiValueFeedbackScoresE2ETest#{testTraceStats,testSpanStats}_legacyFeedbackScoresSurfacedWhenPresent,
which seed the legacy feedback_scores table via scoreEntity(author=null) and assert the stats UNION. - AuthCredentialsCacheServiceTest: shut down the Redisson client in @AfterAll via the owning
RedissonClient#shutdown() (RedissonReactiveClient#shutdown() is deprecated); the reactive
client is just a view over it.
- chore(review): address JetoPistola review — doc/comment fixes + drop dead CI flag
- WorkspacesDAO.findHasLegacyScores: trim the Javadoc claim about an admin/backfill
FALSE-flip flow. That flow was removed with version determination; the column now
stays at its TRUE default (always-UNION) until the legacy feedback_scores table is
decommissioned by the ClickHouse revamp. - workspaceVersion.test.ts: reframe the comment as an honest regression guard — the
cases assert resolveSyncWorkspaceVersion ignores legacy local state and would fail
only if the localStorage read were re-introduced. - E2E workflows: drop the now-dead TOGGLE_FORCE_WORKSPACE_VERSION export from
end2end_suites_v2.yml and e2e_tests_post_merge_v2.yml (the flag no longer exists).
Deferred to the V1-UI-removal follow-up (per review, non-blocking): the unreachable
reload machinery in WorkspaceVersionResolver/PairRouteVersionGuard and the dead
override/opt-in helpers + UserMenu 'New Experience' toggle.
下载附件