Skip to content

Conversation

taylormusolf
Copy link
Contributor

Remove hardcoded value for DBCONNECTOR_POSTGRES_POOL_MAX_SIZE with value: "100" in both _workers.tpl and deployment_workflows.yaml. With this update users will need to set DBCONNECTOR_POSTGRES_POOL_MAX_SIZE in the values.yaml for it to get applied to workflows.

Remove hardcoded value for DBCONNECTOR_POSTGRES_POOL_MAX_SIZE with value: "100".
Remove hardcoded value from deployment_workflows.yaml for DBCONNECTOR_POSTGRES_POOL_MAX_SIZE with value: "100".
Update chart version
@taylormusolf taylormusolf requested a review from golfdish August 22, 2025 19:32
@golfdish
Copy link
Contributor

rather than requiring users to supply a value, we probably want to leave 100 as a default while allowing users to override it, like we do for DBCONNECTOR_QUERY_TIMEOUT_MS here: https://github.com/tryretool/retool-helm/pull/247/files#diff-ce58e50773488bf13409091c468325d84396844ea7f7fff711b3c0933200e983R102-R109

@taylormusolf
Copy link
Contributor Author

That is a good suggestion. I will add a condition where if it is set in the values.yml, then it won't get set here.

Add a condition on DBCONNECTOR_POSTGRES_POOL_MAX_SIZE being set
Add condition for when DBCONNECTOR_POSTGRES_POOL_MAX_SIZE is set
corrected for linting error around using haskey with environmentVariables
Fix condition using has key with values.environmentVariables
Add catch for if .Values.environmentVariables is nil
Add catch for Values.environmentVariables being nil
@taylormusolf
Copy link
Contributor Author

@golfdish, I keep getting this error from the tests about "nil pointer evaluating interface {}.environmentVariables". Maybe there is a type issue that I am running into, or I need to approach this differently to check if the value is being set in ".Values.environmentVariables" or ".Values.env"

@golfdish
Copy link
Contributor

@taylormusolf I actually found a better example of how it could be done elsewhere:

- name: DBCONNECTOR_POSTGRES_POOL_MAX_SIZE
value: {{ .Values.dbconnector.config.postgresPoolMaxSize | quote }}

this takes a config value from the dbconnector section. you could similarly make a variable for the pool size under the workflows config (currently empty) and reference it in the workflows templates, which would have the same effect of setting a changeable default.

@taylormusolf
Copy link
Contributor Author

@golfdish The problem I am running into is that this is used in all of the templates where it blanket applies the env and environmentVariables. Technically, the same double variable issue would happen in dbconnector as well if they were to both set the env variable and set the config variable. I am trying to apply that fixed variable only if the user doesn't use it in env or environmentVariables values. I mean I could create a new special variable in values.yml that only applies the variable to the retool-backend and have the customer only set that going forward and then leave everything else as it originally was.

create postgresPoolMaxSize variable to be used in deployment_backend.yaml
add DBCONNECTOR_POSTGRES_POOL_MAX_SIZE variable to deployment_backend
@taylormusolf
Copy link
Contributor Author

@golfdish , I revised my approach and went off of your idea to just add a new variable to values.yaml. I left everything alone for workflows with the hardcoded values and instead created a new variable in the values.yaml config to be used similarly to the dbconnector config variable that is used for the standalone dbconnector setup, and that variable is being used in the deployment_backend template.

@taylormusolf taylormusolf changed the title Update _workers.tpl Add .Values.config.postgresPoolMaxSize Aug 23, 2025
@golfdish
Copy link
Contributor

ah, I missed the wrinkle of possibly double-applying the config and env values. I feel like maybe that could be avoided on the user's end? but I'll trust the testing you've done. ooc, does the current change achieve your goal of raising the dbconnector pool max size for workflows?

@taylormusolf
Copy link
Contributor Author

@golfdish The issue was that they needed to apply it to the backend container, and they were trying to do that via setting it in the environmentVariables, but that led to the issue with it being double-applied in workflows since those variables get blanket added to all containers.

@taylormusolf taylormusolf merged commit d582c24 into main Aug 25, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants