Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: make heroku data env var override redis host too. #3239

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xiaolin-ninja
Copy link

@xiaolin-ninja xiaolin-ninja commented Mar 3, 2025

HEROKU_DATA_HOST sets custom Data-API endpoint for Postgres and Kafka, but not Redis.
This makes it so that this env var sets Redis as well, and removes the HEROKU_POSTGRES_HOST and HEROKU_KAFKA_HOST endpoints to eliminate the situation where the CLI talks to different hosts for different services.

https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002AjJ4mYAF/view

Discussion here: https://salesforce-internal.slack.com/archives/C04N31RE732/p1741012577493589?thread_ts=1741010679.617519&cid=C04N31RE732

Testing:

HEROKU_DATA_HOST changes the host for Redis, Kafka, & Postgres:

☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_DATA_HOST=heroku-data-api-staging.herokuapp.com ./bin/run redis:info -a xx-test   
=== redis-amorphous-75493 (REDIS_URL)
...

☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_DATA_HOST=random ./bin/run redis:info -a xx-test                                                                           [13:58:04 2025-03-6]
    Error: getaddrinfo ENOTFOUND random
    Code: ENOTFOUND
    
☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_DATA_HOST=api.data.heroku.com ./bin/run redis:info -a xx-test                                                              [14:00:00 2025-03-6]
=== redis-curly-99420 (REDIS_URL)
...

☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_DATA_HOST=potato ./bin/run kafka -a xx-test-private                                                                        [14:02:53 2025-03-6]
 ▸    ENOTFOUND: getaddrinfo ENOTFOUND potato
 

☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_DATA_HOST=potato ./bin/run pg:info -a xx-test                                                                              [14:03:25 2025-03-6]
    Error: getaddrinfo ENOTFOUND potato
    Code: ENOTFOUND 

HEROKU_REDIS_HOST doesn't affect anything:

☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_REDIS_HOST=potato ./bin/run redis:info -a xx-test                                                                          [14:00:38 2025-03-6]
=== redis-curly-99420 (REDIS_URL)

HEROKU_POSTGRES_HOST doesn't affect anything:

☁  cli [xx/add_data_env_var_redis] ⚡  HEROKU_POSTGRES_HOST=potato ./bin/run pg:info -a xx-test                                                                          [14:01:09 2025-03-6]
=== HEROKU_POSTGRESQL_STAGING_CYAN_URL

@xiaolin-ninja xiaolin-ninja requested a review from a team as a code owner March 3, 2025 14:29
@xiaolin-ninja xiaolin-ninja changed the title fix: make HEROKU_DATA_HOST override redis host too. fix: make heroku data env var override redis host too. Mar 3, 2025
@eablack eablack force-pushed the xx/add_data_env_var_redis branch from 7aeadb9 to 6888527 Compare March 5, 2025 00:51
@eablack eablack temporarily deployed to AcceptanceTests March 5, 2025 00:51 — with GitHub Actions Inactive
@eablack eablack temporarily deployed to AcceptanceTests March 5, 2025 00:51 — with GitHub Actions Inactive
@k80bowman
Copy link
Contributor

@xiaolin-ninja do you have a work item for this change? These could be considered breaking changes and I'd like to get some more context on why they are necessary.

@xiaolin-ninja
Copy link
Author

@xiaolin-ninja do you have a work item for this change? These could be considered breaking changes and I'd like to get some more context on why they are necessary.

Yes! Sorry I added the work item and the Slack discussion about it. It was an oversight to not add HEROKU_DATA_HOST for Redis, and after discussion we decided to remove the 3 individual customizable environment variables for different services, and have HEROKU_DATA_HOST assign a custom host to all.

Co-authored-by: Justin Downing <jdowning@heroku.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants