Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reproduce 1301 #1304

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Reproduce 1301 #1304

merged 2 commits into from
Jul 2, 2024

Conversation

suyono3484
Copy link
Contributor

Monika Pull Request (PR)

What feature/issue does this PR add

  1. Issue-1301

How did you implement / how did you fix it

  1. Added a line in the .dockerignore file to prevent packages/notification/node_modules from being copied into the docker container build stage. Please refer to the explanation below
  2. Added command to add python3, py3-setuptools, make, and gcc as the dependencies of sqlite3 rebuilding needed by monika notifications.

How to test

  1. Clone the project
  2. Issue a npm run build -w packages/notification/ to build dependencies packages
  3. Issue a npm ci to pull dependencies
  4. Issue a make docker at the project root

Explanation

The line and .dockerignore file allow the content of packages/notification/node_modules directory on the host to be copied into the docker container build stage which in this case is using alpine while the host is not. As you can see in the following log snippet

15.10  ›   ModuleLoadError Plugin: @hyperjumptech/monika: [MODULE_NOT_FOUND] require
15.10  ›   failed to load /monika/lib/commands/monika.js: Cannot find module
15.10  ›   '/monika/packages/notification/node_modules/sqlite3/lib/binding/napi-v6-li
15.10  ›   nux-musl-x64/node_sqlite3.node'
15.10  ›   Require stack:
15.10  ›   -
15.10  ›   /monika/packages/notification/node_modules/sqlite3/lib/sqlite3-binding.js
15.10  ›   - /monika/packages/notification/node_modules/sqlite3/lib/sqlite3.js

In the snippet, we can see that it failed to load a module. The clue comes from the module path, it contains linux-musl-x64. It means the module has a native compilation part, which in this case uses musl instead of glibc. Native binaries compiled against different libc won't mix.

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.56%. Comparing base (6a29470) to head (76d7138).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1304      +/-   ##
==========================================
+ Coverage   62.51%   63.56%   +1.04%     
==========================================
  Files         112      109       -3     
  Lines        3391     3417      +26     
  Branches      591      583       -8     
==========================================
+ Hits         2120     2172      +52     
+ Misses       1079     1059      -20     
+ Partials      192      186       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dennypradipta dennypradipta left a comment

Choose a reason for hiding this comment

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

It works as intended.

@dennypradipta dennypradipta merged commit eaa3107 into hyperjumptech:main Jul 2, 2024
8 checks passed
@suyono3484 suyono3484 deleted the reproduce-1301 branch August 12, 2024 01:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants