enhancement: Moved all javascript package managers under /javascript for consolidation#1591
Conversation
There was a problem hiding this comment.
Code Review
This pull request reorganizes the codebase by consolidating JavaScript-related package managers (npm, yarn, yarn_classic, and metayarn) under a new hermeto/core/package_managers/javascript/ directory, updating all relevant imports and mock patches. Feedback on this PR points out that the corresponding unit test files and directories have not been relocated to match this new structure. Moving these tests under tests/unit/package_managers/javascript/ is recommended to maintain a consistent code structure across the codebase.
| @@ -5,18 +5,18 @@ | |||
|
|
|||
| from hermeto.core.errors import PackageRejected | |||
| from hermeto.core.models.input import Request | |||
| from hermeto.core.package_managers.metayarn import fetch_yarn_source | |||
| from hermeto.core.package_managers.yarn_classic.main import NotV1Lockfile | |||
| from hermeto.core.package_managers.javascript.metayarn import fetch_yarn_source | |||
There was a problem hiding this comment.
The package managers npm, yarn, yarn_classic, and metayarn have been consolidated under hermeto/core/package_managers/javascript/. However, their corresponding unit tests (e.g., tests/unit/package_managers/test_metayarn.py, tests/unit/package_managers/npm/, tests/unit/package_managers/yarn/, and tests/unit/package_managers/yarn_classic/) have not been moved under tests/unit/package_managers/javascript/. To maintain a consistent code structure across the whole codebase, please relocate these test files/directories to match the new package manager structure.
References
- Maintain a consistent code structure across the whole code base (link)
|
@mohamedbouchtout please make sure every single commit passes both linters and unit tests, i.e. |
fc580a3 to
09f6f69
Compare
|
I believe the first six commits should be combined with the other six. |
|
@slimreaper35 So maybe squash like commit 1, 5, and 9 which would include "Moved npm package manager and it's unit tests under the /javascript folder; updates it's import paths to new location". And do the same with the rest which will bring it down to 4 commit? |
For example, the first commit moves the whole |
09f6f69 to
34a7c93
Compare
Yes, the backend changes should be paired with the corresponding unit test changes in a single commit and we should be good (always verify with |
…lder; updated import paths Moved the NPM package manager and it's unit tests to the /javascript folder as part of the efforts to consolidate all javascript package managers. Updated all import paths accordingly. Signed-off-by: Mohamed Bouchtout <mbouchto@redhat.com>
…older; updated import paths Moved the yarn package manager and it's unit tests to the /javascript folder as part of the efforts to consolidate all javascript package managers. Updated all import paths accordingly. Signed-off-by: Mohamed Bouchtout <mbouchto@redhat.com>
…/javascript folder; updated import paths Moved the yarn_classic package manager and it's unit tests to the /javascript folder as part of the efforts to consolidate all javascript package managers. Updated all import paths accordingly. Signed-off-by: Mohamed Bouchtout <mbouchto@redhat.com>
…ckage managers; updated import paths Moved the metayarn.py file and it's unit test to the /javascript folder as part of the efforts to consolidate all javascript package managers. Updated all import paths accordingly. Signed-off-by: Mohamed Bouchtout <mbouchto@redhat.com>
34a7c93 to
7046690
Compare
I agree, so we don't have redundant commits. I've squashed the commits together and updated their message. |
|
@mohamedbouchtout there are some merge conflicts here (not a coincidence since there's active work on the pnpm backend going on) that need resolving. |
Summery
Moved the package managers npm, yarn, yarn_classic and metayarn.py file under hermeto/core/package_managers/javascript as mentioned in this issue. Then also updated all imports path for each of the relocated files throughout the project. Also moved their unit tests under the /javascript folder to match.
Details