Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Description

Implements configuration repository support for darc delete-channel behind the DARC_USE_CONFIGURATION_REPOSITORY environment variable, following the established pattern from delete-subscriptions.

Changes

  • IConfigurationRepositoryManager: Added DeleteChannelAsync method
  • ConfigurationRepositoryManager: Implemented deletion using existing DeleteModelInternalAsync infrastructure with YamlModelUniqueKeys.GetChannelKey
  • DeleteChannelCommandLineOptions: Extended ConfigurationManagementCommandLineOptions instead of CommandLineOptions to inherit config repo flags:
    • --configuration-repository
    • --configuration-branch
    • --configuration-base-branch
    • --configuration-file
    • --no-pr
  • DeleteChannelOperation: Routes to config repo manager when flag set, preserves API-based path for backward compatibility
  • DeleteChannelOperationConfigRepoTests: Added test coverage for file operations, searching, and cleanup

Usage

# Delete channel via config repo
export DARC_USE_CONFIGURATION_REPOSITORY=true
darc delete-channel --name "test-channel" \
  --configuration-branch my-branch \
  --no-pr

# Without flag, uses existing API path (default)
darc delete-channel --name "test-channel"

The API path can be removed in future by deleting the else block in DeleteChannelOperation.ExecuteAsync.

Original prompt

This section details on the original issue you should resolve

<issue_title>Make darc delete-channel work with the configuration repo</issue_title>
<issue_description>Depends on #5480

Context

With the channel configuration moving to the configuration repo, we should make it so darc delete-channel modifies the repo config. During the transition period, this should be behind a flag in the command.

Goal

Modify the existing darc delete-channel command so it updates the default channel by modifying the configuration repo in whichever structure we agree on, using the available yaml models. We'll need to add a few flags to the command:

  • Flag to target the repo instead of the API
  • Flag to specify configuration repository
  • Flag to specify which branch to commit the config changes to (if we already have a PR, or for scenario tests)
  • Flag to specify which base branch to use for the PR creation
  • Flag to specify we don't want to open a PR (for scenario tests)

This should be written so it makes it easy to remove the API part, and use the configuration repo as one and only way to modify the configuration
</issue_description>

Comments on the Issue (you are @copilot in this section)

@dkurepa The operation should look similar to `delete-subscriptions`, adding a method to the IConfigurationRepositoryManager and then implementing it. It should also have a test similar to `DeleteSubscriptionOperationConfigRepoTests`

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: dkurepa <91743470+dkurepa@users.noreply.github.com>
Copilot AI changed the title [WIP] Update darc delete-channel command for configuration repo Make darc delete-channel work with the configuration repo Dec 25, 2025
Copilot AI requested a review from dkurepa December 25, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make darc delete-channel work with the configuration repo

2 participants