refactor(domain): extract GetMBCUIDFromCronJobName from controller#295
Merged
Conversation
e37981a to
cee9268
Compare
There was a problem hiding this comment.
Pull request overview
Refactors MantleBackupConfig controller wiring by moving CronJob-name → MantleBackupConfig UID parsing into the domain layer, making the mapping reusable and directly testable.
Changes:
- Replaced inline CronJob name parsing in
SetupWithManagerwithdomain.GetMBCUIDFromCronJobName. - Added
GetMBCUIDFromCronJobNameto the domain reconciler module alongside the existing CronJob naming helper. - Added unit tests for valid/invalid parsing and a round-trip with
GetMBCCronJobName.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/controller/mantlebackupconfig_controller.go | Uses the extracted domain helper instead of inline prefix parsing in the watch mapper. |
| internal/controller/domain/mbc_primary_reconciler.go | Introduces the exported domain function to parse MBC UID from CronJob names. |
| internal/controller/domain/mbc_primary_reconciler_test.go | Adds unit tests covering the new parsing helper (valid/invalid/round-trip). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Extract the CronJob-name-to-MBC-UID mapping logic from the inline closure in SetupWithManager into a domain-layer function. Signed-off-by: Ryotaro Banno <ryotaro.banno@gmail.com>
cee9268 to
71452dc
Compare
llamerada-jp
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract the CronJob-name-to-MBC-UID mapping logic from the inline closure in SetupWithManager into a domain-layer function.