Skip to content

Commit aab2279

Browse files
committed
🧠 Add playground open-changelog command #6534
1 parent fa84f76 commit aab2279

File tree

6 files changed

+505
-350
lines changed

6 files changed

+505
-350
lines changed

scripts/cli/completions.bash

Lines changed: 354 additions & 350 deletions
Large diffs are not rendered by default.

scripts/cli/playground

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ playground_usage() {
5050
printf " %s 🧨 Remove all docker images (including docker volumes)\n" "$(green "remove-all-docker-images") "
5151
printf " %s 🧼 playground is actively caching ccloud details (https://kafka-docker-playground.io/#/how-to-use?id=%%f0%%9f%%8c%%a4%%ef%%b8%%8f-confluent-cloud-examples)\n" "$(green "cleanup-cloud-details") "
5252
printf " %s 🧑‍🎓 Open Confluent documentation of currently running example\n" "$(green "open-docs") "
53+
printf " %s 📜 Open playground changelog (https://kafka-docker-playground.io/#/changelog)\n" "$(green "open-changelog") "
5354
printf " %s 🧹 Cleanup cloud resources that were created by running examples from the playground\n" "$(green "cleanup-cloud-resources") "
5455
echo
5556
printf "%s\n" "$(bold "Repro commands:")"
@@ -2280,6 +2281,33 @@ playground_open_docs_usage() {
22802281
fi
22812282
}
22822283

2284+
# :command.usage
2285+
playground_open_changelog_usage() {
2286+
printf "playground open-changelog - 📜 Open playground changelog (https://kafka-docker-playground.io/#/changelog)\n\n"
2287+
2288+
printf "%s\n" "$(bold "== Usage ==")"
2289+
printf " playground open-changelog [OPTIONS]\n"
2290+
printf " playground open-changelog --help | -h\n"
2291+
echo
2292+
2293+
# :command.long_usage
2294+
if [[ -n "$long_usage" ]]; then
2295+
printf "%s\n" "$(bold "== Options ==")"
2296+
2297+
# :command.usage_flags
2298+
# :flag.usage
2299+
printf " %s\n" "$(magenta "--only-show-url")"
2300+
printf " 🌐 Only show url\n"
2301+
echo
2302+
2303+
# :command.usage_fixed_flags
2304+
printf " %s\n" "$(magenta "--help, -h")"
2305+
printf " Show this help\n"
2306+
echo
2307+
2308+
fi
2309+
}
2310+
22832311
# :command.usage
22842312
playground_cleanup_cloud_resources_usage() {
22852313
if [[ -n $long_usage ]]; then
@@ -17181,6 +17209,22 @@ playground_open_docs_command() {
1718117209
fi
1718217210
}
1718317211

17212+
# :command.function
17213+
playground_open_changelog_command() {
17214+
17215+
# src/commands/open-changelog.sh
17216+
only_show_url="${args[--only-show-url]}"
17217+
17218+
if [[ -n "$only_show_url" ]] || [[ $(type -f open 2>&1) =~ "not found" ]]
17219+
then
17220+
log "📜 changelog is available at:"
17221+
echo "https://kafka-docker-playground.io/#/changelog"
17222+
else
17223+
log "📜 opening changelog https://kafka-docker-playground.io/#/changelog"
17224+
open "https://kafka-docker-playground.io/#/changelog"
17225+
fi
17226+
}
17227+
1718417228
# :command.function
1718517229
playground_cleanup_cloud_resources_command() {
1718617230

@@ -27321,6 +27365,13 @@ parse_requirements() {
2732127365
shift $#
2732227366
;;
2732327367

27368+
open-changelog)
27369+
action="open-changelog"
27370+
shift
27371+
playground_open_changelog_parse_requirements "$@"
27372+
shift $#
27373+
;;
27374+
2732427375
cleanup-cloud-resources)
2732527376
action="cleanup-cloud-resources"
2732627377
shift
@@ -31729,6 +31780,58 @@ playground_open_docs_parse_requirements() {
3172931780

3173031781
}
3173131782

31783+
# :command.parse_requirements
31784+
playground_open_changelog_parse_requirements() {
31785+
# :command.fixed_flags_filter
31786+
while [[ $# -gt 0 ]]; do
31787+
key="$1"
31788+
case "$key" in
31789+
--help | -h)
31790+
long_usage=yes
31791+
playground_open_changelog_usage
31792+
exit
31793+
;;
31794+
31795+
*)
31796+
break
31797+
;;
31798+
31799+
esac
31800+
done
31801+
31802+
# :command.command_filter
31803+
action="open-changelog"
31804+
31805+
# :command.parse_requirements_while
31806+
while [[ $# -gt 0 ]]; do
31807+
key="$1"
31808+
case "$key" in
31809+
# :flag.case
31810+
--only-show-url)
31811+
31812+
# :flag.case_no_arg
31813+
args['--only-show-url']=1
31814+
shift
31815+
;;
31816+
31817+
-?*)
31818+
printf "invalid option: %s\n" "$key" >&2
31819+
exit 1
31820+
;;
31821+
31822+
*)
31823+
# :command.parse_requirements_case
31824+
# :command.parse_requirements_case_simple
31825+
printf "invalid argument: %s\n" "$key" >&2
31826+
exit 1
31827+
31828+
;;
31829+
31830+
esac
31831+
done
31832+
31833+
}
31834+
3173231835
# :command.parse_requirements
3173331836
playground_cleanup_cloud_resources_parse_requirements() {
3173431837
# :command.fixed_flags_filter
@@ -42035,6 +42138,7 @@ run() {
4203542138
"remove-all-docker-images") playground_remove_all_docker_images_command ;;
4203642139
"cleanup-cloud-details") playground_cleanup_cloud_details_command ;;
4203742140
"open-docs") playground_open_docs_command ;;
42141+
"open-changelog") playground_open_changelog_command ;;
4203842142
"cleanup-cloud-resources") playground_cleanup_cloud_resources_command ;;
4203942143
"repro") playground_repro_command ;;
4204042144
"repro export") playground_repro_export_command ;;

scripts/cli/playground.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,21 @@
490490
],
491491
"subcommands": null
492492
},
493+
{
494+
"name": "open-changelog",
495+
"description": "📜 Open playground changelog (https://kafka-docker-playground.io/#/changelog)\n",
496+
"usage": "playground open-changelog [OPTIONS]",
497+
"options": [
498+
{
499+
"names": [
500+
"--only-show-url"
501+
],
502+
"argument": "",
503+
"description": "🌐 Only show url\n"
504+
}
505+
],
506+
"subcommands": null
507+
},
493508
{
494509
"name": "cleanup-cloud-resources",
495510
"description": "🧹 Cleanup cloud resources that were created by running examples from the playground\n\n❗it will remove all resources created by the playground, including topics, connectors, clusters, buckets, redshift cluster, etc...\n",

scripts/cli/playground.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,19 @@ subcommands:
619619
620620
subcommands:
621621

622+
- name: open-changelog
623+
description: |
624+
📜 Open playground changelog (https://kafka-docker-playground.io/#/changelog)
625+
usage: playground open-changelog [OPTIONS]
626+
options:
627+
- names:
628+
- --only-show-url
629+
argument: ""
630+
description: |
631+
🌐 Only show url
632+
633+
subcommands:
634+
622635
- name: cleanup-cloud-resources
623636
description: |
624637
🧹 Cleanup cloud resources that were created by running examples from the playground

scripts/cli/src/bashly.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,15 @@ commands:
994994
help: |-
995995
🌐 Only show url
996996
997+
- name: open-changelog
998+
group: Run
999+
help: |-
1000+
📜 Open playground changelog (https://kafka-docker-playground.io/#/changelog)
1001+
flags:
1002+
- long: --only-show-url
1003+
help: |-
1004+
🌐 Only show url
1005+
9971006
- name: cleanup-cloud-resources
9981007
group: Run
9991008
dependencies:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
only_show_url="${args[--only-show-url]}"
2+
3+
if [[ -n "$only_show_url" ]] || [[ $(type -f open 2>&1) =~ "not found" ]]
4+
then
5+
log "📜 changelog is available at:"
6+
echo "https://kafka-docker-playground.io/#/changelog"
7+
else
8+
log "📜 opening changelog https://kafka-docker-playground.io/#/changelog"
9+
open "https://kafka-docker-playground.io/#/changelog"
10+
fi

0 commit comments

Comments
 (0)