[Code scan] Make the build hook fail when Yarn commands fail
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- node.js, python
- Domain
- build-system
Research direction
Start with hatch_build.py, especially node_call and the build-hook code around the referenced lines. Check how yarn install and yarn build results are handled, then verify that failed commands stop packaging and that stale dist contents are not reused; inspect the existing build flow to confirm the behavior.
Written by the indexing model from the issue text.
Description
This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3
Problem
The custom Hatch build hook invokes Yarn through subprocess.call(), but it never checks the return code.
Code references:
https://github.com/deepmodeling/dpgui/blob/e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3/hatch_build.py#L13-L15
https://github.com/deepmodeling/dpgui/blob/e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3/hatch_build.py#L30-L48
Relevant snippet:
def node_call(args, **kwargs):
"""Call node with subprocess."""
return subprocess.call(["node", *args], **kwargs)
Impact
A failed yarn install or yarn build can continue until only dist existence is checked. If dist already exists from a previous build, packaging can copy stale frontend assets into dpgui/dist.
Suggested fix
Use subprocess.check_call() or explicitly raise on nonzero return codes. It would also be safer to clean the root dist before running the frontend build.
- Dominant language
- Vue
- Stars
- 9
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepmodeling/dpgui
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepmodeling/dpgui#567 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
deepmodeling/dpgui#566 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepmodeling/dpgui#564 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepmodeling/dpgui#563 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepmodeling/dpgui#560 ·
All issues in deepmodeling/dpgui
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
agentic-workflows cascade-suspected
Difficulty 1/5 Under an hour Newbie friendliness 88/100