Compare commits

..

5 Commits

Author SHA1 Message Date
Phorcys
32b69016a0 fix(vscode-web): set settings variable type to any (#369) 2024-12-19 10:04:31 +01:00
Phorcys
6d2739131a fix(code-server): set settings variable type to any (#368) 2024-12-17 19:31:10 +05:00
Muhammad Atif Ali
cbd06b1135 Improve incident management in Instatus check script (#346) 2024-12-05 14:24:45 +05:00
Muhammad Atif Ali
675c82367a feat(jetbrains-gateway): bump to 2024.3 (#355) 2024-11-29 15:51:24 +00:00
Mathias Fredriksson
bf697e1fa4 fix(update-versions.sh): handle markdown/tf block nesting when updating version (#356) 2024-11-29 20:22:43 +05:00
9 changed files with 117 additions and 51 deletions

View File

@@ -48,7 +48,7 @@ update_component_status() {
# Function to create an incident # Function to create an incident
create_incident() { create_incident() {
local incident_name="Testing Instatus" local incident_name="Degraded Service"
local message="The following modules are experiencing issues:\n" local message="The following modules are experiencing issues:\n"
for i in "${!failures[@]}"; do for i in "${!failures[@]}"; do
message+="$((i + 1)). ${failures[$i]}\n" message+="$((i + 1)). ${failures[$i]}\n"
@@ -59,7 +59,7 @@ create_incident() {
component_status="MAJOROUTAGE" component_status="MAJOROUTAGE"
fi fi
# see https://instatus.com/help/api/incidents # see https://instatus.com/help/api/incidents
response=$(curl -s -X POST "https://api.instatus.com/v1/$INSTATUS_PAGE_ID/incidents" \ incident_id=$(curl -s -X POST "https://api.instatus.com/v1/$INSTATUS_PAGE_ID/incidents" \
-H "Authorization: Bearer $INSTATUS_API_KEY" \ -H "Authorization: Bearer $INSTATUS_API_KEY" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{ -d "{
@@ -74,10 +74,25 @@ create_incident() {
\"status\": \"PARTIALOUTAGE\" \"status\": \"PARTIALOUTAGE\"
} }
] ]
}") }" | jq -r '.id')
incident_id=$(echo "$response" | jq -r '.id') echo "Created incident with ID: $incident_id"
echo "$incident_id" }
# Function to check for existing unresolved incidents
check_existing_incident() {
# Fetch the latest incidents with status not equal to "RESOLVED"
local unresolved_incidents=$(curl -s -X GET "https://api.instatus.com/v1/$INSTATUS_PAGE_ID/incidents" \
-H "Authorization: Bearer $INSTATUS_API_KEY" \
-H "Content-Type: application/json" | jq -r '.incidents[] | select(.status != "RESOLVED") | .id')
if [[ -n "$unresolved_incidents" ]]; then
echo "Unresolved incidents found: $unresolved_incidents"
return 0 # Indicate that there are unresolved incidents
else
echo "No unresolved incidents found."
return 1 # Indicate that no unresolved incidents exist
fi
} }
force_redeploy_registry () { force_redeploy_registry () {
@@ -174,9 +189,10 @@ else
update_component_status "PARTIALOUTAGE" update_component_status "PARTIALOUTAGE"
fi fi
# Create a new incident # Check if there is an existing incident before creating a new one
incident_id=$(create_incident) if ! check_existing_incident; then
echo "Created incident with ID: $incident_id" create_incident
fi
# If a module is down, force a reployment to try getting things back online # If a module is down, force a reployment to try getting things back online
# ASAP # ASAP

View File

@@ -14,7 +14,7 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@@ -28,7 +28,7 @@ module "code-server" {
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
install_version = "4.8.3" install_version = "4.8.3"
} }
@@ -41,7 +41,7 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = [ extensions = [
"dracula-theme.theme-dracula" "dracula-theme.theme-dracula"
@@ -58,7 +58,7 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula"] extensions = ["dracula-theme.theme-dracula"]
settings = { settings = {
@@ -74,7 +74,7 @@ Just run code-server in the background, don't fetch it from GitHub:
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
} }
@@ -89,7 +89,7 @@ Run an existing copy of code-server if found, otherwise download from GitHub:
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
use_cached = true use_cached = true
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
@@ -101,7 +101,7 @@ Just run code-server in the background, don't fetch it from GitHub:
```tf ```tf
module "code-server" { module "code-server" {
source = "registry.coder.com/modules/code-server/coder" source = "registry.coder.com/modules/code-server/coder"
version = "1.0.18" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
offline = true offline = true
} }

View File

@@ -39,7 +39,7 @@ variable "slug" {
} }
variable "settings" { variable "settings" {
type = map(string) type = any
description = "A map of settings to apply to code-server." description = "A map of settings to apply to code-server."
default = {} default = {}
} }

View File

@@ -14,7 +14,7 @@ This module adds a JetBrains Gateway Button to open any workspace with a single
```tf ```tf
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23" version = "1.0.25"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example" agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
@@ -32,7 +32,7 @@ module "jetbrains_gateway" {
```tf ```tf
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23" version = "1.0.25"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example" agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
@@ -41,27 +41,52 @@ module "jetbrains_gateway" {
} }
``` ```
### Use the latest release version ### Use the latest version of each IDE
```tf ```tf
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23" version = "1.0.25"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example" agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
jetbrains_ides = ["GO", "WS"] jetbrains_ides = ["IU", "PY"]
default = "GO" default = "IU"
latest = true latest = true
} }
``` ```
### Use fixed versions set by `jetbrains_ide_versions`
```tf
module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.25"
agent_id = coder_agent.example.id
agent_name = "example"
folder = "/home/coder/example"
jetbrains_ides = ["IU", "PY"]
default = "IU"
latest = false
jetbrains_ide_versions = {
"IU" = {
build_number = "243.21565.193"
version = "2024.3"
}
"PY" = {
build_number = "243.21565.199"
version = "2024.3"
}
}
}
```
### Use the latest EAP version ### Use the latest EAP version
```tf ```tf
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23" version = "1.0.25"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example" agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"
@@ -79,7 +104,7 @@ Due to the highest priority of the `ide_download_link` parameter in the `(jetbra
```tf ```tf
module "jetbrains_gateway" { module "jetbrains_gateway" {
source = "registry.coder.com/modules/jetbrains-gateway/coder" source = "registry.coder.com/modules/jetbrains-gateway/coder"
version = "1.0.23" version = "1.0.25"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
agent_name = "example" agent_name = "example"
folder = "/home/coder/example" folder = "/home/coder/example"

View File

@@ -22,7 +22,7 @@ describe("jetbrains-gateway", async () => {
folder: "/home/coder", folder: "/home/coder",
}); });
expect(state.outputs.url.value).toBe( expect(state.outputs.url.value).toBe(
"jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=241.14494.240&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.1.tar.gz", "jetbrains-gateway://connect#type=coder&workspace=default&owner=default&agent=foo&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz",
); );
const coder_app = state.resources.find( const coder_app = state.resources.find(

View File

@@ -80,36 +80,36 @@ variable "jetbrains_ide_versions" {
description = "The set of versions for each jetbrains IDE" description = "The set of versions for each jetbrains IDE"
default = { default = {
"IU" = { "IU" = {
build_number = "241.14494.240" build_number = "243.21565.193"
version = "2024.1" version = "2024.3"
} }
"PS" = { "PS" = {
build_number = "241.14494.237" build_number = "243.21565.202"
version = "2024.1" version = "2024.3"
} }
"WS" = { "WS" = {
build_number = "241.14494.235" build_number = "243.21565.180"
version = "2024.1" version = "2024.3"
} }
"PY" = { "PY" = {
build_number = "241.14494.241" build_number = "243.21565.199"
version = "2024.1" version = "2024.3"
} }
"CL" = { "CL" = {
build_number = "241.14494.288" build_number = "243.21565.238"
version = "2024.1" version = "2024.1"
} }
"GO" = { "GO" = {
build_number = "241.14494.238" build_number = "243.21565.208"
version = "2024.1" version = "2024.3"
} }
"RM" = { "RM" = {
build_number = "241.14494.234" build_number = "243.21565.197"
version = "2024.1" version = "2024.3"
} }
"RD" = { "RD" = {
build_number = "241.14494.307" build_number = "243.21565.191"
version = "2024.1" version = "2024.3"
} }
} }
validation { validation {

View File

@@ -21,14 +21,39 @@ for dir in "${changed_dirs[@]}"; do
if [[ -f "$dir/README.md" ]]; then if [[ -f "$dir/README.md" ]]; then
file="$dir/README.md" file="$dir/README.md"
tmpfile=$(mktemp /tmp/tempfile.XXXXXX) tmpfile=$(mktemp /tmp/tempfile.XXXXXX)
awk -v tag="$LATEST_TAG" '{ awk -v tag="$LATEST_TAG" '
if ($1 == "version" && $2 == "=") { BEGIN { in_code_block = 0; in_nested_block = 0 }
sub(/"[^"]*"/, "\"" tag "\"") {
print # Detect the start and end of Markdown code blocks.
} else { if ($0 ~ /^```/) {
in_code_block = !in_code_block
# Reset nested block tracking when exiting a code block.
if (!in_code_block) {
in_nested_block = 0
}
}
# Handle nested blocks within a code block.
if (in_code_block) {
# Detect the start of a nested block (skipping "module" blocks).
if ($0 ~ /{/ && !($1 == "module" || $1 ~ /^[a-zA-Z0-9_]+$/)) {
in_nested_block++
}
# Detect the end of a nested block.
if ($0 ~ /}/ && in_nested_block > 0) {
in_nested_block--
}
# Update "version" only if not in a nested block.
if (!in_nested_block && $1 == "version" && $2 == "=") {
sub(/"[^"]*"/, "\"" tag "\"")
}
}
print print
} }
}' "$file" > "$tmpfile" && mv "$tmpfile" "$file" ' "$file" > "$tmpfile" && mv "$tmpfile" "$file"
# Check if the README.md file has changed # Check if the README.md file has changed
if ! git diff --quiet -- "$dir/README.md"; then if ! git diff --quiet -- "$dir/README.md"; then

View File

@@ -14,7 +14,7 @@ Automatically install [Visual Studio Code Server](https://code.visualstudio.com/
```tf ```tf
module "vscode-web" { module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.22" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
accept_license = true accept_license = true
} }
@@ -29,7 +29,7 @@ module "vscode-web" {
```tf ```tf
module "vscode-web" { module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.22" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
install_prefix = "/home/coder/.vscode-web" install_prefix = "/home/coder/.vscode-web"
folder = "/home/coder" folder = "/home/coder"
@@ -42,7 +42,7 @@ module "vscode-web" {
```tf ```tf
module "vscode-web" { module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.22" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"] extensions = ["github.copilot", "ms-python.python", "ms-toolsai.jupyter"]
accept_license = true accept_license = true
@@ -56,7 +56,7 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```tf ```tf
module "vscode-web" { module "vscode-web" {
source = "registry.coder.com/modules/vscode-web/coder" source = "registry.coder.com/modules/vscode-web/coder"
version = "1.0.22" version = "1.0.26"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
extensions = ["dracula-theme.theme-dracula"] extensions = ["dracula-theme.theme-dracula"]
settings = { settings = {

View File

@@ -92,7 +92,7 @@ variable "order" {
} }
variable "settings" { variable "settings" {
type = map(string) type = any
description = "A map of settings to apply to VS Code web." description = "A map of settings to apply to VS Code web."
default = {} default = {}
} }