Skip to content

Conversation

@Guiorgy
Copy link
Contributor

@Guiorgy Guiorgy commented Nov 20, 2025

In the Dockerfile in the app-builder stage the .git directory is copied:

COPY .git .git

And then later in the same stage it is supposedly removed:

# Build the JS vendor code in the app-builder, and then remove the vendor source.
RUN export CPPFLAGS="-DPNG_ARM_NEON_OPT=0" && \
    npm install -g corepack && \
    ... # skipped for brevity
    rm -rf node_modules \
           ... # skipped for brevity, attention to below VVV
           /pgadmin4/.git

I say supposedly, because the .git directory is copied into the filesystem root directory (/), whereas, the rest of the project files are inside the pgadmin4 directory, and the later command expects the .git directory to be inside it. Clearly a mistake, it was supposed to be copied into /pgadmin4/.git.

Using docker build --target app-builder --tag "pgadmin4:app-builder-stage" . to only build and export this stage, and then dive pgadmin4:app-builder-stage to explore the layers, I confirmed that:

Screanshot of the output of dive

With that being said, is the .git directory even needed during the build process? If not, it would be better to completely omit the copy to save on having to copy more than 366 MB (the size of .git as of writing) into the Docker image each time, which takes some time.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed application deployment process to ensure proper file handling during build and installation, improving reliability and consistency across environments.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

Modified the Dockerfile's COPY instruction to place the .git directory at /pgadmin4/.git instead of the root .git path, ensuring alignment with subsequent build steps that reference the pgadmin4-specific path.

Changes

Cohort / File(s) Change Summary
Docker build configuration
Dockerfile
Updated COPY instruction to target /pgadmin4/.git instead of .git at root, aligning with downstream cleanup and build step references

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Verify the path change aligns with all downstream references to /pgadmin4/.git in build and cleanup steps
  • Confirm the .git directory is correctly positioned for any subsequent build or runtime operations

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: fixing the .git copy destination in the Dockerfile to target /pgadmin4/.git instead of the root.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Guiorgy
Copy link
Contributor Author

Guiorgy commented Nov 20, 2025

The only possible benefit to copying the .git directory in the build process, that I can see, is to get and store the git revision/hash, but even that has much better ways of handling, such as passing it from the host as a build argument. do we really need to be copying the whole .git directory into the image? It wasn't even being correctly copied until now anyway :D

PS. Gotta love flaky tests :P

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.

1 participant