Skip to content

Commit 8c0e7b3

Browse files
authored
Merge branch 'main' into feat-tmux
2 parents 9f32bd5 + 4ae6370 commit 8c0e7b3

File tree

62 files changed

+402
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+402
-194
lines changed

.github/scripts/tag_release.sh

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
#!/bin/bash
2+
3+
# Tag Release Script
4+
# Automatically detects modules that need tagging and creates release tags
5+
# Usage: ./tag_release.sh
6+
# Operates on the current checked-out commit
7+
8+
set -euo pipefail
9+
10+
MODULES_TO_TAG=()
11+
12+
usage() {
13+
echo "Usage: $0"
14+
echo ""
15+
echo "This script will:"
16+
echo " 1. Scan all modules in the registry"
17+
echo " 2. Check which modules need new release tags"
18+
echo " 3. Extract version information from README files"
19+
echo " 4. Generate a report for confirmation"
20+
echo " 5. Create and push release tags after confirmation"
21+
echo ""
22+
echo "The script operates on the current checked-out commit."
23+
echo "Make sure you have checked out the commit you want to tag before running."
24+
exit 1
25+
}
26+
27+
validate_version() {
28+
local version="$1"
29+
if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
30+
echo "❌ Invalid version format: '$version'. Expected X.Y.Z format." >&2
31+
return 1
32+
fi
33+
return 0
34+
}
35+
36+
extract_version_from_readme() {
37+
local readme_path="$1"
38+
local namespace="$2"
39+
local module_name="$3"
40+
41+
[ ! -f "$readme_path" ] && return 1
42+
43+
local version_line
44+
version_line=$(grep -E "source\s*=\s*\"registry\.coder\.com/${namespace}/${module_name}" "$readme_path" | head -1 || echo "")
45+
46+
if [ -n "$version_line" ]; then
47+
local version
48+
version=$(echo "$version_line" | sed -n 's/.*version\s*=\s*"\([^"]*\)".*/\1/p')
49+
if [ -n "$version" ]; then
50+
echo "$version"
51+
return 0
52+
fi
53+
fi
54+
55+
local fallback_version
56+
fallback_version=$(grep -E 'version\s*=\s*"[0-9]+\.[0-9]+\.[0-9]+"' "$readme_path" | head -1 | sed 's/.*version\s*=\s*"\([^"]*\)".*/\1/' || echo "")
57+
58+
if [ -n "$fallback_version" ]; then
59+
echo "$fallback_version"
60+
return 0
61+
fi
62+
63+
return 1
64+
}
65+
66+
check_module_needs_tagging() {
67+
local namespace="$1"
68+
local module_name="$2"
69+
local readme_version="$3"
70+
71+
local tag_name="release/${namespace}/${module_name}/v${readme_version}"
72+
73+
if git rev-parse --verify "$tag_name" > /dev/null 2>&1; then
74+
return 1
75+
else
76+
return 0
77+
fi
78+
}
79+
80+
detect_modules_needing_tags() {
81+
MODULES_TO_TAG=()
82+
83+
echo "🔍 Scanning all modules for missing release tags..."
84+
echo ""
85+
86+
local all_modules
87+
all_modules=$(find registry -mindepth 3 -maxdepth 3 -type d -path "*/modules/*" | sort -u || echo "")
88+
89+
[ -z "$all_modules" ] && {
90+
echo "❌ No modules found to check"
91+
return 1
92+
}
93+
94+
local total_checked=0
95+
local needs_tagging=0
96+
97+
while IFS= read -r module_path; do
98+
if [ -z "$module_path" ]; then continue; fi
99+
100+
local namespace
101+
namespace=$(echo "$module_path" | cut -d'/' -f2)
102+
local module_name
103+
module_name=$(echo "$module_path" | cut -d'/' -f4)
104+
105+
total_checked=$((total_checked + 1))
106+
107+
local readme_path="$module_path/README.md"
108+
local readme_version
109+
110+
if ! readme_version=$(extract_version_from_readme "$readme_path" "$namespace" "$module_name"); then
111+
echo "⚠️ $namespace/$module_name: No version found in README, skipping"
112+
continue
113+
fi
114+
115+
if ! validate_version "$readme_version"; then
116+
echo "⚠️ $namespace/$module_name: Invalid version format '$readme_version', skipping"
117+
continue
118+
fi
119+
120+
if check_module_needs_tagging "$namespace" "$module_name" "$readme_version"; then
121+
echo "📦 $namespace/$module_name: v$readme_version (needs tag)"
122+
MODULES_TO_TAG+=("$module_path:$namespace:$module_name:$readme_version")
123+
needs_tagging=$((needs_tagging + 1))
124+
else
125+
echo "$namespace/$module_name: v$readme_version (already tagged)"
126+
fi
127+
128+
done <<< "$all_modules"
129+
130+
echo ""
131+
echo "📊 Summary: $needs_tagging of $total_checked modules need tagging"
132+
echo ""
133+
134+
[ $needs_tagging -eq 0 ] && {
135+
echo "🎉 All modules are up to date! No tags needed."
136+
return 0
137+
}
138+
139+
echo "## Tags to be created:"
140+
for module_info in "${MODULES_TO_TAG[@]}"; do
141+
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
142+
echo "- \`release/$namespace/$module_name/v$version\`"
143+
done
144+
echo ""
145+
146+
return 0
147+
}
148+
149+
create_and_push_tags() {
150+
[ ${#MODULES_TO_TAG[@]} -eq 0 ] && {
151+
echo "❌ No modules to tag found"
152+
return 1
153+
}
154+
155+
local current_commit
156+
current_commit=$(git rev-parse HEAD)
157+
158+
echo "🏷️ Creating release tags for commit: $current_commit"
159+
echo ""
160+
161+
local created_tags=0
162+
local failed_tags=0
163+
164+
for module_info in "${MODULES_TO_TAG[@]}"; do
165+
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
166+
167+
local tag_name="release/$namespace/$module_name/v$version"
168+
local tag_message="Release $namespace/$module_name v$version"
169+
170+
echo "Creating tag: $tag_name"
171+
172+
if git tag -a "$tag_name" -m "$tag_message" "$current_commit"; then
173+
echo "✅ Created: $tag_name"
174+
created_tags=$((created_tags + 1))
175+
else
176+
echo "❌ Failed to create: $tag_name"
177+
failed_tags=$((failed_tags + 1))
178+
fi
179+
done
180+
181+
echo ""
182+
echo "📊 Tag creation summary:"
183+
echo " Created: $created_tags"
184+
echo " Failed: $failed_tags"
185+
echo ""
186+
187+
[ $created_tags -eq 0 ] && {
188+
echo "❌ No tags were created successfully"
189+
return 1
190+
}
191+
192+
echo "🚀 Pushing tags to origin..."
193+
194+
local tags_to_push=()
195+
for module_info in "${MODULES_TO_TAG[@]}"; do
196+
IFS=':' read -r module_path namespace module_name version <<< "$module_info"
197+
local tag_name="release/$namespace/$module_name/v$version"
198+
199+
if git rev-parse --verify "$tag_name" > /dev/null 2>&1; then
200+
tags_to_push+=("$tag_name")
201+
fi
202+
done
203+
204+
local pushed_tags=0
205+
local failed_pushes=0
206+
207+
if [ ${#tags_to_push[@]} -eq 0 ]; then
208+
echo "❌ No valid tags found to push"
209+
else
210+
if git push --atomic origin "${tags_to_push[@]}"; then
211+
echo "✅ Successfully pushed all ${#tags_to_push[@]} tags"
212+
pushed_tags=${#tags_to_push[@]}
213+
else
214+
echo "❌ Failed to push tags"
215+
failed_pushes=${#tags_to_push[@]}
216+
fi
217+
fi
218+
219+
echo ""
220+
echo "📊 Push summary:"
221+
echo " Pushed: $pushed_tags"
222+
echo " Failed: $failed_pushes"
223+
echo ""
224+
225+
if [ $pushed_tags -gt 0 ]; then
226+
echo "🎉 Successfully created and pushed $pushed_tags release tags!"
227+
echo ""
228+
echo "📝 Next steps:"
229+
echo " - Tags will be automatically published to registry.coder.com"
230+
echo " - Monitor the registry website for updates"
231+
echo " - Check GitHub releases for any issues"
232+
fi
233+
234+
return 0
235+
}
236+
237+
main() {
238+
[ $# -gt 0 ] && usage
239+
240+
echo "🚀 Coder Registry Tag Release Script"
241+
echo "Operating on commit: $(git rev-parse HEAD)"
242+
echo ""
243+
244+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
245+
echo "❌ Not in a git repository"
246+
exit 1
247+
fi
248+
249+
detect_modules_needing_tags || exit 1
250+
251+
[ ${#MODULES_TO_TAG[@]} -eq 0 ] && {
252+
echo "✨ No modules need tagging. All done!"
253+
exit 0
254+
}
255+
256+
echo ""
257+
echo "❓ Do you want to proceed with creating and pushing these release tags?"
258+
echo " This will create git tags and push them to the remote repository."
259+
echo ""
260+
read -p "Continue? [y/N]: " -r response
261+
262+
case "$response" in
263+
[yY] | [yY][eE][sS])
264+
echo ""
265+
create_and_push_tags
266+
;;
267+
*)
268+
echo ""
269+
echo "🚫 Operation cancelled by user"
270+
exit 0
271+
;;
272+
esac
273+
}
274+
275+
main "$@"

MAINTAINER.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ Changes are automatically published to [registry.coder.com](https://registry.cod
7272
display_name: "Module Name"
7373
description: "What it does"
7474
icon: "../../../../.icons/tool.svg"
75-
maintainer_github: "username"
76-
partner_github: "partner-name" # Optional - For official partner modules
7775
verified: false # Optional - Set by maintainers only
7876
tags: ["tag1", "tag2"]
7977
```

examples/modules/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display_name: MODULE_NAME
33
description: Describe what this module does
44
icon: ../../../../.icons/<A_RELEVANT_ICON>.svg
5-
maintainer_github: GITHUB_USERNAME
65
verified: false
76
tags: [helper]
87
---

registry/coder-labs/templates/tasks-docker/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display_name: Tasks on Docker
33
description: Run Coder Tasks on Docker with an example application
44
icon: ../../../../.icons/tasks.svg
5-
maintainer_github: coder-labs
65
verified: false
76
tags: [docker, container, ai, tasks]
87
---

registry/coder/modules/agentapi/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display_name: AgentAPI
33
description: Building block for modules that need to run an agentapi server
44
icon: ../../../../.icons/coder.svg
5-
maintainer_github: coder
65
verified: true
76
tags: [internal]
87
---
@@ -16,7 +15,7 @@ We do not recommend using this module directly. Instead, please consider using o
1615
```tf
1716
module "agentapi" {
1817
source = "registry.coder.com/coder/agentapi/coder"
19-
version = "1.0.0"
18+
version = "1.0.1"
2019
2120
agent_id = var.agent_id
2221
web_app_slug = local.app_slug

registry/coder/modules/aider/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display_name: Aider
33
description: Run Aider AI pair programming in your workspace
44
icon: ../../../../.icons/aider.svg
5-
maintainer_github: coder
65
verified: true
76
tags: [agent, ai, aider]
87
---
@@ -14,7 +13,7 @@ Run [Aider](https://aider.chat) AI pair programming in your workspace. This modu
1413
```tf
1514
module "aider" {
1615
source = "registry.coder.com/coder/aider/coder"
17-
version = "1.1.0"
16+
version = "1.1.1"
1817
agent_id = coder_agent.example.id
1918
}
2019
```
@@ -69,7 +68,7 @@ variable "anthropic_api_key" {
6968
module "aider" {
7069
count = data.coder_workspace.me.start_count
7170
source = "registry.coder.com/coder/aider/coder"
72-
version = "1.1.0"
71+
version = "1.1.1"
7372
agent_id = coder_agent.example.id
7473
ai_api_key = var.anthropic_api_key
7574
}
@@ -94,7 +93,7 @@ variable "openai_api_key" {
9493
module "aider" {
9594
count = data.coder_workspace.me.start_count
9695
source = "registry.coder.com/coder/aider/coder"
97-
version = "1.1.0"
96+
version = "1.1.1"
9897
agent_id = coder_agent.example.id
9998
use_tmux = true
10099
ai_provider = "openai"
@@ -115,7 +114,7 @@ variable "custom_api_key" {
115114
module "aider" {
116115
count = data.coder_workspace.me.start_count
117116
source = "registry.coder.com/coder/aider/coder"
118-
version = "1.1.0"
117+
version = "1.1.1"
119118
agent_id = coder_agent.example.id
120119
ai_provider = "custom"
121120
custom_env_var_name = "MY_CUSTOM_API_KEY"
@@ -132,7 +131,7 @@ You can extend Aider's capabilities by adding custom extensions:
132131
module "aider" {
133132
count = data.coder_workspace.me.start_count
134133
source = "registry.coder.com/coder/aider/coder"
135-
version = "1.1.0"
134+
version = "1.1.1"
136135
agent_id = coder_agent.example.id
137136
ai_api_key = var.anthropic_api_key
138137
@@ -211,7 +210,7 @@ data "coder_parameter" "ai_prompt" {
211210
module "aider" {
212211
count = data.coder_workspace.me.start_count
213212
source = "registry.coder.com/coder/aider/coder"
214-
version = "1.1.0"
213+
version = "1.1.1"
215214
agent_id = coder_agent.example.id
216215
ai_api_key = var.anthropic_api_key
217216
task_prompt = data.coder_parameter.ai_prompt.value

registry/coder/modules/amazon-dcv-windows/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
display_name: Amazon DCV Windows
33
description: Amazon DCV Server and Web Client for Windows
44
icon: ../../../../.icons/dcv.svg
5-
maintainer_github: coder
65
verified: true
76
tags: [windows, amazon, dcv, web, desktop]
87
---
@@ -19,7 +18,7 @@ Enable DCV Server and Web Client on Windows workspaces.
1918
module "dcv" {
2019
count = data.coder_workspace.me.start_count
2120
source = "registry.coder.com/coder/amazon-dcv-windows/coder"
22-
version = "1.1.0"
21+
version = "1.1.1"
2322
agent_id = resource.coder_agent.main.id
2423
}
2524

0 commit comments

Comments
 (0)