Skip to content

chore(scripts): add script to update list of experiments after release #13872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

mafredri
Copy link
Member

Fixes #13119

For now there are no "safe" experimental features, so the list is empty. Here's an example of what this would look like if we added main branch to the list:

❯ git diff
diff --git docs/contributing/feature-stages.md docs/contributing/feature-stages.md
index 01078c58e..2f31cb122 100644
--- docs/contributing/feature-stages.md
+++ docs/contributing/feature-stages.md
@@ -32,6 +32,8 @@ coder server --experiments=feature1,feature2
 <!-- Code generated by scripts/release/docs_update_experiments.sh. DO NOT EDIT. -->
 <!-- BEGIN: available-experimental-features -->

-Currently no experiments are available in the latest mainline or stable release.
+| Feature         | Description                                                         | Available in |
+| --------------- | ------------------------------------------------------------------- | ------------ |
+| `notifications` | Sends notifications via SMTP and webhooks following certain events. | main         |

 <!-- END: available-experimental-features -->
diff --git scripts/release/docs_update_experiments.sh scripts/release/docs_update_experiments.sh
index f41c0b4b0..03ee81245 100755
--- scripts/release/docs_update_experiments.sh
+++ scripts/release/docs_update_experiments.sh
@@ -94,7 +94,7 @@ log "Updating available experimental features in ${dest}"

 declare -A experiments=() experiment_tags=()

-for channel in mainline stable; do
+for channel in mainline stable main; do
        log "Fetching experiments from ${channel}"

        tag=$(echo_latest_"${channel}"_version)

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Slick 👌

@@ -0,0 +1,177 @@
#!/usr/bin/env bash
Copy link
Member

Choose a reason for hiding this comment

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

BTW didn't we agree on moving to Go with new scripts?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fair, I began prototyping this as Bash (because Go isn't great for prototyping CLI command execution) and then didn't want to rewrite it 😅. But now that we know what needs to be done, doing so should be fairly easy.

# separated numbers and without utilizing the sort -V flag for the
# best compatibility.
echo "v$(
curl -fsSL https://api.github.com/repos/coder/coder/releases |
Copy link
Member

Choose a reason for hiding this comment

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

curious: can we add a small go app to mimic jq? I'd like to prevent such command trains

Copy link
Member Author

Choose a reason for hiding this comment

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

These are copy-pasta from install.sh so the behavior is exactly the same. But I can simplify e.g. via git tags or something.

Copy link
Member

Choose a reason for hiding this comment

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

It could be simplified for sure. This comment intended to adopt any go-jq solution.

done
)"

# Use awk to print everything outside the BEING/END block and insert the
Copy link
Member

Choose a reason for hiding this comment

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

BEGIN? (typo)

Copy link
Member Author

Choose a reason for hiding this comment

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

I was hoping you wouldn't notice 🤫

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Nothing blocking, let's get this in.

@mafredri mafredri merged commit fd10ea1 into main Jul 11, 2024
29 checks passed
@mafredri mafredri deleted the mafredri/chore-release-update-experiments branch July 11, 2024 18:45
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inject experiments into docs upon release
4 participants