Repository navigation
Conversation
🟢 Tier S · Ready to merge
This change makes the Redis Labs template accept a connection URL or configure the host and port separately. It also parses ports embedded in host values, handles bare and bracketed IPv6 addresses, and documents the new environment variables.
Note @codax69 does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve. 📂 Walkthrough · 3
Reviewed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes an issue in the
node/query-redis-labstemplate where the Redis client was hardcoded to connect exclusively on port14714. Redis Cloud assigns arbitrary ports to individual database instances, which previously prevented users from connecting unless their database was assigned port 14714.Key Changes
REDIS_PORT: Added support for readingREDIS_PORTfrom environment variables, defaulting to the standard Redis port (6379) when not specified.host:portinREDIS_HOST: Automatically extracts the port if the user provides the host inhostname:portor bracketed IPv6 format ([::1]:port). Bare IPv6 addresses (e.g.,::1) are detected vianode:net'sisIP()and kept intact without misinterpreting the trailing segment as a port.REDIS_URL): Added support for standard Redis connection URLs (redis://.../rediss://...).src/main.jssoREDIS_HOSTandREDIS_PASSWORDare only required whenREDIS_URLis not provided.README.mdto documentREDIS_PORTandREDIS_URL, clarifying thatREDIS_HOSTandREDIS_PASSWORDare required only whenREDIS_URLis absent.Test Plan
Syntax and Linting:
node --checkacross template JavaScript files.Configuration & Option Parsing Tests:
throwIfMissingcorrectly requiresREDIS_HOSTandREDIS_PASSWORDwhenREDIS_URLis absent.REDIS_URLallows execution withoutREDIS_HOSTorREDIS_PASSWORD.REDIS_URLREDIS_HOST+REDIS_PASSWORD+ explicitREDIS_PORTREDIS_HOSTcontaininghost:port::1) defaulting to port6379[::1]:8888)404 Not found.Related PRs and Issues
query-redis-labs can only connect to a Redis Cloud database that happens to use port 14714.Have you read the Contributing Guidelines on issues?
Yes