Skip to content

Added 'patches.lock.json' to CLI docker container.#2532

Merged
AlexSkrypnyk merged 2 commits into
mainfrom
feature/add-patches-json-lock-docker
May 30, 2026
Merged

Added 'patches.lock.json' to CLI docker container.#2532
AlexSkrypnyk merged 2 commits into
mainfrom
feature/add-patches-json-lock-docker

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented May 30, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Docker build updated to include additional lock files during image build.
    • Test tooling injection adjusted to align with the updated Docker build COPY pattern.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

Walkthrough

The Docker CLI image COPY instruction now includes patches.lock.*; the PHPUnit test trait’s Dockerfile patch needle was updated to match the altered COPY line so test tooling injection still applies.

Changes

Docker CLI image patches lockfile + test tooling needle

Layer / File(s) Summary
Docker CLI build COPY instruction
.docker/cli.dockerfile
The COPY instruction on line 73 is updated to include patches.lock.* alongside composer.json, composer.*, .env*, and auth* files copied into /app/.
Test tooling Dockerfile patch needle
.vortex/tests/phpunit/Traits/SutTrait.php
The needle used by SutTrait::injectTestingTooling() to locate the COPY ... /app/ line in .docker/cli.dockerfile was adjusted (removing .env* from the matched pattern) so the test-only tooling COPY .tooling-source /app/.tooling-source is inserted at the correct location.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • drevops/vortex#2531: Complements this PR by updating .dockerignore to ensure patches.lock.json is included in the Docker build context so the new COPY instruction can access the file.

Poem

🐰 I hopped through Docker's layered stack,
and nudged a COPY to bring a pack.
Tests adjusted their tiny string,
so tooling still can hop and sing.
Together, builds and tests stay on track.

🚥 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 'Added 'patches.lock.json' to CLI docker container' accurately summarizes the main changes: it specifies what was added (patches.lock.json), where it was added (CLI docker container), and directly relates to the changeset modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-patches-json-lock-docker

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

@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.04%. Comparing base (289dd5a) to head (1c7c544).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2532      +/-   ##
==========================================
- Coverage   86.49%   86.04%   -0.46%     
==========================================
  Files          94       87       -7     
  Lines        4674     4515     -159     
  Branches       47        3      -44     
==========================================
- Hits         4043     3885     -158     
+ Misses        631      630       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/add-patches-json-lock-docker branch from e12636b to 1c7c544 Compare May 30, 2026 11:37

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In @.vortex/tests/phpunit/Traits/SutTrait.php:
- Line 135: The test currently defines $needle = 'COPY composer.json composer.*
patches.lock.* .env* auth* /app/' and uses str_replace to inject content but
doesn't assert the replacement happened; update the replacement logic in
SutTrait (the $needle variable and its str_replace usage) to use the str_replace
variant that returns a replacement count (or use substr_count to detect
occurrences), then assert or throw if the count is zero so the test fails loudly
when the Dockerfile line changes; specifically modify the code that calls
str_replace($needle, $replacement, $dockerfileContents) to capture the $count
and add an assertion like assert($count > 0) or throw a descriptive exception.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6f98433e-210c-44e9-8748-401e1efd3cf2

📥 Commits

Reviewing files that changed from the base of the PR and between e12636b and 1c7c544.

⛔ Files ignored due to path filters (1)
  • .vortex/installer/tests/Fixtures/handler_process/_baseline/.docker/cli.dockerfile is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
  • .vortex/tests/phpunit/Traits/SutTrait.php

if (file_exists($dockerfile_path)) {
$content = (string) file_get_contents($dockerfile_path);
$needle = 'COPY composer.json composer.* .env* auth* /app/';
$needle = 'COPY composer.json composer.* patches.lock.* .env* auth* /app/';

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 | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify that the needle string matches the COPY instruction in cli.dockerfile

# Expected: Find exactly one matching line in .docker/cli.dockerfile
rg -nF 'COPY composer.json composer.* patches.lock.* .env* auth* /app/' .docker/cli.dockerfile

Repository: drevops/vortex

Length of output: 124


Needle matches cli.dockerfile; current str_replace() injection should work

  • The needle COPY composer.json composer.* patches.lock.* .env* auth* /app/ from .vortex/tests/phpunit/Traits/SutTrait.php:135 matches the exact COPY line in .docker/cli.dockerfile (line 73), so the replacement shouldn’t silently miss.
  • To prevent future breakage, avoid silent failure by asserting the replacement occurred (e.g., check str_replace results / count matches) if the Dockerfile line changes.
🤖 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 @.vortex/tests/phpunit/Traits/SutTrait.php at line 135, The test currently
defines $needle = 'COPY composer.json composer.* patches.lock.* .env* auth*
/app/' and uses str_replace to inject content but doesn't assert the replacement
happened; update the replacement logic in SutTrait (the $needle variable and its
str_replace usage) to use the str_replace variant that returns a replacement
count (or use substr_count to detect occurrences), then assert or throw if the
count is zero so the test fails loudly when the Dockerfile line changes;
specifically modify the code that calls str_replace($needle, $replacement,
$dockerfileContents) to capture the $count and add an assertion like
assert($count > 0) or throw a descriptive exception.

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.53% (201/204)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.53% (201/204)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk AlexSkrypnyk merged commit 9e8a14b into main May 30, 2026
31 checks passed
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x May 30, 2026
@AlexSkrypnyk AlexSkrypnyk deleted the feature/add-patches-json-lock-docker branch May 30, 2026 11:53
@AlexSkrypnyk AlexSkrypnyk added this to the 1.39.0 milestone Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released in 1.39.0

Development

Successfully merging this pull request may close these issues.

1 participant