Skip to content

build(docker): multi-stage build for a slimmer image#227

Open
rerowep wants to merge 1 commit into
rero:stagingfrom
rerowep:wep-fixes
Open

build(docker): multi-stage build for a slimmer image#227
rerowep wants to merge 1 commit into
rero:stagingfrom
rerowep:wep-fixes

Conversation

@rerowep

@rerowep rerowep commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
  • Split Dockerfile into a builder stage (gcc, Node.js, git, uv) and a python:3.14-slim-bookworm runtime stage with no compilers or Node
  • Shrinks the shipped image from 17.7GB to 4.59GB against the same base
  • Dockerfile.base: merge the two apt-get blocks and drop the dangling apt cache left behind after installing Node
  • extensions/deleted.py: log a warning when a dangling $ref is tolerated instead of silently swallowing it on every commit/create

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of invalid or dangling record references during deleted-state processing.
    • Added warnings when a referenced source cannot be resolved, while preserving existing deletion behavior.

@rerowep
rerowep requested a review from PascalRepond July 7, 2026 15:02
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rerowep, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 733bde31-9b4e-44b5-b0ec-a5346e1b2995

📥 Commits

Reviewing files that changed from the base of the PR and between 7ef4e83 and bd202b9.

⛔ Files ignored due to path filters (2)
  • Dockerfile is excluded by none and included by none
  • Dockerfile.base is excluded by none and included by none
📒 Files selected for processing (2)
  • rero_mef/extensions/deleted.py
  • tests/unit/test_extensions_deleted.py
📝 Walkthrough

Walkthrough

The deleted-state extension now initializes a module logger and warns when dangling $ref links cause unresolved source data during propagation. Existing behavior remains unchanged by treating the deleted value as None.

Changes

Deleted-state observability

Layer / File(s) Summary
Warning and fallback handling
rero_mef/extensions/deleted.py
Adds a module logger and records entity, record type, and PID details for dangling references while preserving the existing deleted=None fallback.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

  • rero/rero-mef#226: Updates the same deleted-state propagation path to handle dangling $ref resolutions defensively.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a multi-stage Docker build to produce a slimmer image.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@coveralls

coveralls commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 87.312% (+0.006%) from 87.306% — rerowep:wep-fixes into rero:staging

Comment thread Dockerfile.base
@rerowep
rerowep force-pushed the wep-fixes branch 2 times, most recently from 9c6b08c to 7ef4e83 Compare July 14, 2026 06:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
rero_mef/extensions/deleted.py (1)

42-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a regression test for the warning

The existing dangling-reference tests verify fallback behavior but not this new observability contract. Add a caplog assertion covering the entity name, record type, and PID so future changes cannot silently remove or corrupt the warning.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rero_mef/extensions/deleted.py` around lines 42 - 45, Add a regression test
to the existing dangling-reference test suite covering the warning emitted by
the deleted-record handling path. Use caplog to assert the warning includes the
entity name, record type, and PID, while preserving the existing fallback
behavior assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@rero_mef/extensions/deleted.py`:
- Around line 42-45: Add a regression test to the existing dangling-reference
test suite covering the warning emitted by the deleted-record handling path. Use
caplog to assert the warning includes the entity name, record type, and PID,
while preserving the existing fallback behavior assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf3c1a8b-217c-4e00-b5f5-0f5d992d7fad

📥 Commits

Reviewing files that changed from the base of the PR and between 4551a1b and 7ef4e83.

⛔ Files ignored due to path filters (2)
  • Dockerfile is excluded by none and included by none
  • Dockerfile.base is excluded by none and included by none
📒 Files selected for processing (1)
  • rero_mef/extensions/deleted.py

* Split Dockerfile into a builder stage (gcc, Node.js, git, uv) and a
  python:3.14-slim-bookworm runtime stage with no compilers or Node
* Shrinks the shipped image from 17.7GB to 4.59GB against the same base
* Dockerfile.base: merge the two apt-get blocks and drop the dangling
  apt cache left behind after installing Node
* extensions/deleted.py: log a warning when a dangling $ref is
  tolerated instead of silently swallowing it on every commit/create

Co-Authored-by: Peter Weber <peter.weber@rero.ch>
@rerowep
rerowep marked this pull request as ready for review July 14, 2026 06:28
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.

3 participants