Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions playbooks/roles/edxapp/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ edxapp_npm_bin: "{{ edxapp_npm_dir }}/bin"
edxapp_settings: '{{ EDXAPP_SETTINGS }}'
EDXAPP_NODE_VERSION: "20"
EDXAPP_NPM_VERSION: "10.7.0"
NPM_ALIASES:
"@edx/brand": "npm:@edx/brand-edx.org@^2.1.3"
# This is where node installs modules, not node itself
edxapp_node_bin: "{{ edxapp_code_dir }}/node_modules/.bin"
edxapp_user: edxapp
Expand Down
12 changes: 12 additions & 0 deletions playbooks/roles/edxapp/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,18 @@
- install
- install:app-requirements

- name: Install NPM aliases

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.

There can be a minor comment just above the whole task here for explaining why this task is needed.

Something along the lines of

This task is added as part of changes done for PR_LINK

shell: >
npm install {{ item.key }}@{{ item.value }} --no-save
args:
chdir: "{{ edxapp_code_dir }}"
Comment on lines +318 to +321

Copilot AI Aug 5, 2025

Copy link

Choose a reason for hiding this comment

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

Using the 'shell' module for npm commands is discouraged. Consider using the 'npm' module instead, which provides better error handling and idempotency: 'npm: name={{ item.key }}@{{ item.value }} path={{ edxapp_code_dir }} state=present'

Suggested change
shell: >
npm install {{ item.key }}@{{ item.value }} --no-save
args:
chdir: "{{ edxapp_code_dir }}"
npm:
name: "{{ item.key }}@{{ item.value }}"
path: "{{ edxapp_code_dir }}"
state: present

Copilot uses AI. Check for mistakes.
environment: "{{ edxapp_environment | combine(git_ssh_environment_mixin) }}"
become_user: "{{ edxapp_user }}"
with_dict: "{{ NPM_ALIASES }}"
tags:
- install
- install:app-requirements

# The next few tasks set up the python code sandbox

# need to disable this profile, otherwise the pip inside the sandbox venv has no permissions
Expand Down