Skip to content

Conversation

@minwoox
Copy link
Contributor

@minwoox minwoox commented Nov 14, 2025

Motivation:
Following the successful migration of the meta repository's contents to the dogma repository in issue #1128, a backward-compatibility layer was temporarily kept in place. This logic allowed the system to use the old meta repository if the migration was not yet complete. Now that the migration has been finalized across all environments, this compatibility code is no longer necessary. This commit removes the obsolete code to simplify the codebase and rely exclusively on the dogma repository.

Modifications:

  • Removed the conditional logic that checked the migration status to decide between using the meta or dogma repository.
    • However, it's still prohibited to create or use the meta repository.

Result:

  • The codebase is now simpler and easier to maintain.

Summary by CodeRabbit

Release Notes

  • Deprecations

    • Meta repository is now deprecated and no longer supported
  • Changes

    • Projects now exclusively use the dogma repository format
    • Removed meta-to-dogma repository migration functionality
    • Removed meta repository reset operations

Motivation:
Following the successful migration of the `meta` repository's contents to the `dogma` repository in issue line#1128,
a backward-compatibility layer was temporarily kept in place. This logic allowed the system to use the old `meta` repository if the migration was not yet complete.
Now that the migration has been finalized across all environments, this compatibility code is no longer necessary.
This commit removes the obsolete code to simplify the codebase and rely exclusively on the `dogma` repository.

Modifications:
- Removed the conditional logic that checked the migration status to decide between using the `meta` or `dogma` repository.
  - However, it's still prohibited to create or use the `meta` repository.

Result:
- The codebase is now simpler and easier to maintain.
@minwoox minwoox added this to the 0.78.0 milestone Nov 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

This pull request removes the meta-to-dogma repository migration infrastructure, including the migration service, plugin, and related commands. It updates tests to use REPO_DOGMA instead of REPO_META and simplifies the project initialization logic by eliminating meta repository handling.

Changes

Cohort / File(s) Summary
Migration infrastructure removal
server/src/main/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryService.java, server/src/main/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryServicePlugin.java, server/src/test/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryServiceTest.java, server/src/test/java/com/linecorp/centraldogma/server/internal/api/MigrateToEncryptedRepositoryTest.java
Deleted entire migration service and plugin classes that orchestrated meta-to-dogma migration, removed associated test coverage.
Command infrastructure updates
server/src/main/java/com/linecorp/centraldogma/server/command/Command.java, server/src/main/java/com/linecorp/centraldogma/server/command/StandaloneCommandExecutor.java
Removed ResetMetaRepositoryCommand type mapping and handler execution logic.
Project and repository initialization refactoring
server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProject.java, server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProjectManager.java
Removed dogmaProject parameter from DefaultProject constructor, eliminated meta repository setup and migration logic, simplified reserved repository creation.
Public API updates
server/src/main/java/com/linecorp/centraldogma/server/storage/project/Project.java
Deprecated REPO_META constant with Javadoc and @Deprecated annotation, removed resetMetaRepository() method.
Service provider configuration
server/src/main/resources/META-INF/services/com.linecorp.centraldogma.server.plugin.Plugin
Removed MigratingMetaToDogmaRepositoryServicePlugin from SPI registry.
Test updates: REPO_META → REPO_DOGMA
it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/ForceRefUpdateTest.java, it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/GitMirrorAuthTest.java, it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/GitMirrorIntegrationTest.java, it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/LocalToRemoteGitMirrorTest.java, it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/ZoneAwareMirrorTest.java, client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaTest.java
Updated test code to target REPO_DOGMA instead of REPO_META in mirror and client test scenarios.
Repository/API test updates
it/server/src/test/java/com/linecorp/centraldogma/it/RepositoryManagementTest.java, server/src/test/java/com/linecorp/centraldogma/server/internal/api/RepositoryServiceV1Test.java, server/src/test/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1Test.java
Updated repository assertions and test methods to remove META references, renamed methods from meta to dogma targeting, and adjusted expected repository lists.
XDS configuration updates
xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java
Updated expected error message to reference @xds/dogma instead of @xds/meta.
Project test simplification
server/src/test/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProjectTest.java
Removed tests exercising meta repository migration behavior and related setup.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Areas requiring extra attention:

  • DefaultProject constructor signature change: Removal of dogmaProject parameter and simplification of metadata initialization logic—verify all call sites have been updated correctly
  • DefaultProjectManager integration: Changes to how DefaultProject is instantiated and the removal of InternalProjectInitializer lookup
  • Public API removal: resetMetaRepository() method deletion and REPO_META deprecation may affect external consumers
  • Migration service removal: Ensure cleanup of migration state and command handling doesn't leave orphaned processes or state
  • Test scope reduction: Verify that removal of MigratingMetaToDogmaRepositoryServiceTest and MigrateToEncryptedRepositoryTest doesn't leave untested migration edge cases

Possibly related PRs

Suggested labels

breaking change

Suggested reviewers

  • trustin
  • jrhee17

Poem

🐰 Hop-skip through the code, migration vines are shed,
DOGMA repos bloom where META once was spread,
Constructor calls grow lean, the pathway simplified,
One repository now—the meta magic has died! 🌱✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.35% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove backward compatibility code for meta repository migration' is specific, clear, and directly reflects the main change: removal of migration-related backward compatibility code across the codebase.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (6)
xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java (1)

158-167: Clarify or update the backward compatibility comment.

The comment states "This is needed for the backward compatibility test," but given that this PR removes the meta→dogma migration backward compatibility layer, this phrasing may be misleading. If this comment refers to supporting both project-level and repo-level credentials (which the parameterized tests verify), consider updating it to clarify what backward compatibility is being maintained here.

client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaTest.java (1)

45-70: Rename test methods to reflect the dogma repository.

Both test method names still reference "MetaRepository," but after the migration, they now test Project.REPO_DOGMA. This creates confusion for future developers who might misunderstand what repository these tests are validating.

Apply this diff to rename the test methods:

-    void pushFileToMetaRepositoryShouldFail() throws UnknownHostException {
+    void pushFileToDogmaRepositoryShouldFail() throws UnknownHostException {
         final CentralDogma client = new ArmeriaCentralDogmaBuilder()
                 .host(dogma.serverAddress().getHostString(), dogma.serverAddress().getPort())
                 .build();

         assertThatThrownBy(() -> client.forRepo("foo", Project.REPO_DOGMA)
                                        .commit("summary", Change.ofJsonUpsert("/bar.json", "{ \"a\": \"b\" }"))
                                        .push()
                                        .join())
                 .isInstanceOf(CompletionException.class)
                 .hasCauseInstanceOf(InvalidPushException.class);
     }

-    void pushMirrorsJsonFileToMetaRepository() throws UnknownHostException {
+    void pushMirrorsJsonFileToDogmaRepository() throws UnknownHostException {
         final CentralDogma client = new ArmeriaCentralDogmaBuilder()
                 .host(dogma.serverAddress().getHostString(), dogma.serverAddress().getPort())
                 .build();

         final PushResult result = client.forRepo("foo", Project.REPO_DOGMA)
                                         .commit("summary",
                                                 Change.ofJsonUpsert("/repos/foo/mirrors/foo.json", "{}"))
                                         .push()
                                         .join();
         assertThat(result.revision().major()).isPositive();
     }
server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProject.java (4)

108-118: Open-existing path now consistently derives state from dogma metadata

For non-internal projects, deriving creationTimeMillis and author from metadata().creation() in REPO_DOGMA and wiring metaRepo to DefaultMetaRepository(repos.get(REPO_DOGMA)) makes the dogma repo the single source of truth and removes the old meta-repo dependency. The INTERNAL_PROJECT_DOGMA branch remains isolated and avoids attaching a metadata listener or metaRepo, which is appropriate.

If you expect any projects without metadata.json after migration, consider a more user-friendly failure (e.g., a specific exception) instead of a generic CentralDogmaException from initialMetadata().


176-180: Reserved repo creation is minimal and race-safe

createReservedRepos now creates REPO_DOGMA on demand with Author.SYSTEM and honors the encryptDogmaRepo flag, swallowing RepositoryExistsException for races. This is a straightforward replacement for any prior meta/dogma combo and looks correct.

You might want to log when the dogma repo is auto-created to aid debugging startup/bootstrapping issues.


236-246: initialMetadata assumes per-project dogma metadata is present

initialMetadata() now asserts the project is not INTERNAL_PROJECT_DOGMA and reads METADATA_JSON from the project’s own REPO_DOGMA, updating lastMetadataRevision and projectMetadata. This matches the new design where all metadata resides in dogma rather than a separate meta repo, and it ensures the listener has an initial revision to compare against.

If there’s any chance METADATA_JSON is missing (e.g., partially migrated instances), consider handling that with a clearer exception or on-the-fly initialization rather than relying on get() to fail.


253-278: Metadata listener invariants are clear and dogma-only

The listener now explicitly asserts the project is not the internal dogma project and watches METADATA_JSON in REPO_DOGMA, updating lastMetadataRevision and projectMetadata only when a newer revision arrives. Combined with the constructors setting lastMetadataRevision before registering the listener, the assert lastMetadataRevision != null is safe and keeps state consistent.

Given Java assertions are often disabled in production, consider converting the assert lastMetadataRevision != null to a runtime check with a clear error message to avoid a potential NullPointerException if invariants are broken by future changes.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 74e8f1c and 6631ce9.

📒 Files selected for processing (21)
  • client/java-armeria/src/test/java/com/linecorp/centraldogma/client/armeria/ArmeriaCentralDogmaTest.java (2 hunks)
  • it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/ForceRefUpdateTest.java (3 hunks)
  • it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/GitMirrorAuthTest.java (1 hunks)
  • it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/GitMirrorIntegrationTest.java (2 hunks)
  • it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/LocalToRemoteGitMirrorTest.java (2 hunks)
  • it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/ZoneAwareMirrorTest.java (1 hunks)
  • it/server/src/test/java/com/linecorp/centraldogma/it/RepositoryManagementTest.java (1 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/command/Command.java (0 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/command/StandaloneCommandExecutor.java (0 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryService.java (0 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryServicePlugin.java (0 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProject.java (6 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProjectManager.java (1 hunks)
  • server/src/main/java/com/linecorp/centraldogma/server/storage/project/Project.java (1 hunks)
  • server/src/main/resources/META-INF/services/com.linecorp.centraldogma.server.plugin.Plugin (0 hunks)
  • server/src/test/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1Test.java (2 hunks)
  • server/src/test/java/com/linecorp/centraldogma/server/internal/api/MigrateToEncryptedRepositoryTest.java (0 hunks)
  • server/src/test/java/com/linecorp/centraldogma/server/internal/api/RepositoryServiceV1Test.java (3 hunks)
  • server/src/test/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryServiceTest.java (0 hunks)
  • server/src/test/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProjectTest.java (1 hunks)
  • xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java (1 hunks)
💤 Files with no reviewable changes (7)
  • server/src/test/java/com/linecorp/centraldogma/server/internal/api/MigrateToEncryptedRepositoryTest.java
  • server/src/test/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryServiceTest.java
  • server/src/main/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryService.java
  • server/src/main/java/com/linecorp/centraldogma/server/command/Command.java
  • server/src/main/resources/META-INF/services/com.linecorp.centraldogma.server.plugin.Plugin
  • server/src/main/java/com/linecorp/centraldogma/server/command/StandaloneCommandExecutor.java
  • server/src/main/java/com/linecorp/centraldogma/server/internal/storage/MigratingMetaToDogmaRepositoryServicePlugin.java
🧰 Additional context used
🧬 Code graph analysis (2)
server/src/main/java/com/linecorp/centraldogma/server/storage/project/Project.java (1)
server/src/main/java/com/linecorp/centraldogma/server/command/ResetMetaRepositoryCommand.java (1)
  • Deprecated (31-64)
server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProject.java (1)
common/src/main/java/com/linecorp/centraldogma/common/Author.java (1)
  • Author (32-135)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: build-ubuntu-latest-jdk-17-min-java-11
  • GitHub Check: build-windows-latest-jdk-21
  • GitHub Check: build-ubuntu-latest-jdk-11
  • GitHub Check: build-ubuntu-latest-jdk-21-snapshot
  • GitHub Check: build-ubuntu-latest-jdk-17-coverage
  • GitHub Check: build-macos-latest-jdk-21
  • GitHub Check: lint
  • GitHub Check: docker-build
  • GitHub Check: flaky-tests
🔇 Additional comments (15)
it/server/src/test/java/com/linecorp/centraldogma/it/RepositoryManagementTest.java (1)

114-114: LGTM! Correctly reflects the completed meta → dogma migration.

The removal of Project.REPO_META from the expected repository set correctly reflects the completion of the meta repository migration. The assertion now properly validates that only the REPO_DOGMA system repository exists alongside the test repositories, which aligns with the PR objectives.

xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java (1)

199-206: LGTM! Error message correctly references dogma repository.

The test assertion has been appropriately updated to expect credential lookups in @xds/dogma instead of @xds/meta, consistent with the completed migration.

server/src/main/java/com/linecorp/centraldogma/server/storage/project/Project.java (1)

50-51: LGTM - Proper deprecation strategy.

The approach of deprecating REPO_META while keeping the constant is correct, as it prevents users from creating new repositories with the reserved name "meta".

it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/GitMirrorAuthTest.java (1)

111-111: LGTM - Consistent repository migration.

The change from REPO_META to REPO_DOGMA correctly aligns with the meta→dogma migration.

it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/ZoneAwareMirrorTest.java (1)

174-174: LGTM - Consistent repository migration.

The change from REPO_META to REPO_DOGMA correctly aligns with the meta→dogma migration.

it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/LocalToRemoteGitMirrorTest.java (1)

370-385: LGTM - Consistent repository migration.

Both forRepo() calls in pushMirrorSettings() correctly changed from REPO_META to REPO_DOGMA, maintaining consistency across credential and mirror configuration commits.

it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/ForceRefUpdateTest.java (1)

109-220: LGTM - Consistent repository migration.

All three forRepo() calls correctly changed from REPO_META to REPO_DOGMA across cleanup, credential setup, and mirror configuration methods.

server/src/test/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProjectTest.java (1)

40-49: LGTM - Appropriate migration verification.

The test correctly verifies that only the dogma repository is created and that metaRepo() now returns the dogma repository, confirming the meta→dogma consolidation.

server/src/test/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1Test.java (1)

138-158: LGTM - Consistent test migration.

The test correctly updated from verifying that the meta repository cannot be pushed to, to verifying that the dogma repository (now the internal repository) cannot be pushed to. Both the method name and endpoint are consistently updated.

it/mirror/src/test/java/com/linecorp/centraldogma/it/mirror/git/GitMirrorIntegrationTest.java (1)

488-519: LGTM - Consistent repository migration.

Both forRepo() calls in pushMirrorSettings() correctly changed from REPO_META to REPO_DOGMA, maintaining consistency across credential and mirror configuration commits.

server/src/test/java/com/linecorp/centraldogma/server/internal/api/RepositoryServiceV1Test.java (3)

241-245: Test now correctly asserts dogma repository is non-removable

Switching the deletion test from REPO_META to Project.REPO_DOGMA matches the new rule that dogma is the reserved internal repo and must not be deleted; the 403 assertion remains appropriate and keeps the contract explicit.


298-310: Internal repository status test correctly targets dogma

Updating updateInternalRepositoryStatus to toggle RepositoryStatus on Project.REPO_DOGMA aligns with metadata now living in dogma. The flow—set READ_ONLY, assert credential creation fails with 503, then restore ACTIVE and assert credentials can be created—is still valid and exercises the right internal repo.


417-419: Adjusted remaining-repositories assertion is consistent with removed meta repo

The updated comment and assertThat(jsonNode).hasSize(2) correctly reflect that only dogma and trustin remain after removing the two user repos. This matches the new world where meta is gone and avoids overspecifying exact repository names in the assertion.

server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProjectManager.java (1)

83-87: Constructor call matches new DefaultProject signature

The updated createChild now passes arguments in the correct order for the simplified DefaultProject constructor (rootDir, repositoryWorker, purgeWorker, creationTimeMillis, author, cache, encryptionStorageManager, encrypt). This removes the dependency on an internal dogma project initializer cleanly without changing behavior.

server/src/main/java/com/linecorp/centraldogma/server/internal/storage/project/DefaultProject.java (1)

133-157: New-project constructor correctly bootstraps dogma and metadata

The create-new-project path now:

  • Ensures REPO_DOGMA exists via createReservedRepos.
  • For non-internal projects, initializes metadata in REPO_DOGMA, attaches a listener, and wraps that repo in DefaultMetaRepository.
  • Then assigns the ctor’s creationTimeMillis and author directly.

This keeps internal-project handling separate while guaranteeing that non-internal projects have a usable metaRepo tied to dogma from the outset.

Comment on lines +45 to +48
* The meta repository was used to store metadata, but it's no longer used anymore.
* We still keep this constant to prevent creating a repository with this name.
*
* @deprecated meta repository is not used anymore.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix grammatical error in Javadoc.

The phrase "no longer used anymore" is redundant.

Apply this diff to fix the grammar:

-     * The meta repository was used to store metadata, but it's no longer used anymore.
+     * The meta repository was used to store metadata, but it is no longer used.
      * We still keep this constant to prevent creating a repository with this name.
      *
      * @deprecated meta repository is not used anymore.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* The meta repository was used to store metadata, but it's no longer used anymore.
* We still keep this constant to prevent creating a repository with this name.
*
* @deprecated meta repository is not used anymore.
* The meta repository was used to store metadata, but it is no longer used.
* We still keep this constant to prevent creating a repository with this name.
*
* @deprecated meta repository is not used anymore.
🤖 Prompt for AI Agents
In
server/src/main/java/com/linecorp/centraldogma/server/storage/project/Project.java
around lines 45 to 48, the Javadoc contains the redundant phrase "no longer used
anymore"; edit the comment to remove redundancy by changing the sentence to
something like "The meta repository was used to store metadata, but it is no
longer used." and update the @deprecated line to read "@deprecated The meta
repository is no longer used." so the wording is concise and grammatically
correct.

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

👍👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants