Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Mirroring Configuration to Individual Repositories #1086

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

minwoox
Copy link
Contributor

@minwoox minwoox commented Jan 3, 2025

Motivation:
Mirroring configurations should belong to the repository where the mirroring is executed to ensure proper ownership and management alignment.

Modifications:

  • Implemented migration job that relocated mirroring configurations to their respective repositories.
    • Updated Mirroring REST API to reflect these changes.
  • Updated credential IDs in mirroring configurations to use a full resource ID format:
    • Example for a project credential: projects/foo/credentials/foo-credential.
    • Example for a repository credential: projects/foo/repos/bar/credentials/bar-credential.
  • Adjusted role requirements for credential management:
    • Project OWNER: Can create, update, and delete credentials.
    • Project MEMBER: Can read credentials.
    • Removed dependency on Meta repository access roles.

Result:

  • Mirroring configurations are now repository-specific.
  • Dependency on Meta repository access roles has been eliminated.

@minwoox
Copy link
Contributor Author

minwoox commented Jan 7, 2025

Will continue after #1085 is merged. 😉

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 78.86905% with 71 lines in your changes missing coverage. Please review.

Project coverage is 70.37%. Comparing base (f4dda40) to head (a8188b2).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...nal/mirror/MigratingMirrorToRepositoryService.java 72.94% 17 Missing and 6 partials ⚠️
...rp/centraldogma/internal/api/v1/MirrorRequest.java 61.90% 15 Missing and 1 partial ⚠️
...traldogma/server/internal/mirror/MirrorRunner.java 68.75% 8 Missing and 2 partials ⚠️
...rnal/storage/repository/DefaultMetaRepository.java 90.58% 6 Missing and 2 partials ⚠️
...rver/internal/storage/repository/MirrorConfig.java 77.14% 3 Missing and 5 partials ⚠️
...ldogma/server/internal/api/MirroringServiceV1.java 87.50% 2 Missing and 1 partial ⚠️
...erver/internal/mirror/MirrorSchedulingService.java 57.14% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1086      +/-   ##
============================================
+ Coverage     70.29%   70.37%   +0.08%     
- Complexity     4284     4443     +159     
============================================
  Files           427      442      +15     
  Lines         17258    17882     +624     
  Branches       1915     1974      +59     
============================================
+ Hits          12131    12585     +454     
- Misses         4077     4240     +163     
- Partials       1050     1057       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@minwoox minwoox changed the title Move Mirror Config to Each Repository Move Mirroring Configuration to Individual Repositories Jan 17, 2025
@minwoox minwoox added this to the 0.74.0 milestone Jan 17, 2025
Comment on lines +80 to +87
commandExecutor.execute(Command.updateServerStatus(ServerStatus.REPLICATION_ONLY))
.get(1, TimeUnit.MINUTES);
logger.info("Starting Mirrors migration ...");
if (commandExecutor instanceof ZooKeeperCommandExecutor) {
logger.debug("Waiting for 10 seconds to make sure that all cluster have been notified of the " +
"read-only mode ...");
Thread.sleep(10000);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer migrating without entering read-only mode because

  • It's not critical if mirroring is temporarily unavailable for a minute.
  • Any issues can be promptly addressed if they arise.

If this is acceptable, I will remove these lines of code. Please let me know your opinion.

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

Successfully merging this pull request may close these issues.

1 participant