Skip to content

RHDHBUGS-2776: Clarify NODE_ENV environment variable in Extensions procedure#2249

Open
themr0c wants to merge 6 commits into
redhat-developer:mainfrom
themr0c:RHDHBUGS-2776
Open

RHDHBUGS-2776: Clarify NODE_ENV environment variable in Extensions procedure#2249
themr0c wants to merge 6 commits into
redhat-developer:mainfrom
themr0c:RHDHBUGS-2776

Conversation

@themr0c
Copy link
Copy Markdown
Member

@themr0c themr0c commented May 27, 2026

Version(s): 1.9, 1.10

Issue: https://redhat.atlassian.net/browse/RHDHBUGS-2776

Preview: https://redhat-developer.github.io/red-hat-developers-documentation-rhdh/pr-2249/extend_installing-and-viewing-plugins-in-rhdh/#manage-plugins-by-using-extensions_extensions-in-rhdh (6.5.2)

Summary

  • Add a reusable IMPORTANT snippet (snip-node-env-development-extensions-note.adoc) explaining why NODE_ENV=development is required for Extensions, what it controls (config validation leniency, logging/caching behavior), and the trade-off of running it in production
  • Include the snippet at both NODE_ENV mention points in proc-configure-rhdh-to-install-plugins-by-using-extensions.adoc (Operator CR and Helm values sections)

Test plan

  • Verify the IMPORTANT admonition renders correctly in both Operator and Helm sections
  • Verify the snippet does not break the nested list structure
  • Confirm ccutil build passes for extend_installing-and-viewing-plugins-in-rhdh

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@rhdh-bot
Copy link
Copy Markdown
Collaborator

rhdh-bot commented May 27, 2026

PR Build Results

Build passed -- 34/34 titles | 68s
Preview: https://redhat-developer.github.io/red-hat-developers-documentation-rhdh/pr-2249/


Content Quality Assessment

CQA Report

  • CQA-00a: Orphaned modules
  • CQA-00b: Directory structure
  • CQA-01: Vale AsciiDoc DITA compliance
  • CQA-02: Verify assembly structure
  • CQA-03: Verify content type metadata
  • CQA-04: Verify module templates
  • CQA-05: Verify required modular elements
  • CQA-06: Verify assemblies follow official template (one user story)
  • CQA-07: Verify TOC depth (max 3 levels)
  • CQA-08: Verify short description content quality
  • CQA-09: Verify short description format
  • CQA-10: Verify titles are brief, complete, and descriptive
  • CQA-11: Verify procedure prerequisites
  • CQA-12: Verify grammar and style (Vale)
  • CQA-13: Verify content matches declared type
  • CQA-14: Verify no broken links
  • CQA-15: Check redirects
  • CQA-16: Verify official product names
  • CQA-17: Verify legal disclaimers for preview features

Summary

Checks: 19 total, 19 pass, 0 fail

19 checks: 19 pass, 0 fail

Run node build/scripts/cqa/index.js --all --fix locally to review and auto-fix issues.


Updated 2026-06-02 06:48:58 UTC

Copy link
Copy Markdown
Member

@PatAKnight PatAKnight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some in-line comments and then a couple more additional comments.

First, I think we should mention somewhere that the default is NODE_ENV=production.

Second, we seem to be included additional things that aren't specific to the Extensions plugins, i.e. logging, caching. I would either outright remove them and put them in a more generic snip-node-env-developement or just rename the file entirely and aim to make this more generic.

Comment thread modules/shared/snip-node-env-development-extensions-note.adoc Outdated
Comment thread modules/shared/snip-node-env-development-extensions-note.adoc Outdated
Comment thread modules/shared/snip-node-env-development-extensions-note.adoc Outdated
Address review feedback:
- State default NODE_ENV=production
- Clarify Extensions uses NODE_ENV for UI-driven config file updates,
  not true runtime installation (restarts still required)
- Remove unverified claim about configuration validation relaxation
- Remove vague logging/caching side-effects
- Add unsupported-in-production statement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@themr0c themr0c requested a review from PatAKnight May 28, 2026 07:37
@themr0c themr0c added Technical review done ⛅ Any procedure has been succesfully tested and removed Technical review needed 🔩 Test all the procedures labels May 28, 2026
Copy link
Copy Markdown
Member

@PatAKnight PatAKnight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


[IMPORTANT]
====
By default, `NODE_ENV` is set to `production`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PatAKnight Do you know if this is explicitly set, or inferred in the absence of having NODE_ENV set to something else? To me, there's a difference between having a visible NODE_ENV = production in a config or not seeing it, and RHDH assuming behavior since no overriding value is present, but both could be considered defaults.

Is that distinction worth considering as part of this change? or am I overthinking it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we got a question about Node_Env which led to this Jira, they wanted to know if they needed to set it to production to match their intended usage, and the only reference in the docs for Node_Env was in this guide, which is focused on how it affects the Extensions catalog.

When they looked through our code, they found this: https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/extensions/plugins/extensions-backend/src/router.ts#L299 which injects a default of Development.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... But then the step in the procedure is not necessary. How do you plan top move forward?

  • Keep development as default => rewrite docs accordingly.
  • Set production as default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been reviewing a similar PR and I see two supported scenarios:

  1. A running dev instance (NODE_ENV=development) of RHDH that can be shared among other developers
    I think NODE_ENV needs to be set by the customers so they can decide whether to run on production or development. If unset, it might default to 'undefined'. Our e2e tests show how it's set for helm and operator deployments.

  2. RHDH Local which is single use (always set to NODE_ENV=development)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can combine this effort under the other PR which re-orgs the information for better flow.

We can have an overview paragraph to clarify what dev environments we support (deployed and single-use) and how NODE_ENV is used to distinguish runtime behaviour for certain features

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattreid, I went looking and it seems like you are right. We do not set this explicitly set this anywhere. I could have sworn that we did set NODE_ENV=production but I am not seeing it anywhere. Might have been that I was thinking the inverse was true since RHDH Local sets NODE_ENV=development

@mattreid
Copy link
Copy Markdown

mattreid commented May 28, 2026

In the same guide, it also mentions updating compose.yaml, which might not be needed anymore, but I'll have to defer to someone more technical.

It may not have always been present, but rhdh-local's default.env sets Node_Env to Development. Would it also need to be set in compose, or if set in the environment variables, is that sufficient and that step is now redundant?

Edit: I created https://redhat.atlassian.net/browse/RHDHBUGS-3305 for this.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Peer review done 📘 Technical review done ⛅ Any procedure has been succesfully tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants