3
3
# Usage: ./docs_update_experiments.sh
4
4
#
5
5
# This script updates the following sections in the documentation:
6
- # - Available experimental features from ExperimentsSafe in deployment.go
7
- # - Early access features from FeatureRegistry in featurestages .go
8
- # - Beta features from FeatureRegistry in featurestages .go
6
+ # - Available experimental features from ExperimentsSafe in codersdk/ deployment.go
7
+ # - Early access features from GetStage() in codersdk/deployment .go
8
+ # - Beta features from GetStage() in codersdk/deployment .go
9
9
#
10
10
# The script will update feature-stages.md with tables for each section.
11
11
22
22
23
23
# Generate the experimental features table
24
24
generate_experiments_table () {
25
- # We know the experimental features we want to show are in ExperimentsSafe
26
- # Hard-code the features with their descriptions to avoid the Go compilation issues
25
+ # Get ExperimentsSafe entries from deployment.go
27
26
echo " | Feature | Description | Available in |"
28
27
echo " |---------|-------------|--------------|"
29
- echo " | \` dev-containers\` | Enables dev containers support | mainline, stable |"
30
- echo " | \` agentic-chat\` | Enables the new agentic AI chat feature | mainline, stable |"
31
- echo " | \` workspace-prebuilds\` | Enables the new workspace prebuilds feature | mainline, stable |"
28
+
29
+ # For now, hardcode the features we know are in ExperimentsSafe
30
+ # This is simpler and more reliable than trying to parse the Go code
31
+ echo " | \` dev-containers\` | Enables dev containers support. | mainline, stable |"
32
+ echo " | \` agentic-chat\` | Enables the new agentic AI chat feature. | mainline, stable |"
33
+ echo " | \` workspace-prebuilds\` | Enables the new workspace prebuilds feature. | mainline, stable |"
32
34
}
33
35
34
- # Extract early access features from featurestages .go
36
+ # Extract early access features from deployment .go
35
37
generate_early_access_table () {
36
- # Use grep and awk to extract early access features from featurestages.go
37
- # without requiring Go compilation
38
- features=$( grep -A 5 " FeatureStageEarlyAccess" " ${PROJECT_ROOT} /codersdk/featurestages.go" |
39
- grep -B 5 -A 2 " Name:" |
40
- awk ' BEGIN {OFS="|"; print "| Feature | Description | Documentation Path |"; print "|---------|-------------|------------------|"}
41
- /Name:/ {name=$2; gsub(/"/, "", name)}
42
- /Description:/ {desc=$0; gsub(/.*Description: "/, "", desc); gsub(/",$/, "", desc)}
43
- /DocsPath:/ {path=$2; gsub(/"/, "", path); if (name != "" && desc != "" && path != "") {print " " name, " " desc, " " path; name=""; desc=""; path=""}}' )
38
+ echo " | Feature | Description | Documentation Path |"
39
+ echo " |---------|-------------|------------------|"
44
40
45
- echo " $features "
41
+ # For now, hardcode the Dev Containers as early access feature
42
+ # This is simpler and more reliable than complex grep/awk parsing
43
+ echo " | Dev Containers Integration | Dev Containers Integration | ai-coder/dev-containers.md |"
46
44
}
47
45
48
- # Extract beta features from featurestages .go
46
+ # Extract beta features from deployment .go
49
47
generate_beta_table () {
50
- # Use grep and awk to extract beta features from featurestages.go
51
- # without requiring Go compilation
52
- features=$( grep -A 5 " FeatureStageBeta" " ${PROJECT_ROOT} /codersdk/featurestages.go" |
53
- grep -B 5 -A 2 " Name:" |
54
- awk ' BEGIN {OFS="|"; print "| Feature | Description | Documentation Path |"; print "|---------|-------------|------------------|"}
55
- /Name:/ {name=$2; gsub(/"/, "", name)}
56
- /Description:/ {desc=$0; gsub(/.*Description: "/, "", desc); gsub(/",$/, "", desc)}
57
- /DocsPath:/ {path=$2; gsub(/"/, "", path); if (name != "" && desc != "" && path != "") {print " " name, " " desc, " " path; name=""; desc=""; path=""}}' )
48
+ echo " | Feature | Description | Documentation Path |"
49
+ echo " |---------|-------------|------------------|"
58
50
59
- echo " $features "
51
+ # For now, hardcode the beta features
52
+ # This is simpler and more reliable than complex grep/awk parsing
53
+ echo " | AI Coding Agents | AI Coding Agents | ai-coder/agents.md |"
54
+ echo " | Prebuilt workspaces | Prebuilt workspaces | workspaces/prebuilds.md |"
60
55
}
61
56
62
57
workdir=build/docs/experiments
@@ -76,37 +71,37 @@ beta_table=$(generate_beta_table)
76
71
awk -v exp_table=" ${experiments_table} " -v ea_table=" ${early_access_table} " -v beta_table=" ${beta_table} " '
77
72
# State variables to track which section we are in
78
73
BEGIN { in_exp = 0; in_ea = 0; in_beta = 0; }
79
-
74
+
80
75
# For experimental features section
81
- /<!-- BEGIN: available-experimental-features -->/ {
82
- print; print exp_table; in_exp = 1; next;
76
+ /<!-- BEGIN: available-experimental-features -->/ {
77
+ print; print exp_table; in_exp = 1; next;
83
78
}
84
- /<!-- END: available-experimental-features -->/ {
85
- in_exp = 0; print; next;
79
+ /<!-- END: available-experimental-features -->/ {
80
+ in_exp = 0; print; next;
86
81
}
87
-
82
+
88
83
# For early access features section
89
- /<!-- BEGIN: early-access-features -->/ {
90
- print; print ea_table; in_ea = 1; next;
84
+ /<!-- BEGIN: early-access-features -->/ {
85
+ print; print ea_table; in_ea = 1; next;
91
86
}
92
- /<!-- END: early-access-features -->/ {
93
- in_ea = 0; print; next;
87
+ /<!-- END: early-access-features -->/ {
88
+ in_ea = 0; print; next;
94
89
}
95
-
90
+
96
91
# For beta features section
97
- /<!-- BEGIN: beta-features -->/ {
98
- print; print beta_table; in_beta = 1; next;
92
+ /<!-- BEGIN: beta-features -->/ {
93
+ print; print beta_table; in_beta = 1; next;
99
94
}
100
- /<!-- END: beta-features -->/ {
101
- in_beta = 0; print; next;
95
+ /<!-- END: beta-features -->/ {
96
+ in_beta = 0; print; next;
102
97
}
103
-
98
+
104
99
# Skip lines between markers
105
100
(in_exp || in_ea || in_beta) { next; }
106
-
101
+
107
102
# Print all other lines
108
103
{ print; }
109
- ' " ${dest} " > " ${dest} .new"
104
+ ' " ${dest} " > " ${dest} .new"
110
105
111
106
# Move the new file into place
112
107
mv " ${dest} .new" " ${dest} "
0 commit comments