-
Notifications
You must be signed in to change notification settings - Fork 3
chore: add NPM aliases installation to deployment process #230
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
chore: add NPM aliases installation to deployment process #230
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.
Pull Request Overview
This PR adds NPM aliases installation to the deployment process for the edxapp role. It allows for installing NPM packages with specific aliasing to support package name mapping during deployment.
- Adds a new Ansible task to install NPM aliases using a configurable dictionary
- Introduces default configuration for NPM aliases with an example mapping for @edx/brand
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
playbooks/roles/edxapp/tasks/deploy.yml | Adds new task to install NPM aliases from configurable dictionary |
playbooks/roles/edxapp/defaults/main.yml | Defines default NPM_ALIASES configuration with @edx/brand example |
Comments suppressed due to low confidence (2)
playbooks/roles/edxapp/defaults/main.yml:1138
- The variable name NPM_ALIASES uses inconsistent naming convention. It should follow the pattern of other variables in this file and be named 'EDXAPP_NPM_ALIASES' to maintain consistency with the module prefix.
NPM_ALIASES:
playbooks/roles/edxapp/tasks/deploy.yml:324
- The variable reference NPM_ALIASES should be updated to match the consistent naming convention. If the variable is renamed to EDXAPP_NPM_ALIASES, this reference should be updated accordingly.
with_dict: "{{ NPM_ALIASES }}"
shell: > | ||
npm install {{ item.key }}@{{ item.value }} --no-save | ||
args: | ||
chdir: "{{ edxapp_code_dir }}" |
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.
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'
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.
|
@@ -314,6 +314,18 @@ | |||
- install | |||
- install:app-requirements | |||
|
|||
- name: Install NPM aliases |
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.
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
Description
This PR replaces brand-edx.org with openedx theme and adds it to the package file indirectly via aliasing.
Supporting information
Issue Link: edx/edx-arch-experiments#943
private JIRA link:
https://2u-internal.atlassian.net/browse/BOMS-101
Related PR:
openedx/edx-platform#37105