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

build: copy from node_modules using NPM postinstall hook, not Paver (RE-MERGE) #32767

Merged

Conversation

kdmccormick
Copy link
Member

This is a fixed version of #32717, which we reverted in #32766.

First commit is the same as the original PR. See that PR for details & testing info.

Second commit contains the fixes. You can test the fix simply by running make docker_build in the edx-platform root. If the build succeeds then all is well.

@kdmccormick
Copy link
Member Author

@regisb , would you be able to review both this and the related Tutor PR? overhangio/tutor#872

It's just a fix to the node_modules copy postinstall hook that you reviewed last week.

If they look good to you, feel free to merge both PRs.

@kdmccormick kdmccormick force-pushed the kdmccormick/copy-node-modules-2 branch 2 times, most recently from 751d837 to b36aab4 Compare July 18, 2023 16:55
Dockerfile Outdated
@@ -117,6 +117,7 @@ RUN pip install -r requirements/edx/base.txt

# Install node and node modules
RUN nodeenv /edx/app/edxapp/nodeenv --node=16.14.0 --prebuilt
COPY scripts/copy-node-modules.sh scripts
Copy link
Contributor

@davidjoy davidjoy Jul 20, 2023

Choose a reason for hiding this comment

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

Is it weird that we're copying node modules before we've installed the right version of npm and run npm ci? Not quite following that ordering...

Copy link
Member Author

@kdmccormick kdmccormick Jul 20, 2023

Choose a reason for hiding this comment

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

@davidjoy it's not weird, but I can certainly see why it reads weirdly. I've shifted this statement to be after npm install npm (it's arbitrary, but I think it reads better now) and I've added a comment explaining why the statement must come before npm ci. Let me know if that doesn't makes things clearer!

Copy link
Contributor

Choose a reason for hiding this comment

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

OH. Duh, I didn't read carefully enough that that was a COPY. I get it. 👍🏻

@kdmccormick kdmccormick force-pushed the kdmccormick/copy-node-modules-2 branch from b36aab4 to b1631fc Compare July 20, 2023 16:45
…RE-MERGE)

Re-merge of 4b64d83

The commit after this one contains the fix for the issue that led to the
revert.
Two fixes:

* In the (in-repo, non-Tutor) Dockerfile, add copy-node-modules.sh
  before `npm install`, since it is needed by the new postinstall hook.

* In paver/assets.py, run copy-node-modules.sh for backwards com-
  patibility, just for cases where `SKIP_NPM_INSTALL` is enabled
  (which would prevent our new postinstall hook from running
  automatically!). We will deprecate the paver asset commands all at
  once once the new non-paver stuff is 100% working.
@kdmccormick kdmccormick force-pushed the kdmccormick/copy-node-modules-2 branch from b1631fc to fd8e5e5 Compare July 20, 2023 17:03
@kdmccormick kdmccormick merged commit fb5383a into openedx:master Jul 20, 2023
42 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/copy-node-modules-2 branch July 20, 2023 17:46
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants