configuration diff view for harbor config apply command with interactive confirmation prompt#568
Merged
Merged
Conversation
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
-add templated function to extract config values from different models -add view for diff in color coded fashion -add user prompt for applied diff, if canceled not applied Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #568 +/- ##
=========================================
- Coverage 10.99% 6.53% -4.46%
=========================================
Files 173 259 +86
Lines 8671 12677 +4006
=========================================
- Hits 953 828 -125
- Misses 7612 11743 +4131
Partials 106 106 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Signed-off-by: Patrick Eschenbach <patrickeschenbach96@gmail.com>
Vad1mo
approved these changes
Nov 5, 2025
bupd
approved these changes
Nov 11, 2025
bupd
left a comment
Member
There was a problem hiding this comment.
I really like the idea of showing the modifications before applying
lgtm
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.
Closes #557
Description
Implements a configuration diff view for
harbor config applycommand with interactive confirmation prompt.Changes
New Features
[+]additions,[~]modifications, and[-]deletionsy/N(safe default: No)--yesflag: Skip confirmation for CI/CD automation (-yshort form also supported)Implementation Details
DiffConfigurations()view inpkg/views/configurations/diff/view.goApplyConfigCmd()to use the new diff viewExtractConfigValues()utility to normalize*models.ConfigurationsResponseinto flat mapscharmbracelet/lipglossfor consistent terminal colorsVisual Output
Usage
Interactive mode (default)
harbor config apply -f config.yaml # Shows diff, prompts for confirmationAuto-apply mode (CI/CD)
harbor config apply -f config.yaml --yes # Skips confirmation promptPartial configuration files
Screenshots
Screen.Recording.2025-11-05.at.10.54.27.mov