From 49cd1d1c2b9dbbe99f0de34ebc436e71295c6bd6 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 15 May 2026 16:49:33 -0700 Subject: [PATCH] feat(shorebird_cli)!: hard-error on `shorebird login:ci` (#3775) --- .../lib/src/commands/login_ci_command.dart | 14 +++++++------- .../test/src/commands/login_ci_command_test.dart | 11 ++++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/shorebird_cli/lib/src/commands/login_ci_command.dart b/packages/shorebird_cli/lib/src/commands/login_ci_command.dart index b502218a..ba0b47ea 100644 --- a/packages/shorebird_cli/lib/src/commands/login_ci_command.dart +++ b/packages/shorebird_cli/lib/src/commands/login_ci_command.dart @@ -4,25 +4,25 @@ import 'package:shorebird_cli/src/shorebird_command.dart'; /// {@template login_ci_command} /// `shorebird login:ci` -/// Deprecated — directs users to API keys instead. +/// Removed — directs users to API keys instead. /// {@endtemplate} class LoginCiCommand extends ShorebirdCommand { @override - String get description => 'Login as a CI user (deprecated).'; + String get description => 'Removed — use API keys instead.'; @override String get name => 'login:ci'; @override Future run() async { - logger.info( + logger.err( ''' -${lightYellow.wrap('⚠ shorebird login:ci is deprecated.')} +shorebird login:ci has been replaced by API keys. -To authenticate in CI, create an API key at ${link(uri: Uri.parse('https://console.shorebird.dev'))} and set it as your ${lightCyan.wrap('SHOREBIRD_TOKEN')} environment variable. +Create an API key at ${link(uri: Uri.parse('https://console.shorebird.dev'))} and set it as your ${lightCyan.wrap('SHOREBIRD_TOKEN')} environment variable. -Existing tokens from login:ci will continue to work for now, but will stop working in a future release.''', +Learn more: ${link(uri: Uri.parse('https://docs.shorebird.dev/account/api-keys/'))}''', ); - return ExitCode.success.code; + return ExitCode.usage.code; } } diff --git a/packages/shorebird_cli/test/src/commands/login_ci_command_test.dart b/packages/shorebird_cli/test/src/commands/login_ci_command_test.dart index dd7aa5fc..cc2554c9 100644 --- a/packages/shorebird_cli/test/src/commands/login_ci_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/login_ci_command_test.dart @@ -36,22 +36,23 @@ void main() { }); test('has correct description', () { - expect(command.description, contains('deprecated')); + expect(command.description, contains('Removed')); }); - test('shows deprecation message and exits with code 0', () async { + test('errors with usage exit code and points to API keys', () async { final result = await runWithOverrides(command.run); - expect(result, equals(ExitCode.success.code)); + expect(result, equals(ExitCode.usage.code)); final captured = verify( - () => logger.info(captureAny()), + () => logger.err(captureAny()), ).captured; final message = captured.single as String; - expect(message, contains('shorebird login:ci is deprecated')); + expect(message, contains('shorebird login:ci has been replaced')); expect(message, contains('console.shorebird.dev')); expect(message, contains('SHOREBIRD_TOKEN')); + expect(message, contains('docs.shorebird.dev/account/api-keys')); }); test('does not trigger any auth flow', () async {