-
Notifications
You must be signed in to change notification settings - Fork 524
fix(docker): add missing spec-parser package.json to base stage #728
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
base: main
Are you sure you want to change the base?
fix(docker): add missing spec-parser package.json to base stage #728
Conversation
The spec-parser library was added to the monorepo but its package.json was not included in the Dockerfile's BASE stage. This causes npm ci to fail during Docker builds with: Cannot find module 'fast-xml-parser' This module is a dependency of @automaker/spec-parser which is used by the server for parsing specification files. The fix adds the COPY instruction alongside the other libs, maintaining the established pattern in the Dockerfile.
Summary of ChangesHello @itsmylife44, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a Docker build failure by ensuring that the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📝 WalkthroughWalkthroughA single line was added to the Dockerfile to copy Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Code Review
This pull request correctly fixes a Docker build failure by adding the missing COPY instruction for the @automaker/spec-parser package's package.json. The change is straightforward and addresses the problem described. I've added one suggestion on the Dockerfile to improve the long-term maintainability of this section and prevent similar issues in the future by using a more robust method for copying package files.
| COPY libs/model-resolver/package*.json ./libs/model-resolver/ | ||
| COPY libs/dependency-resolver/package*.json ./libs/dependency-resolver/ | ||
| COPY libs/git-utils/package*.json ./libs/git-utils/ | ||
| COPY libs/spec-parser/package*.json ./libs/spec-parser/ |
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.
This correctly fixes the build failure. However, this pattern of manually adding a COPY line for each new library is error-prone, as this PR itself demonstrates.
A more maintainable approach would be to use a single command to copy all library package.json files. If you are using Docker BuildKit, you can replace the entire block of COPY instructions (lines 24-31) with a single line. This would automatically handle new libraries in the future.
First, ensure BuildKit is enabled by adding # syntax=docker/dockerfile:1 to the top of your Dockerfile. Then, you can use:
COPY --parents libs/*/package*.json ./If you can't use BuildKit, consider at least sorting the block of COPY commands alphabetically to make it easier to manage.
Summary
Fixes Docker build failure caused by missing
@automaker/spec-parserpackage.json in the Dockerfile's BASE stage.Problem
When building the Docker image,
npm cifails with:This occurs because
@automaker/spec-parserwas added to the monorepo but itspackage.jsonwas not included in the Dockerfile's BASE stage COPY instructions.Solution
Add the missing COPY instruction for
libs/spec-parser/package*.jsonalongside the other library package files.Changes
Dockerfile: AddCOPY libs/spec-parser/package*.json ./libs/spec-parser/to BASE stageTesting
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.