Skip to content

document .npmrc configuration - #1670

Merged
openshift-merge-bot[bot] merged 5 commits into
redhat-developer:mainfrom
gazarenkov:npmrc-doc
Sep 25, 2025
Merged

document .npmrc configuration#1670
openshift-merge-bot[bot] merged 5 commits into
redhat-developer:mainfrom
gazarenkov:npmrc-doc

Conversation

@gazarenkov

@gazarenkov gazarenkov commented Sep 23, 2025

Copy link
Copy Markdown
Member

Description

document .npmrc configuration

Which issue(s) does this PR fix or relate to

https://issues.redhat.com/browse/RHIDP-8833

PR acceptance criteria

  • Documentation

How to test changes / Special notes to the reviewer

Summary by Sourcery

Documentation:

  • Add instructions for configuring .npmrc for dynamic plugins, covering default Red Hat registry settings, Secret manifest creation, and mounting in the install-dynamic-plugins container.

@qodo-code-review

Copy link
Copy Markdown
Contributor

You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

RHIDP-8833 - PR Code Verified

Compliant requirements:

  • Document the recommended way to configure .npmrc for dynamic plugins.
  • Explain default registry behavior and how user-defined .npmrc is supported.
  • Provide step-by-step instructions for supplying a custom .npmrc via Backstage CR.
  • Include examples or manifests demonstrating Secrets and CR configuration.
  • Ensure documentation is clear and actionable.

Requires further human verification:

  • Validate paths, env var names, and container name ('install-dynamic-plugins') against the current operator/version in a live cluster.
  • Confirm secret reference and extraFiles mounting behavior render correctly in the CRD/docs site build.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Formatting

Code fences use four backticks instead of three; standardizing to triple backticks with language hints (e.g., yaml) will improve rendering and syntax highlighting in many doc toolchains.

@redhat:registry=https://npm.registry.redhat.com


```

</details>

<details><summary><a href='https://github.com/redhat-developer/rhdh-operator/pull/1670/files#diff-959d7e526d78843541b3b923549b6bd242510393bca8bdf8acaa19162c43d91dR7-R8'><strong>Accuracy</strong></a>

Verify the NPM_CONFIG_USERCONFIG path and container name 'install-dynamic-plugins' match the current deployment defaults; mismatches could mislead users.
</summary>

```markdown
For dynamic plugins packaged in an NPM registry, ensure the **.npmrc** file is properly configured. By default, RHDH uses https://registry.npmjs.org registry and supports additional user-defined **.npmrc** files via the **NPM_CONFIG_USERCONFIG** environment variable, pointing to **/opt/app-root/src/.npmrc.dynamic-plugins/.npmrc** .

```

</details>

<details><summary><a href='https://github.com/redhat-developer/rhdh-operator/pull/1670/files#diff-959d7e526d78843541b3b923549b6bd242510393bca8bdf8acaa19162c43d91dR29-R38'><strong>Clarity</strong></a>

Consider clarifying how multiple .npmrc sources are merged/overridden and whether the mounted secret replaces or augments the default secret-files.yaml entry.
</summary>

```markdown

spec:
application:
extraFiles:
secrets:
- name: my-npmrc-secret
path: /opt/app-root/src/.npmrc.dynamic-plugins
containers:
- install-dynamic-plugins

```

</details>

</td></tr>
<tr><td>

<details><summary>📄 References</summary><ol><li>No matching references available</li>

</ol></details>

</td></tr>
</table>

@qodo-code-review qodo-code-review Bot added the documentation Improvements or additions to documentation label Sep 23, 2025
@qodo-code-review

Copy link
Copy Markdown
Contributor

You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.

PR Type

Documentation


Description

  • Add comprehensive .npmrc configuration documentation for dynamic plugins

  • Include default registry settings and custom configuration examples

  • Provide Secret creation and mounting instructions for Backstage CR


File Walkthrough

Relevant files
Documentation
dynamic-plugins.md
Add comprehensive .npmrc configuration documentation         

docs/dynamic-plugins.md

  • Replace "TODO" placeholder with detailed .npmrc configuration guide
  • Add default registry configuration and NPM_CONFIG_USERCONFIG
    explanation
  • Include Secret creation example and Backstage CR mounting instructions
  • Document RedHat registry configuration in secret-files.yaml
+32/-1   

@gazarenkov
gazarenkov requested a review from rm3l September 23, 2025 12:08
@qodo-code-review

qodo-code-review Bot commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix inconsistent container name in documentation
Suggestion Impact:The commit updated the documentation text to use "install-dynamic-plugins" instead of "install-dynamic-plugin," aligning it with the YAML example.

code diff:

 * Mount the Secret to the install-dynamic-plugin container by adding the following to the Backstage CR:
 
-````
+```yaml 
+apiVersion: backstage.io/v1alpha4
+#...
 spec:
   application:
     extraFiles:
       secrets:
         - name: my-npmrc-secret
-          path: /opt/app-root/src/.npmrc.dynamic-plugins
+          mountPath: /opt/app-root/src/.npmrc.dynamic-plugins
           containers:
             - install-dynamic-plugins          
-````
+```

Correct the inconsistent container name in the documentation. The descriptive
text uses install-dynamic-plugin while the YAML example uses
install-dynamic-plugins; they should be consistent.

docs/dynamic-plugins.md [27-38]

-* Mount the Secret to the install-dynamic-plugin container by adding the following to the Backstage CR:
+* Mount the Secret to the install-dynamic-plugins container by adding the following to the Backstage CR:
 

spec:
application:
extraFiles:
secrets:
- name: my-npmrc-secret
path: /opt/app-root/src/.npmrc.dynamic-plugins
containers:
- install-dynamic-plugins

```


`[Suggestion processed]`


<details><summary>Suggestion importance[1-10]: 5</summary>

__

Why: The suggestion correctly identifies a typo in the documentation where the container name in the text (`install-dynamic-plugin`) differs from the YAML example (`install-dynamic-plugins`), which could confuse users.


</details></details></td><td align=center>Low

</td></tr>
<tr><td align="center" colspan="2">

- [ ] Update <!-- /improve_multi --more_suggestions=true -->

</td><td></td></tr></tbody></table>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/dynamic-plugins.md Outdated
Comment thread docs/dynamic-plugins.md Outdated
Comment thread docs/dynamic-plugins.md Outdated
Comment thread docs/dynamic-plugins.md
Comment thread docs/dynamic-plugins.md Outdated

@rm3l rm3l left a comment

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.

/lgtm

@openshift-ci

openshift-ci Bot commented Sep 25, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit d20ac9a into redhat-developer:main Sep 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved documentation Improvements or additions to documentation lgtm Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants