Skip to content

Commit 847a807

Browse files
authored
Merge branch 'main' into phorcys420/centralize-vscode-desktop
2 parents 9f188fb + 814f765 commit 847a807

File tree

30 files changed

+685
-42
lines changed

30 files changed

+685
-42
lines changed

.github/workflows/deploy-registry.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
paths:
1515
- ".github/workflows/deploy-registry.yaml"
1616
- "registry/**/templates/**"
17+
- "registry/**/README.md"
1718
- ".icons/**"
1819

1920
jobs:
@@ -29,7 +30,7 @@ jobs:
2930
- name: Checkout code
3031
uses: actions/checkout@v4
3132
- name: Authenticate with Google Cloud
32-
uses: google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462
33+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5
3334
with:
3435
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
3536
service_account: [email protected]

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Create `registry/[your-username]/README.md`:
8989
---
9090
display_name: "Your Name"
9191
bio: "Brief description of who you are and what you do"
92-
avatar_url: "./.images/avatar.png"
92+
avatar: "./.images/avatar.png"
9393
github: "your-username"
9494
linkedin: "https://www.linkedin.com/in/your-username" # Optional
9595
website: "https://yourwebsite.com" # Optional
@@ -102,7 +102,7 @@ status: "community"
102102
Brief description of who you are and what you do.
103103
```
104104

105-
> **Note**: The `avatar_url` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
105+
> **Note**: The `avatar` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
106106
107107
### 2. Generate Module Files
108108

MAINTAINER.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,58 @@ go build ./cmd/readmevalidation && ./readmevalidation
4242

4343
## Making a Release
4444

45-
### Create Release Tags
45+
### Automated Tag and Release Process
4646

47-
After merging a PR:
47+
After merging a PR, use the automated script to create and push release tags:
4848

49-
1. Get the new version from the PR (shown as `old → new`)
50-
2. Checkout the merge commit and create the tag:
49+
**Prerequisites:**
50+
51+
- Ensure all module versions are updated in their respective README files (the script uses this as the source of truth)
52+
- Make sure you have the necessary permissions to push tags to the repository
53+
54+
**Steps:**
55+
56+
1. **Checkout the merge commit:**
57+
58+
```bash
59+
git checkout MERGE_COMMIT_ID
60+
```
61+
62+
2. **Run the tag release script:**
63+
64+
```bash
65+
./scripts/tag_release.sh
66+
```
67+
68+
3. **Review and confirm:**
69+
- The script will automatically scan all modules in the registry
70+
- It will detect which modules need version bumps by comparing README versions to existing tags
71+
- A summary will be displayed showing which modules need tagging
72+
- Confirm the list is correct when prompted
73+
74+
4. **Automatic tagging:**
75+
- After confirmation, the script will automatically create all necessary release tags
76+
- Tags will be pushed to the remote repository
77+
- The script operates on the current checked-out commit
78+
79+
**Example output:**
80+
81+
```text
82+
🔍 Scanning all modules for missing release tags...
83+
84+
📦 coder/code-server: v4.1.2 (needs tag)
85+
✅ coder/dotfiles: v1.0.5 (already tagged)
86+
87+
## Tags to be created:
88+
- `release/coder/code-server/v4.1.2`
89+
90+
❓ Do you want to proceed with creating and pushing these release tags?
91+
Continue? [y/N]: y
92+
```
93+
94+
### Manual Process (Fallback)
95+
96+
If the automated script fails, you can manually tag and release modules:
5197

5298
```bash
5399
# Checkout the merge commit
@@ -81,7 +127,7 @@ tags: ["tag1", "tag2"]
81127
```yaml
82128
display_name: "Your Name"
83129
bio: "Brief description of who you are and what you do"
84-
avatar_url: "./.images/avatar.png"
130+
avatar: "./.images/avatar.png"
85131
github: "username"
86132
linkedin: "https://www.linkedin.com/in/username" # Optional
87133
website: "https://yourwebsite.com" # Optional

cmd/readmevalidation/coderresources.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ func validateAllCoderResourceFilesOfType(resourceType string) error {
336336
return err
337337
}
338338

339-
logger.Info(context.Background(), "rocessing README files", "num_files", len(allReadmeFiles))
339+
logger.Info(context.Background(), "processing README files", "num_files", len(allReadmeFiles))
340340
resources, err := parseCoderResourceReadmeFiles(resourceType, allReadmeFiles)
341341
if err != nil {
342342
return err
343343
}
344-
logger.Info(context.Background(), "rocessed README files as valid Coder resources", "num_files", len(resources), "type", resourceType)
344+
logger.Info(context.Background(), "processed README files as valid Coder resources", "num_files", len(resources), "type", resourceType)
345345

346346
if err := validateCoderResourceRelativeURLs(resources); err != nil {
347347
return err

registry/anomaly/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: "Jay Kumar"
33
bio: "I'm a Software Engineer :)"
4-
avatar_url: "./.images/avatar.png"
4+
avatar: "./.images/avatar.jpeg"
55
github: "35C4n0r"
66
linkedin: "https://www.linkedin.com/in/jaykum4r"
77
support_email: "[email protected]"

registry/coder-labs/templates/tasks-docker/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ data "coder_workspace_preset" "default" {
118118
EOT
119119
"preview_port" = "4200"
120120
"container_image" = "codercom/example-universal:ubuntu"
121-
"jetbrains_ide" = "PY"
122121
}
123122

124123
# Pre-builds is a Coder Premium

registry/coder/modules/agentapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The AgentAPI module is a building block for modules that need to run an AgentAPI
1616
```tf
1717
module "agentapi" {
1818
source = "registry.coder.com/coder/agentapi/coder"
19-
version = "1.0.2"
19+
version = "1.1.0"
2020
2121
agent_id = var.agent_id
2222
web_app_slug = local.app_slug

registry/coder/modules/agentapi/main.test.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,92 @@ describe("agentapi", async () => {
148148
]);
149149
expect(respAgentAPI.exitCode).toBe(0);
150150
});
151+
152+
test("no-subdomain-base-path", async () => {
153+
const { id } = await setup({
154+
moduleVariables: {
155+
agentapi_subdomain: "false",
156+
},
157+
});
158+
159+
const respModuleScript = await execModuleScript(id);
160+
expect(respModuleScript.exitCode).toBe(0);
161+
162+
await expectAgentAPIStarted(id);
163+
const agentApiStartLog = await readFileContainer(
164+
id,
165+
"/home/coder/test-agentapi-start.log",
166+
);
167+
expect(agentApiStartLog).toContain("Using AGENTAPI_CHAT_BASE_PATH: /@default/default.foo/apps/agentapi-web/chat");
168+
});
169+
170+
test("validate-agentapi-version", async () => {
171+
const cases = [
172+
{
173+
moduleVariables: {
174+
agentapi_version: "v0.3.2",
175+
},
176+
shouldThrow: "",
177+
},
178+
{
179+
moduleVariables: {
180+
agentapi_version: "v0.3.3",
181+
},
182+
shouldThrow: "",
183+
},
184+
{
185+
moduleVariables: {
186+
agentapi_version: "v0.0.1",
187+
agentapi_subdomain: "false",
188+
},
189+
shouldThrow: "Running with subdomain = false is only supported by agentapi >= v0.3.3.",
190+
},
191+
{
192+
moduleVariables: {
193+
agentapi_version: "v0.3.2",
194+
agentapi_subdomain: "false",
195+
},
196+
shouldThrow: "Running with subdomain = false is only supported by agentapi >= v0.3.3.",
197+
},
198+
{
199+
moduleVariables: {
200+
agentapi_version: "v0.3.3",
201+
agentapi_subdomain: "false",
202+
},
203+
shouldThrow: "",
204+
},
205+
{
206+
moduleVariables: {
207+
agentapi_version: "v0.3.999",
208+
agentapi_subdomain: "false",
209+
},
210+
shouldThrow: "",
211+
},
212+
{
213+
moduleVariables: {
214+
agentapi_version: "v0.999.999",
215+
agentapi_subdomain: "false",
216+
},
217+
},
218+
{
219+
moduleVariables: {
220+
agentapi_version: "v999.999.999",
221+
agentapi_subdomain: "false",
222+
},
223+
},
224+
{
225+
moduleVariables: {
226+
agentapi_version: "arbitrary-string-bypasses-validation",
227+
},
228+
shouldThrow: "",
229+
}
230+
];
231+
for (const { moduleVariables, shouldThrow } of cases) {
232+
if (shouldThrow) {
233+
expect(setup({ moduleVariables: moduleVariables as Record<string, string> })).rejects.toThrow(shouldThrow);
234+
} else {
235+
expect(setup({ moduleVariables: moduleVariables as Record<string, string> })).resolves.toBeDefined();
236+
}
237+
}
238+
});
151239
});

registry/coder/modules/agentapi/main.tf

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ variable "install_agentapi" {
117117
variable "agentapi_version" {
118118
type = string
119119
description = "The version of AgentAPI to install."
120-
default = "v0.2.3"
120+
default = "v0.3.3"
121121
}
122122

123123
variable "agentapi_port" {
@@ -126,6 +126,31 @@ variable "agentapi_port" {
126126
default = 3284
127127
}
128128

129+
locals {
130+
# agentapi_subdomain_false_min_version_expr matches a semantic version >= v0.3.3.
131+
# Initial support was added in v0.3.1 but configuration via environment variable
132+
# was added in v0.3.3.
133+
# This is unfortunately a regex because there is no builtin way to compare semantic versions in Terraform.
134+
# See: https://regex101.com/r/oHPyRa/1
135+
agentapi_subdomain_false_min_version_expr = "^v(0\\.(3\\.[3-9]|3.[1-9]\\d+|[4-9]\\.\\d+|[1-9]\\d+\\.\\d+)|[1-9]\\d*\\.\\d+\\.\\d+)$"
136+
}
137+
138+
variable "agentapi_subdomain" {
139+
type = bool
140+
description = "Whether to use a subdomain for AgentAPI."
141+
default = true
142+
validation {
143+
condition = var.agentapi_subdomain || (
144+
# If version doesn't look like a valid semantic version, just allow it.
145+
# Note that boolean operators do not short-circuit in Terraform.
146+
can(regex("^v\\d+\\.\\d+\\.\\d+$", var.agentapi_version)) ?
147+
can(regex(local.agentapi_subdomain_false_min_version_expr, var.agentapi_version)) :
148+
true
149+
)
150+
error_message = "Running with subdomain = false is only supported by agentapi >= v0.3.3."
151+
}
152+
}
153+
129154
variable "module_dir_name" {
130155
type = string
131156
description = "Name of the subdirectory in the home directory for module files."
@@ -140,7 +165,14 @@ locals {
140165
encoded_post_install_script = var.post_install_script != null ? base64encode(var.post_install_script) : ""
141166
agentapi_start_script_b64 = base64encode(var.start_script)
142167
agentapi_wait_for_start_script_b64 = base64encode(file("${path.module}/scripts/agentapi-wait-for-start.sh"))
143-
main_script = file("${path.module}/scripts/main.sh")
168+
// Chat base path is only set if not using a subdomain.
169+
// NOTE:
170+
// - Initial support for --chat-base-path was added in v0.3.1 but configuration
171+
// via environment variable AGENTAPI_CHAT_BASE_PATH was added in v0.3.3.
172+
// - As CODER_WORKSPACE_AGENT_NAME is a recent addition we use agent ID
173+
// for backward compatibility.
174+
agentapi_chat_base_path = var.agentapi_subdomain ? "" : "/@${data.coder_workspace_owner.me.name}/${data.coder_workspace.me.name}.${var.agent_id}/apps/${var.web_app_slug}/chat"
175+
main_script = file("${path.module}/scripts/main.sh")
144176
}
145177

146178
resource "coder_script" "agentapi" {
@@ -165,6 +197,7 @@ resource "coder_script" "agentapi" {
165197
ARG_WAIT_FOR_START_SCRIPT="$(echo -n '${local.agentapi_wait_for_start_script_b64}' | base64 -d)" \
166198
ARG_POST_INSTALL_SCRIPT="$(echo -n '${local.encoded_post_install_script}' | base64 -d)" \
167199
ARG_AGENTAPI_PORT='${var.agentapi_port}' \
200+
ARG_AGENTAPI_CHAT_BASE_PATH='${local.agentapi_chat_base_path}' \
168201
/tmp/main.sh
169202
EOT
170203
run_on_start = true
@@ -178,7 +211,7 @@ resource "coder_app" "agentapi_web" {
178211
icon = var.web_app_icon
179212
order = var.web_app_order
180213
group = var.web_app_group
181-
subdomain = true
214+
subdomain = var.agentapi_subdomain
182215
healthcheck {
183216
url = "http://localhost:${var.agentapi_port}/status"
184217
interval = 3

registry/coder/modules/agentapi/scripts/main.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ START_SCRIPT="$ARG_START_SCRIPT"
1313
WAIT_FOR_START_SCRIPT="$ARG_WAIT_FOR_START_SCRIPT"
1414
POST_INSTALL_SCRIPT="$ARG_POST_INSTALL_SCRIPT"
1515
AGENTAPI_PORT="$ARG_AGENTAPI_PORT"
16+
AGENTAPI_CHAT_BASE_PATH="${ARG_AGENTAPI_CHAT_BASE_PATH:-}"
1617
set +o nounset
1718

1819
command_exists() {
@@ -92,5 +93,7 @@ export LANG=en_US.UTF-8
9293
export LC_ALL=en_US.UTF-8
9394

9495
cd "${WORKDIR}"
96+
97+
export AGENTAPI_CHAT_BASE_PATH="${AGENTAPI_CHAT_BASE_PATH:-}"
9598
nohup "$module_path/scripts/agentapi-start.sh" true "${AGENTAPI_PORT}" &>"$module_path/agentapi-start.log" &
9699
"$module_path/scripts/agentapi-wait-for-start.sh" "${AGENTAPI_PORT}"

0 commit comments

Comments
 (0)