-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support env vars configuration for WebSocket server #14398
feat: Support env vars configuration for WebSocket server #14398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but waiting for @robdiciuccio to give formal approval
STATSD_GLOBAL_TAGS: val => (config.statsd.globalTags = toStringArray(val)), | ||
}; | ||
|
||
for (const [envVar, set] of Object.entries(envVarConfigSetter)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not that it makes any difference, but I think the rest of the Superset codebase usually uses this notation:
Object.entries(envVarConfigSetter).forEach(([envVar, set]) => { ... });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize there was a preference in Superset already, happy to change in this in a subsequent PR!
Personally, I tend to favor the loops for things that mutate or have side effects, and the higher order functions for anything that has return values.
*/ | ||
import { buildConfig } from '../src/config'; | ||
|
||
describe('buildConfig', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! I only have two nits.
- Can you rename it to
config.test.ts
? We're trying to make all tests adhere to the.test
extension. - Can you inline the test? We're trying to avoid unnecessary nesting to make the test results easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this just got merged. I'm happy to make these changes. Will follow up with a PR
* master: (38 commits) refactor(native-filters): allow cascading only for filter_select (apache#14441) test(maximize-chart): Add tests to maximize chart action (apache#14371) fix: fixing mysql error message (apache#14416) feat: Logic added to limiting factor column in Query model (apache#13521) change relationship (apache#14435) fix: bootstrap data permissions (apache#14348) fix: parse simple string error message values (apache#14360) chore: add stack trace to all calls of logger.error (apache#14382) update README with new docs and recordings (apache#14432) Renamed impyla from implya in impala.mdx and Renamed PIP package impyla from impala in index.mdx (apache#14425) fix(native-filters): fix filter scope error (apache#14426) feat: Adding limiting_factor column to Query model (apache#14234) feat: Add etag caching to dashboard APIs (apache#14357) chore: Moves Card to the components folder (apache#14139) feat: Dynamic imports for the Icons component (apache#14318) feat: Support env vars configuration for WebSocket server (apache#14398) fix: SQLLab role permissions (apache#14372) fix(native-filters): always show filters without dataset (apache#14409) fix error getting partitionQuery from table.partition (apache#14369) refactor: Boostrap to AntD - Tabs (apache#14048) ...
SUMMARY
The motivation for this PR is that application deployment typically involves referencing env vars to one degree or another. For example, some dynamic values in kubernetes (e.g., host ips) are easily exposed through env vars but not readily available otherwise. Additionally, it may make sense to have static configuration in the file and handle secrets (e.g.,
jwtSecret
) a little differently.TEST PLAN
Unit tests, manual