Skip to content

Conversation

pandemicsyn
Copy link
Contributor

@pandemicsyn pandemicsyn commented Jan 21, 2025

Adds:

  • channel sequence to replicated channel inspect output
  • replicated channel demote and replicated channel un-demote subcommands:
    • both support passing in channel name or channel id
    • both support operating on channel sequence or release sequence (release sequence will be used to find chan sequence behind the scenes)

--

Sample working:

# demote using the _channel_ sequence
❯ bin/replicated channel demote 2rx06tuyOPtkPsG1T93wrSBiEKy --channel-sequence 2
Channel sequence 2 (version 0.1.0, release 8) demoted in channel 2rx06tuyOPtkPsG1T93wrSBiEKy

#un-demote using the _release_ sequence
❯ bin/replicated channel un-demote 2rx06tuyOPtkPsG1T93wrSBiEKy --release-sequence 8
Channel sequence 2 (version 0.1.0, release 8) un-demoted in channel 2rx06tuyOPtkPsG1T93wrSBiEKy

Sample errors:

❯ bin/replicated channel demote dupe1 --channel-sequence 8
Error: find channel "dupe1": channel "dupe1" is ambiguous, please use channel ID

Usage:
  replicated channel demote CHANNEL_ID_OR_NAME [flags]

Flags:
      --channel-sequence int   The channel sequence to demote
  -h, --help                   help for demote
      --release-sequence int   The release sequence to demote

Global Flags:
      --app string                The app slug or app id to use in all calls
      --integration-test string   Set to the name of the integration test to run
      --log-api-calls string      Log the API calls to the specified file
      --token string              The API token to use to access your app in the Vendor API


replicated feat/demote-channel-release 2s
❯ bin/replicated channel demote 2rx06tuyOPtkPsG1T93wrSBiEKy
Error: one of --channel-sequence or --release-sequence is required

Usage:
  replicated channel demote CHANNEL_ID_OR_NAME [flags]                                                                                                                                                                      Flags:                                                                                                              --channel-sequence int   The channel sequence to demote                                                   -h, --help                   help for demote                                                                      --release-sequence int   The release sequence to demote                                                                                                                                                               Global Flags:                                                                                                       --app string                The app slug or app id to use in all calls                                        --integration-test string   Set to the name of the integration test to run                                    --log-api-calls string      Log the API calls to the specified file                                           --token string              The API token to use to access your app in the Vendor API

@pandemicsyn pandemicsyn changed the title Add support for demote/undemote of chan releases Add support for demote/un-demote of chan releases Jan 21, 2025
}
return parsedTags, nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unused

appID string
appSlug string
appType string
isFoundationApp bool
Copy link
Contributor Author

@pandemicsyn pandemicsyn Jan 21, 2025

Choose a reason for hiding this comment

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

isFoundationApp and dir was unused

createReleaseDeploymentYaml string
createReleaseServiceYaml string
createReleasePreflightYaml string
createReleaseSupportBundleYaml string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all these where also unused

@pandemicsyn pandemicsyn requested a review from divolgin January 21, 2025 19:49
@pandemicsyn pandemicsyn marked this pull request as ready for review January 21, 2025 19:49
Short: "Demote a release from a channel",
Long: `Demote a release from a channel.
Example:
Copy link
Member

Choose a reason for hiding this comment

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

This should go into the Example key in order to render correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doh 😶‍🌫️ , i was copy/pasting from enable-semantic-versioning , will update.

Short: "Un-demote a release from a channel",
Long: `Un-demote a release from a channel.
Example:
Copy link
Member

Choose a reason for hiding this comment

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

Same, Command.Example key

@pandemicsyn
Copy link
Contributor Author

Updated:

❯ bin/replicated channel demote --help
Demote a channel release from a channel using a channel sequence or release sequence.


Usage:
  replicated channel demote CHANNEL_ID_OR_NAME [flags]

Example:
  # Demote a release from a channel by channel sequence
  replicated channel release demote Beta --channel-sequence 15

  # Demote a release from a channel by release sequence
  replicated channel release demote Beta --release-sequence 12

Flags:
      --channel-sequence int   The channel sequence to demote
  -h, --help                   help for demote
      --release-sequence int   The release sequence to demote

Global Flags:
      --app string                The app slug or app id to use in all calls
      --integration-test string   Set to the name of the integration test to run
      --log-api-calls string      Log the API calls to the specified file
      --token string              The API token to use to access your app in the Vendor API

❯ bin/replicated channel un-demote --help
Un-demote a channel release from a channel using a channel sequence or release sequence.


Usage:
  replicated channel un-demote CHANNEL_ID_OR_NAME [flags]

Example:
  # Un-demote a release from a channel by channel sequence
  replicated channel release un-demote Beta --channel-sequence 15

  # Un-demote a release from a channel by release sequence
  replicated channel release un-demote Beta --release-sequence 12

Flags:
      --channel-sequence int   The channel sequence to un-demote
  -h, --help                   help for un-demote
      --release-sequence int   The release sequence to un-demote

Global Flags:
      --app string                The app slug or app id to use in all calls
      --integration-test string   Set to the name of the integration test to run
      --log-api-calls string      Log the API calls to the specified file
      --token string              The API token to use to access your app in the Vendor API

@pandemicsyn pandemicsyn requested a review from divolgin January 21, 2025 20:09
divolgin
divolgin previously approved these changes Jan 21, 2025
@pandemicsyn pandemicsyn merged commit b6205f4 into main Jan 21, 2025
5 checks passed
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.

2 participants