Skip to content
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

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

benjreinhart
Copy link
Contributor

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

Copy link
Member

@villebro villebro left a 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)) {
Copy link
Member

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]) => { ... });

Copy link
Contributor Author

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', () => {
Copy link
Member

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.

Copy link
Contributor Author

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

@craig-rueda craig-rueda merged commit a283138 into apache:master Apr 29, 2021
@craig-rueda craig-rueda deleted the benjreinhart/env-var-config branch April 29, 2021 16:38
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request May 3, 2021
* 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)
  ...
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants