[#2401] Added drupal_helpers, generated_content, and testmode modules#2414
[#2401] Added drupal_helpers, generated_content, and testmode modules#2414AlexSkrypnyk merged 19 commits intomainfrom
Conversation
… with demo integrations.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a Drupal demo module (ys_demo) with Generated Content plugins, an Articles view, deploy hooks, Behat tests, docs, and composer dependencies; updates installer to remove demo-tagged Behat features; and inserts a top-priority rule forbidding compound Bash commands in agent instruction files. Changes
Sequence Diagram(s)sequenceDiagram
participant Deploy as "ys_demo.deploy.php"
participant Helper as "drupal_helpers\Facade"
participant Testmode as "Testmode Service"
participant Drupal as "Drupal (Menu/Config/DB)"
Deploy->>Helper: findItem('main','Articles')
alt not found
Deploy->>Helper: createTree('main', ['Articles'=>'/articles'])
Helper->>Drupal: persist menu link entity
end
Deploy->>Testmode: getInstance(), getNodeViews()
Testmode->>Drupal: read/write testmode config (node views)
Testmode->>Drupal: persist updated config
Deploy->>Drupal: return status string
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.vortex/CLAUDE.md:
- Line 1: Change the first-line heading "## HIGHEST PRIORITY RULE — Bash
Commands" to an H1 by replacing the leading "##" with a single "#" so the
document starts with "# HIGHEST PRIORITY RULE — Bash Commands" to satisfy
markdownlint MD041; ensure no other leading blank lines precede this heading.
In @.vortex/installer/src/Prompts/Handlers/CustomModules.php:
- Around line 236-237: Replace the loose str_contains check with a
token-boundary regex so tags like "@demo2" don't match; instead of
str_contains($first_line, '@demo') use preg_match('/(^|\\s)@demo\\b/',
$first_line) (or an equivalent word-boundary pattern) and only call
File::remove($file) when that preg_match succeeds, referencing the existing
$first_line and File::remove($file) locations.
In `@AGENTS.md`:
- Line 1: The first line of AGENTS.md uses a level-2 header ("## HIGHEST
PRIORITY RULE — Bash Commands") which triggers markdownlint rule MD041; change
that top-level header to an H1 by replacing the "##" with a single "#" so the
document begins with "# HIGHEST PRIORITY RULE — Bash Commands" (update the
header text only, leaving the rest of the file unchanged).
In `@tests/behat/features/articles.feature`:
- Around line 10-17: Add a non-test article row to the "Given article content"
table so the negative assertion proves filtering: update the data table used by
the Given article content step to include a third row with title "Demo article"
(and matching status value used for visible articles, e.g., 1) alongside the two
"[TEST] ..." rows, then keep the existing checks that assert the two test
articles are visible and that "Demo article" is not visible; this ensures the
step definitions that seed articles (the Given article content table and the
titles "[TEST] First test article", "[TEST] Second test article", "Demo
article") are exercised for filtering behavior.
In `@web/modules/custom/ys_demo/ys_demo.deploy.php`:
- Line 85: The in_array call checking for 'ys_demo_articles' in $views should
use strict comparison to avoid type coercion; update the expression in
ys_demo.deploy.php where in_array('ys_demo_articles', $views) is used to include
the third argument true (i.e., in_array('ys_demo_articles', $views, true)) so
the check uses strict === semantics against $views.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e35674bf-5d56-4c7a-8bb8-5947379701dd
⛔ Files ignored due to path filters (103)
.vortex/installer/tests/Fixtures/handler_process/_baseline/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/behat/features/articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/behat/features/counter.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/config/install/views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/sw_demo.deploy.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/sw_demo.info.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/web/modules/custom/sw_demo/config/install/-views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/-Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/-Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/web/modules/custom/sw_demo/config/install/-views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/-Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/-Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/config/install/views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/sw_demo.deploy.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/sw_demo.info.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/web/modules/custom/sw_demo/config/install/-views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/-Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/-Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/config/install/views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/sw_demo.deploy.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/sw_demo.info.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/web/modules/custom/sw_demo/config/install/-views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/-Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/-Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_enabled/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_config_update/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_pathauto/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_redirect/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_none/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/sw_demo/config/install/-views.view.sw_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/-Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/-Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/config/install/views.view.the_force_demo_articles.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/the_force_demo.deploy.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/the_force_demo.info.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_no_redis/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_no_solr/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/services_none/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpmd_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_rector/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_none/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_none/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_none/tests/behat/features/-articles.featureis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (16)
.vortex/CLAUDE.md.vortex/docs/content/drupal/drupal-helpers.mdx.vortex/docs/content/drupal/generated-content.mdx.vortex/docs/content/drupal/module-scaffold.mdx.vortex/docs/content/drupal/test-mode.mdx.vortex/docs/cspell.json.vortex/installer/src/Prompts/Handlers/CustomModules.phpAGENTS.mdcomposer.jsontests/behat/features/articles.featuretests/behat/features/counter.featureweb/modules/custom/ys_demo/config/install/views.view.ys_demo_articles.ymlweb/modules/custom/ys_demo/src/Plugin/GeneratedContent/Node/Article.phpweb/modules/custom/ys_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpweb/modules/custom/ys_demo/ys_demo.deploy.phpweb/modules/custom/ys_demo/ys_demo.info.yml
| @@ -1,3 +1,24 @@ | |||
| ## HIGHEST PRIORITY RULE — Bash Commands | |||
There was a problem hiding this comment.
Fix first-line heading level (MD041).
First line should be an H1 to satisfy markdownlint.
Suggested fix
-## HIGHEST PRIORITY RULE — Bash Commands
+# HIGHEST PRIORITY RULE — Bash Commands🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.vortex/CLAUDE.md at line 1, Change the first-line heading "## HIGHEST
PRIORITY RULE — Bash Commands" to an H1 by replacing the leading "##" with a
single "#" so the document starts with "# HIGHEST PRIORITY RULE — Bash Commands"
to satisfy markdownlint MD041; ensure no other leading blank lines precede this
heading.
| if ($first_line !== FALSE && str_contains($first_line, '@demo')) { | ||
| File::remove($file); |
There was a problem hiding this comment.
Tighten @demo matching to avoid accidental deletions.
str_contains(..., '@demo') also matches tags like @demo2. Use token-boundary matching instead.
Suggested fix
- if ($first_line !== FALSE && str_contains($first_line, '@demo')) {
+ if ($first_line !== FALSE && preg_match('/(^|\s)@demo(\s|$)/', $first_line) === 1) {
File::remove($file);
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if ($first_line !== FALSE && str_contains($first_line, '@demo')) { | |
| File::remove($file); | |
| if ($first_line !== FALSE && preg_match('/(^|\s)@demo(\s|$)/', $first_line) === 1) { | |
| File::remove($file); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.vortex/installer/src/Prompts/Handlers/CustomModules.php around lines 236 -
237, Replace the loose str_contains check with a token-boundary regex so tags
like "@demo2" don't match; instead of str_contains($first_line, '@demo') use
preg_match('/(^|\\s)@demo\\b/', $first_line) (or an equivalent word-boundary
pattern) and only call File::remove($file) when that preg_match succeeds,
referencing the existing $first_line and File::remove($file) locations.
| @@ -1,3 +1,24 @@ | |||
| ## HIGHEST PRIORITY RULE — Bash Commands | |||
There was a problem hiding this comment.
Use a top-level heading on the first line to satisfy markdownlint.
## on the first line triggers MD041; make it an H1.
Suggested fix
-## HIGHEST PRIORITY RULE — Bash Commands
+# HIGHEST PRIORITY RULE — Bash Commands📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## HIGHEST PRIORITY RULE — Bash Commands | |
| # HIGHEST PRIORITY RULE — Bash Commands |
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@AGENTS.md` at line 1, The first line of AGENTS.md uses a level-2 header ("##
HIGHEST PRIORITY RULE — Bash Commands") which triggers markdownlint rule MD041;
change that top-level header to an H1 by replacing the "##" with a single "#" so
the document begins with "# HIGHEST PRIORITY RULE — Bash Commands" (update the
header text only, leaving the rest of the file unchanged).
| Given article content: | ||
| | title | status | | ||
| | [TEST] First test article | 1 | | ||
| | [TEST] Second test article | 1 | | ||
| When I visit "/articles" | ||
| Then I should see "[TEST] First test article" | ||
| And I should see "[TEST] Second test article" | ||
| And I should not see "Demo article" |
There was a problem hiding this comment.
Scenario does not prove filtering of non-test content.
This test never seeds a non-test article, so I should not see "Demo article" can pass trivially and miss regressions in testmode filtering.
Suggested fix
Given article content:
| title | status |
| [TEST] First test article | 1 |
| [TEST] Second test article | 1 |
+ | Demo article | 1 |
When I visit "/articles"
Then I should see "[TEST] First test article"
And I should see "[TEST] Second test article"
And I should not see "Demo article"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Given article content: | |
| | title | status | | |
| | [TEST] First test article | 1 | | |
| | [TEST] Second test article | 1 | | |
| When I visit "/articles" | |
| Then I should see "[TEST] First test article" | |
| And I should see "[TEST] Second test article" | |
| And I should not see "Demo article" | |
| Given article content: | |
| | title | status | | |
| | [TEST] First test article | 1 | | |
| | [TEST] Second test article | 1 | | |
| | Demo article | 1 | | |
| When I visit "/articles" | |
| Then I should see "[TEST] First test article" | |
| And I should see "[TEST] Second test article" | |
| And I should not see "Demo article" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/behat/features/articles.feature` around lines 10 - 17, Add a non-test
article row to the "Given article content" table so the negative assertion
proves filtering: update the data table used by the Given article content step
to include a third row with title "Demo article" (and matching status value used
for visible articles, e.g., 1) alongside the two "[TEST] ..." rows, then keep
the existing checks that assert the two test articles are visible and that "Demo
article" is not visible; this ensures the step definitions that seed articles
(the Given article content table and the titles "[TEST] First test article",
"[TEST] Second test article", "Demo article") are exercised for filtering
behavior.
| $testmode = Testmode::getInstance(); | ||
|
|
||
| $views = $testmode->getNodeViews(); | ||
| if (!in_array('ys_demo_articles', $views)) { |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Use strict comparison with in_array().
The in_array() call lacks the third $strict parameter. While this works correctly for string arrays, using strict comparison is a best practice to prevent unexpected type coercion issues.
Suggested fix
- if (!in_array('ys_demo_articles', $views)) {
+ if (!in_array('ys_demo_articles', $views, TRUE)) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (!in_array('ys_demo_articles', $views)) { | |
| if (!in_array('ys_demo_articles', $views, TRUE)) { |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/modules/custom/ys_demo/ys_demo.deploy.php` at line 85, The in_array call
checking for 'ys_demo_articles' in $views should use strict comparison to avoid
type coercion; update the expression in ys_demo.deploy.php where
in_array('ys_demo_articles', $views) is used to include the third argument true
(i.e., in_array('ys_demo_articles', $views, true)) so the check uses strict ===
semantics against $views.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.vortex/installer/src/Prompts/Handlers/CustomModules.php:
- Around line 206-227: The method removeDemoBehatFeatures currently uses
File::findContainingInDir which does loose substring matching; change the
implementation to filter files using a word-boundary regex (e.g.
preg_match('/@demo\b/', $contents)) so tags like `@demo2` won't match, and update
the method docblock to accurately state that files are scanned for the `@demo` tag
anywhere in the file (not just the first line); reference the
removeDemoBehatFeatures method and File::findContainingInDir/ File::remove when
making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 91e8fa07-e5de-449d-bc0f-b7a835ecefd6
⛔ Files ignored due to path filters (11)
.vortex/installer/tests/Fixtures/handler_process/_baseline/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_none/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (3)
.vortex/CLAUDE.md.vortex/installer/src/Prompts/Handlers/CustomModules.phpAGENTS.md
| /** | ||
| * Remove Behat feature files tagged with @demo. | ||
| * | ||
| * Scans the Behat features directory for .feature files whose first line | ||
| * contains the @demo tag and removes them. | ||
| * | ||
| * @param string $dir | ||
| * The base directory to search in. | ||
| */ | ||
| protected static function removeDemoBehatFeatures(string $dir): void { | ||
| $features_dir = $dir . '/tests/behat/features'; | ||
|
|
||
| if (!is_dir($features_dir)) { | ||
| return; | ||
| } | ||
|
|
||
| $files = File::findContainingInDir($features_dir, '@demo'); | ||
|
|
||
| foreach ($files as $file) { | ||
| File::remove($file); | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify File::findContainingInDir implementation for matching behavior
# Find the File utility class
fd -t f "File.php" --exec grep -l "findContainingInDir" {} \;
# Show the implementation
ast-grep --pattern $'function findContainingInDir($$$) {
$$$
}'
# Alternative: search for the method implementation with context
rg -n -A 30 'function findContainingInDir' --type phpRepository: drevops/vortex
Length of output: 40
🏁 Script executed:
# First, let's look at the CustomModules.php file to understand the context
cat -n ".vortex/installer/src/Prompts/Handlers/CustomModules.php" | head -50Repository: drevops/vortex
Length of output: 1582
🏁 Script executed:
# Search for File class references in the codebase
rg -n "class File" --type phpRepository: drevops/vortex
Length of output: 40
🏁 Script executed:
# Search for findContainingInDir method anywhere in the repository
rg -n "findContainingInDir" --type phpRepository: drevops/vortex
Length of output: 40
🏁 Script executed:
# Check imports in CustomModules.php
rg -n "use.*File" ".vortex/installer/src/Prompts/Handlers/CustomModules.php"Repository: drevops/vortex
Length of output: 99
🏁 Script executed:
# Find the File.php in the Utils directory
fd -t f "File.php" -p "*Utils*"Repository: drevops/vortex
Length of output: 152
🏁 Script executed:
# List all methods in the File class
find ".vortex/installer/src/Utils" -name "File.php" -exec cat {} \;Repository: drevops/vortex
Length of output: 3574
🏁 Script executed:
# Search for all method definitions in File class
rg -n "public|protected|private" ".vortex/installer/src/Utils/File.php" | grep -E "(function|public|protected|private)"Repository: drevops/vortex
Length of output: 542
🌐 Web query:
AlexSkrypnyk\File\File findContainingInDir method documentation
💡 Result:
AlexSkrypnyk\File\File::findContainingInDir() (package alexskrypnyk/file) finds all files under a directory whose contents contain a given string/regex (it delegates the per-file check to File::contains()). (raw.githubusercontent.com)
Signature
public static function findContainingInDir(
string $directory,
string $needle,
array $excluded = []
): arrayParameters
$directory: directory to search in. (raw.githubusercontent.com)$needle: string (or regex, as supported byFile::contains()) to search for in file contents. (raw.githubusercontent.com)$excluded: extra paths to exclude from the recursive scan. (raw.githubusercontent.com)
Return
array: list of file paths whose contents match$needle. (raw.githubusercontent.com)
Citations:
- 1: https://raw.githubusercontent.com/AlexSkrypnyk/file/main/src/File.php
- 2: https://raw.githubusercontent.com/AlexSkrypnyk/file/main/src/File.php
- 3: https://raw.githubusercontent.com/AlexSkrypnyk/file/main/src/File.php
- 4: https://raw.githubusercontent.com/AlexSkrypnyk/file/main/src/File.php
- 5: https://raw.githubusercontent.com/AlexSkrypnyk/file/main/src/File.php
- 6: https://raw.githubusercontent.com/AlexSkrypnyk/file/main/src/File.php
🌐 Web query:
AlexSkrypnyk\File\File::contains() method string matching behavior
💡 Result:
AlexSkrypnyk\File\File::contains($file, $needle) behaves like this:
- If
$filedoesn’t exist or isn’t readable, it returnsfalse. Also returnsfalseif the file content is''or exactly'0'. [1] - If
$needleis detected as a regex (string starts with a common PCRE delimiter/ # ~ @ %, ends with the same delimiter, may have modifiers, and successfully compiles), it doespreg_match($needle, $content)and returns whether it matched anywhere in the file. [1][2] - Otherwise it does a plain substring check via PHP
str_contains($content, $needle)(case-sensitive, no wildcard/pattern semantics). [1]
Sources: [1] [2]
Fix docblock and add word-boundary validation for @demo tag matching.
Two issues confirmed:
-
Loose substring matching:
File::findContainingInDir('@demo')usesstr_contains()internally, which will match@demo2,@demo_feature, or any other tag containing@demoas a substring. Use a regex pattern like/@demo\b/to restrict matching to word boundaries. -
Docblock inaccuracy: The docblock states the method checks "whose first line contains the
@demotag," butFile::findContainingInDirsearches the entire file without first-line restriction. Either correct the docblock or add explicit first-line checking before passing to the utility method.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.vortex/installer/src/Prompts/Handlers/CustomModules.php around lines 206 -
227, The method removeDemoBehatFeatures currently uses File::findContainingInDir
which does loose substring matching; change the implementation to filter files
using a word-boundary regex (e.g. preg_match('/@demo\b/', $contents)) so tags
like `@demo2` won't match, and update the method docblock to accurately state that
files are scanned for the `@demo` tag anywhere in the file (not just the first
line); reference the removeDemoBehatFeatures method and
File::findContainingInDir/ File::remove when making the change.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/modules/custom/ys_demo/src/Plugin/GeneratedContent/Node/Article.php`:
- Line 21: Add a PHP docblock above the protected const TOTAL in the Article
class describing what the constant means and its type (int) for consistency with
other constants like TAGS; locate the TOTAL declaration in the Article.php
Plugin/GeneratedContent/Node class and add a short docblock (e.g., "/** Total
number of items to generate. `@var` int */") immediately above the protected const
TOTAL = 20; so it matches the style used for TAGS.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: dbbc1980-cdc8-4465-8397-f1cb4d233f99
⛔ Files ignored due to path filters (18)
.vortex/installer/tests/Fixtures/handler_process/_baseline/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/src/Plugin/GeneratedContent/Node/Article.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_none/AGENTS.mdis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (4)
.vortex/CLAUDE.mdAGENTS.mdweb/modules/custom/ys_demo/src/Plugin/GeneratedContent/Node/Article.phpweb/modules/custom/ys_demo/src/Plugin/GeneratedContent/Taxonomy/Tags.php
| )] | ||
| class Article extends GeneratedContentPluginBase { | ||
|
|
||
| protected const TOTAL = 20; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Add a docblock for the TOTAL constant for consistency.
The TAGS constant in Tags.php has a docblock, but TOTAL here does not. Consider adding one for consistency.
📝 Suggested docblock
+ /**
+ * Total number of articles to generate.
+ */
protected const TOTAL = 20;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| protected const TOTAL = 20; | |
| /** | |
| * Total number of articles to generate. | |
| */ | |
| protected const TOTAL = 20; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@web/modules/custom/ys_demo/src/Plugin/GeneratedContent/Node/Article.php` at
line 21, Add a PHP docblock above the protected const TOTAL in the Article class
describing what the constant means and its type (int) for consistency with other
constants like TAGS; locate the TOTAL declaration in the Article.php
Plugin/GeneratedContent/Node class and add a short docblock (e.g., "/** Total
number of items to generate. `@var` int */") immediately above the protected const
TOTAL = 20; so it matches the style used for TAGS.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…aintain coverage threshold.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2414 +/- ##
==========================================
- Coverage 79.41% 78.93% -0.48%
==========================================
Files 126 119 -7
Lines 6724 6571 -153
Branches 44 0 -44
==========================================
- Hits 5340 5187 -153
Misses 1384 1384 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
New Features
Documentation
Tests
Chores