AzBuilder / terrakube

Open source IaC Automation and Collaboration Software.
https://docs.terrakube.io
Apache License 2.0
496 stars 38 forks source link

Environment Variable Character Limit #1208

Closed tthrone-atomic closed 1 month ago

tthrone-atomic commented 1 month ago

Bug description 🐞

When creating an environment variable to enable ephemeral executors, we receive an error from the API.

{"errors":[{"detail":"ERROR: value too long for type character varying(32)"}]}

It appears the global (and likely the workspace) environment variables have a small character limit. Too small to apply the required variable for enabling ephemeral executors.

Steps to reproduce

  1. Create global variable "TERRAKUBE_ENABLE_EPHEMERAL_EXECUTOR" with value "1"
  2. Click "Save Global Variable"
  3. Observe the form is stuck and there is a network error to the organizations "globalvar" endpoint.

Expected behavior

Global variable to be accepted accepting 1000+ characters in name (OS limits are very big, I don't see a reason this should be restrictively small).

Example repository

No response

Anything else?

No response

alfespa17 commented 1 month ago

Hello @tthrone-atomic

As a workaround you can add TERRAKUBE_ENABLE_EPHEMERAL_EXECUTOR at workspace level, that should work

image

I will create a pull request to change the size for the global variables

alfespa17 commented 1 month ago

By the way it is working correctly at workspace level because the size is 64 characters

https://github.com/AzBuilder/terrakube/blob/974f15f7acb060df1b4c7d112fce9774a9a83c68/api/src/main/resources/db/changelog/local/changelog-2.21.0-gcp-dynamic.xml#L10

For the above pull request I change the size to 1024 for the global variables and the workspace variables