fix(coder-labs/modules/codex): address review findings from Netero
- Guard jq usage with command -v check; emit a clear error and skip the remote MCP fetch when jq is not available (DEREM-1) - Remove vacuous length assertion in tftest that tested its own input, not the module behavior (DEREM-2) - Replace em-dash with period in test comment (DEREM-3)
This commit is contained in:
parent
af2cc72e44
commit
594256f961
@ -469,7 +469,7 @@ describe("codex", async () => {
|
|||||||
).text(),
|
).text(),
|
||||||
});
|
});
|
||||||
// Drop the remote TOML payload at a path the install script will fetch
|
// Drop the remote TOML payload at a path the install script will fetch
|
||||||
// via file:// — keeps the test self-contained (no external network).
|
// via file://. Keeps the test self-contained (no external network).
|
||||||
await execContainer(id, [
|
await execContainer(id, [
|
||||||
"bash",
|
"bash",
|
||||||
"-c",
|
"-c",
|
||||||
|
|||||||
@ -196,11 +196,6 @@ run "test_mcp_config_remote_path" {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
assert {
|
|
||||||
condition = length(var.mcp_config_remote_path) == 2
|
|
||||||
error_message = "mcp_config_remote_path should accept a list of URLs"
|
|
||||||
}
|
|
||||||
|
|
||||||
assert {
|
assert {
|
||||||
condition = strcontains(local.install_script, base64encode(jsonencode(var.mcp_config_remote_path)))
|
condition = strcontains(local.install_script, base64encode(jsonencode(var.mcp_config_remote_path)))
|
||||||
error_message = "install script should embed the base64-encoded mcp_config_remote_path JSON"
|
error_message = "install script should embed the base64-encoded mcp_config_remote_path JSON"
|
||||||
|
|||||||
@ -158,6 +158,9 @@ function populate_config_toml() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$${ARG_MCP_CONFIG_REMOTE_PATH}" ] && [ "$${ARG_MCP_CONFIG_REMOTE_PATH}" != "[]" ]; then
|
if [ -n "$${ARG_MCP_CONFIG_REMOTE_PATH}" ] && [ "$${ARG_MCP_CONFIG_REMOTE_PATH}" != "[]" ]; then
|
||||||
|
if ! command -v jq > /dev/null 2>&1; then
|
||||||
|
printf "Error: 'jq' is required to process mcp_config_remote_path but was not found. Skipping remote MCP config fetch.\n" >&2
|
||||||
|
else
|
||||||
for url in $(echo "$${ARG_MCP_CONFIG_REMOTE_PATH}" | jq -r '.[]'); do
|
for url in $(echo "$${ARG_MCP_CONFIG_REMOTE_PATH}" | jq -r '.[]'); do
|
||||||
echo "Fetching MCP configuration from: $${url}"
|
echo "Fetching MCP configuration from: $${url}"
|
||||||
mcp_toml=$(curl -fsSL "$${url}") || {
|
mcp_toml=$(curl -fsSL "$${url}") || {
|
||||||
@ -168,6 +171,7 @@ function populate_config_toml() {
|
|||||||
printf '\n%s\n' "$${mcp_toml}" >> "$${config_path}"
|
printf '\n%s\n' "$${mcp_toml}" >> "$${config_path}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$${ARG_ENABLE_AI_GATEWAY}" = "true" ] && [ -n "$${ARG_AIBRIDGE_CONFIG}" ]; then
|
if [ "$${ARG_ENABLE_AI_GATEWAY}" = "true" ] && [ -n "$${ARG_AIBRIDGE_CONFIG}" ]; then
|
||||||
if ! grep -q '\[model_providers\.aigateway\]' "$${config_path}" 2>/dev/null; then
|
if ! grep -q '\[model_providers\.aigateway\]' "$${config_path}" 2>/dev/null; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user