Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jun 2, 2025

#1671

Summary by CodeRabbit

  • New Features

    • Added support for provisioning and configuring Lagoon-based database environments, including new configuration files and environment-specific settings.
    • Introduced automated Lagoon environment removal via GitHub Actions when pull requests are closed.
    • Enhanced environment detection and configuration for Lagoon hosting in Drupal projects.
    • Added documentation and onboarding instructions for Lagoon integration and deployment workflows.
  • Bug Fixes

    • Improved YAML content processing to collapse empty lines within literal blocks, ensuring cleaner configuration files.
  • Tests

    • Expanded test coverage for Lagoon environment detection, configuration, and YAML content processing.

@coderabbitai
Copy link

coderabbitai bot commented Jun 2, 2025

Walkthrough

This change introduces a new method to collapse empty lines specifically within YAML literal blocks and integrates it into the file content processing flow. It also adds extensive new configuration files, documentation, and tests to support and verify Lagoon-based database provisioning environments, including CI workflows, environment settings, and onboarding instructions.

Changes

Files/Paths Summary
.vortex/installer/src/Prompts/Handlers/Internal.php, .vortex/installer/src/Utils/File.php Added YAML literal block empty line collapsing logic and integrated it into content processing.
.vortex/installer/tests/Unit/FileTest.php Added unit tests for the new YAML literal block empty line collapsing method.
.vortex/installer/tests/Functional/InstallTest.php Added new test scenario for provision type "database" with hosting provider "lagoon".
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/**/* Introduced new Lagoon-specific fixture: Docker Compose, environment/config files, Lagoon YAML, Drush site config, workflow, onboarding and deployment docs, and test cases for Lagoon environment detection and settings.

Sequence Diagram(s)

sequenceDiagram
    participant Internal as Internal::process()
    participant File as File
    Internal->>File: replaceContentAsync(file, callback)
    File-->>Internal: Reads file content
    Internal->>File: collapseEmptyLines(content)
    Internal->>File: collapseYamlEmptyLinesInLiteralBlocks(content)
    File-->>Internal: Returns processed content
    Internal->>File: Writes processed content back to file
Loading

Possibly related PRs

Suggested labels

PR: Needs review

Poem

In YAML fields where pipes reside,
Empty lines no longer hide.
Lagoon arrives with docs and tests,
Provisioning flows put to the quest.
With each new script and config file,
The rabbit hops another mile.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot temporarily deployed to commit June 2, 2025 00:30 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 17

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54a56d6 and b8c1ba6.

📒 Files selected for processing (17)
  • .vortex/installer/src/Prompts/Handlers/Internal.php (1 hunks)
  • .vortex/installer/src/Utils/File.php (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.dockerignore (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.env (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.github/workflows/close-pull-request.yml (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.ignorecontent (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.lagoon.yml (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/CLAUDE.md (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/README.md (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docker-compose.yml (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/deployment.md (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/drush/sites/lagoon.site.yml (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php (1 hunks)
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/web/sites/default/includes/providers/settings.lagoon.php (1 hunks)
  • .vortex/installer/tests/Functional/InstallTest.php (1 hunks)
  • .vortex/installer/tests/Unit/FileTest.php (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
.vortex/installer/src/Utils/File.php (1)
Learnt from: AlexSkrypnyk
PR: drevops/vortex#1693
File: .vortex/installer/src/Prompts/Handlers/Internal.php:52-52
Timestamp: 2025-06-01T08:10:15.903Z
Learning: The File utility class in .vortex/installer/src/Utils/File.php extends AlexSkrypnyk\File\File, and methods like collapseRepeatedEmptyLines() are available from this external parent class dependency.
🧬 Code Graph Analysis (1)
.vortex/installer/src/Prompts/Handlers/Internal.php (1)
.vortex/installer/src/Utils/File.php (2)
  • File (10-115)
  • collapseYamlEmptyLinesInLiteralBlocks (111-113)
🪛 LanguageTool
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md

[uncategorized] ~17-~17: You might be missing the article “the” here.
Context: ...account and adding a project through UI.

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/README.md

[style] ~2-~2: In American English, abbreviations like “etc.” require a period.
Context: ...re shut down (Apache/Nginx, Mysql, MAMP etc). - Checkout project repository (in on...

(ETC_PERIOD)

🪛 markdownlint-cli2 (0.17.2)
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md

1-1: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


2-2: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


3-3: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


4-4: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


6-6: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


6-6: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


6-6: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


7-7: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


7-7: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


8-8: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


8-8: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


11-11: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


11-11: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


12-12: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


12-12: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


14-14: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


14-14: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


15-15: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


16-16: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


16-16: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


16-16: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


18-18: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/README.md

1-1: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


2-2: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


2-2: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


3-3: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


4-4: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


6-6: Unordered list style
Expected: dash; Actual: plus

(MD004, ul-style)


6-6: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


7-7: Unordered list style
Expected: dash; Actual: plus

(MD004, ul-style)


7-7: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1

(MD029, ol-prefix)


8-8: Unordered list style
Expected: dash; Actual: plus

(MD004, ul-style)


8-8: Ordered list item prefix
Expected: 1; Actual: 3; Style: 1/1/1

(MD029, ol-prefix)


9-9: Unordered list style
Expected: dash; Actual: plus

(MD004, ul-style)


10-10: Unordered list style
Expected: dash; Actual: plus

(MD004, ul-style)


10-10: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


11-11: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


11-11: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


12-12: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


13-13: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/CLAUDE.md

1-1: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


2-2: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


3-3: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


4-4: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


7-7: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


7-7: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


8-8: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


9-9: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


9-9: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


11-11: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


13-13: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


17-17: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


17-17: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


17-17: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


31-31: Fenced code blocks should be surrounded by blank lines
null

(MD031, blanks-around-fences)


31-31: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/deployment.md

1-1: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

🪛 YAMLlint (1.37.1)
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docker-compose.yml

[error] 1-1: syntax error: found character '@' that cannot start any token

(syntax)


[error] 17-17: trailing spaces

(trailing-spaces)


[error] 29-29: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 50-50: trailing spaces

(trailing-spaces)


[error] 55-55: trailing spaces

(trailing-spaces)


[error] 64-64: trailing spaces

(trailing-spaces)


[error] 75-75: trailing spaces

(trailing-spaces)


[error] 84-84: trailing spaces

(trailing-spaces)


[error] 93-93: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (0)
🔇 Additional comments (13)
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/.ignorecontent (1)

1-2: Approve fixture addition

The .ignorecontent placeholder correctly includes a marker comment and a trailing newline. It aligns with the other fixture files under provision_database_lagoon and requires no further changes.

.vortex/installer/src/Prompts/Handlers/Internal.php (1)

53-53: Perfect integration of the YAML-specific processing.

The placement after collapseRepeatedEmptyLines() is logical, ensuring general empty line processing happens first, followed by YAML literal block-specific processing. The inclusion within the same conditional block that excludes certain files is appropriate.

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/.dockerignore (1)

6-6: Appropriate inclusion of Lagoon environment files.

The negation !.lagoon.env.* correctly ensures that Lagoon environment files are included in the Docker build context, which is necessary for proper Lagoon deployment configuration.

.vortex/installer/tests/Functional/InstallTest.php (1)

271-276: LGTM! Well-structured test case addition.

The new test case follows the established patterns in the test file and correctly sets up environment variables for testing the Lagoon database provisioning scenario. The implementation is consistent with other test cases in the data provider.

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/CLAUDE.md (1)

1-34: Consider consistency with PR objectives.

While the Lagoon documentation additions are well-structured and informative, I notice a potential inconsistency with the PR objectives. The PR title mentions "[#1671] Fixed installer not removing empty lines in YAML literal blocks," but the changes appear to be focused on adding Lagoon provisioning support rather than YAML literal block handling.

Could you verify that these Lagoon-related changes are indeed part of the same PR that addresses YAML literal block processing? If they are separate concerns, they might be better suited for separate PRs to maintain clear change boundaries.

Likely an incorrect or invalid review comment.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

1-1: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


2-2: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


3-3: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


4-4: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


7-7: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


7-7: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


8-8: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


9-9: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


9-9: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


11-11: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


11-11: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


13-13: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


17-17: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)


17-17: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


17-17: Headings must start at the beginning of the line
null

(MD023, heading-start-left)


31-31: Fenced code blocks should be surrounded by blank lines
null

(MD031, blanks-around-fences)


31-31: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/.env (4)

8-12: LGTM! Clean Lagoon hosting configuration.

The hosting section properly defines the Lagoon project name and production branch identification. The configuration follows expected patterns for Lagoon environments.


25-29: Good cleanup of demo configuration.

Removing the demo section and unused database URL configuration makes the fixture more focused and realistic for Lagoon environments.

Also applies to: 47-59


22-23:

Details

✅ Verification successful

Verify Lagoon database source configuration.

The database download source has been changed from url to lagoon. Ensure that the Lagoon database provisioning functionality is properly implemented and tested in the codebase.


🏁 Script executed:

#!/bin/bash
# Verify that Lagoon database source is supported in the codebase
rg -A 5 "VORTEX_DB_DOWNLOAD_SOURCE.*lagoon"

Length of output: 445


No changes required: Lagoon source is fully supported and covered
The scripts/vortex/download-db.sh entry for VORTEX_DB_DOWNLOAD_SOURCE=lagoon correctly invokes download-db-lagoon.sh, and we already have fixture‐based tests under .vortex/installer/tests/Fixtures/install/provision_database_lagoon/ verifying this flow.


37-38:

Details

✅ Verification successful

Verify Lagoon deployment type support.

The deployment type has been changed from webhook to lagoon. Confirm that the Lagoon deployment functionality is implemented and properly integrated.


🏁 Script executed:

#!/bin/bash
# Verify that Lagoon deployment type is supported
rg -A 10 "VORTEX_DEPLOY_TYPES.*lagoon"

Length of output: 1105


Lagoon deployment type support verified

The scripts/vortex/deploy.sh script now:

  • Includes lagoon in its list of valid deployment types
  • Invokes ./scripts/vortex/deploy-lagoon.sh when VORTEX_DEPLOY_TYPES contains lagoon

No further action needed.

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/drush/sites/lagoon.site.yml (1)

1-9: LGTM! Standard Lagoon Drush configuration.

The configuration correctly defines:

  • Standard Lagoon SSH host (ssh.lagoon.amazeeio.cloud)
  • Proper file paths for Lagoon container structure
  • Environment variable interpolation for dynamic user assignment
  • Appropriate SSH options for Lagoon environments (port 32222, disabled host key checking)

The disabled strict host key checking is acceptable for Lagoon environments where hosts are dynamically provisioned.

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/web/sites/default/includes/providers/settings.lagoon.php (1)

51-51: LGTM! Well-structured cache prefix configuration.

The cache prefix logic properly uses Lagoon-specific variables with appropriate fallbacks to prevent cache conflicts between environments.

.vortex/installer/tests/Unit/FileTest.php (1)

35-40: Good addition – test for the new YAML-helper is in place.

The new unit-test covers the happy path of collapseYamlEmptyLinesInLiteralBlocks() and makes the public API change executable – nice!

.vortex/installer/tests/Fixtures/install/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php (1)

237-242: Regex pattern looks off – “example2/com”

'^example1\.com|example2/com$' will also match any host ending in “example1” (missing $) and allows a forward-slash inside the second domain.
Should this be two fully-qualified patterns?

-    $settings['trusted_host_patterns'][] = '^example1\.com|example2/com$';
+    $settings['trusted_host_patterns'][] = '^(example1\.com|example2\.com)$';

Please double-check the expected host validation.

Comment on lines +16 to +17
- [ ] Configure Renovate by [logging in](https://developer.mend.io/) with your GitHub account and
adding a project through UI.
Copy link

@coderabbitai coderabbitai bot Jun 2, 2025

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Fix missing article and list formatting.

-- [ ] Configure Renovate by [logging in](https://developer.mend.io/) with your GitHub account and
-  adding a project through UI.
+- [ ] Configure Renovate by [logging in](https://developer.mend.io/) with your GitHub account and
+  adding a project through the UI.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~17-~17: You might be missing the article “the” here.
Context: ...account and adding a project through UI.

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)

16-16: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


16-16: Unordered list indentation
Expected: 0; Actual: 1

(MD007, ul-indent)


16-16: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md
at lines 16 to 17, the checklist item is missing the article "the" before "UI"
and the list formatting is inconsistent. Add the article "the" before "UI" and
ensure the checklist item is properly formatted as a markdown list with the
correct spacing and syntax.

Copy link
Member Author

Choose a reason for hiding this comment

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

DO NOT EVER REVIEW FILES IN .vortex/installer/tests/Fixtures/

Copy link

Choose a reason for hiding this comment

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

@AlexSkrypnyk, understood! I will not review files in the .vortex/installer/tests/Fixtures/ directory. These are test fixtures and should remain as-is without any review comments.


✏️ Learnings added
Learnt from: AlexSkrypnyk
PR: drevops/vortex#1697
File: .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md:16-17
Timestamp: 2025-06-02T00:41:36.294Z
Learning: DO NOT EVER REVIEW FILES IN .vortex/installer/tests/Fixtures/ directory - these are test fixtures and should not be reviewed under any circumstances.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: AlexSkrypnyk
PR: drevops/vortex#0
File: :0-0
Timestamp: 2025-05-29T12:15:32.188Z
Learning: Do not review files in `.vortex/installer/tests/Fixtures/install` directory as they are test fixtures.

Learnt from: AlexSkrypnyk
PR: drevops/vortex#1693
File: .vortex/installer/tests/Fixtures/install/hosting_acquia/docs/deployment.md:6-8
Timestamp: 2025-06-01T08:09:18.993Z
Learning: Do not review files in test fixture directories (e.g., files under paths containing `/tests/Fixtures/` or similar test fixture patterns). These files are used for testing purposes and should remain as-is.

Learnt from: AlexSkrypnyk
PR: drevops/vortex#1693
File: .vortex/installer/tests/Fixtures/install/deploy_type_none_gha/.github/workflows/build-test-deploy.yml:1-4
Timestamp: 2025-06-01T08:08:59.071Z
Learning: Test fixture files (typically located in directories containing "fixture" or "test") should not be reviewed for code quality issues as they may intentionally contain incomplete, invalid, or malformed data for testing purposes.

Comment on lines +5 to +15
+- [ ] Configure Lagoon integration:
+ - [ ] Submit a request to AmazeeIO to create a project.
+ - [ ] Add your public key to the project.
+ - [ ] Ensure that you have access to Lagoon: run `ahoy cli` and `drush sa` -
+ a list of available environments should be shown (at least one
+ environment).
+ - [ ] Ensure that you have access to Lagoon UI.
+ - [ ]
+ Setup [Slack notifications](https://docs.lagoon.sh/administering-lagoon/graphql-queries/#adding-notifications-to-the-project)
+ - [ ] Push to remote and ensure that Lagoon was successfully deployed.
+
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Comprehensive Lagoon onboarding content with formatting improvements needed.

The documentation provides excellent coverage of Lagoon integration steps. However, there are several markdown formatting issues that should be addressed:

 - [ ] Configure Lagoon integration:
-  - [ ] Submit a request to AmazeeIO to create a project.
-  - [ ] Add your public key to the project.
-  - [ ] Ensure that you have access to Lagoon: run `ahoy cli` and `drush sa` -
+   - [ ] Submit a request to AmazeeIO to create a project.
+   - [ ] Add your public key to the project.
+   - [ ] Ensure that you have access to Lagoon: run `ahoy cli` and `drush sa` -
     a list of available environments should be shown (at least one
     environment).
-  - [ ] Ensure that you have access to Lagoon UI.
-  - [ ]
+   - [ ] Ensure that you have access to Lagoon UI.
+   - [ ]
     Setup [Slack notifications](https://docs.lagoon.sh/administering-lagoon/graphql-queries/#adding-notifications-to-the-project)
-  - [ ] Push to remote and ensure that Lagoon was successfully deployed.
+   - [ ] Push to remote and ensure that Lagoon was successfully deployed.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

6-6: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


6-6: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


6-6: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)


7-7: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


7-7: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


8-8: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


8-8: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


11-11: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


11-11: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


12-12: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


12-12: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


14-14: Unordered list style
Expected: plus; Actual: dash

(MD004, ul-style)


14-14: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


15-15: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md
around lines 5 to 15, the markdown checklist items have inconsistent indentation
and an empty list item. Fix the formatting by ensuring all checklist items are
properly indented with consistent spacing, remove the empty list item, and
verify that links and code snippets are correctly formatted to improve
readability and maintain markdown standards.

@@ -0,0 +1,13 @@
@@ -16,3 +16,12 @@
deployment.

Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Address markdown formatting issues.

The static analysis tools identified trailing spaces and missing first-level heading structure. While these are minor formatting issues, they should be addressed for consistency.

Based on the static analysis hints, consider:

  1. Remove trailing spaces on line 3
  2. Add a proper first-level heading at the beginning of the file if this is a standalone document
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

3-3: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/deployment.md
at line 3, remove any trailing spaces to fix markdown formatting. Additionally,
ensure the file starts with a first-level heading (a line beginning with a
single #) if it is intended as a standalone document, adding it at the very top
of the file before any other content.

+
+## Database refresh in Lagoon environments
+
+To fresh the database in the existing Lagoon environment with the database from
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix typo in documentation.

There's a typo in the documentation: "fresh" should be "refresh".

-To fresh the database in the existing Lagoon environment with the database from
+To refresh the database in the existing Lagoon environment with the database from
📝 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.

Suggested change
+To fresh the database in the existing Lagoon environment with the database from
To refresh the database in the existing Lagoon environment with the database from
🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/deployment.md
at line 8, correct the typo by replacing the word "fresh" with "refresh" to
accurately describe the action of updating the database.

Comment on lines +41 to +158
public static function dataProviderCollapseYamlEmptyLinesInLiteralBlocks(): array {
return [
'empty string' => [
'',
'',
],
'no literal blocks' => [
<<<YAML
key: value
another: test
YAML,
<<<YAML
key: value
another: test
YAML,
],
'literal block immediately after pipe' => [
<<<YAML
|
content
YAML,
<<<YAML
|
content
YAML,
],
'literal block with multiple empty lines after pipe' => [
<<<YAML
|
content
YAML,
<<<YAML
|
content
YAML,
],
'literal block with whitespace in empty lines' => [
<<<YAML
|
content
YAML,
<<<YAML
|
content
YAML,
],
'multiple literal blocks with collapsible lines' => [
<<<YAML
first: |
content1
second: |
content2
YAML,
<<<YAML
first: |
content1
second: |
content2
YAML,
],
'mixed content no effect on non-literal blocks' => [
<<<YAML
key: value
description: |
content
another: test
YAML,
<<<YAML
key: value
description: |
content
another: test
YAML,
],
'literal block with no empty lines to collapse' => [
<<<YAML
|
line1
line2
line3
YAML,
<<<YAML
|
line1
line2
line3
YAML,
],
'literal block with single empty line after pipe' => [
<<<YAML
|
content
YAML,
<<<YAML
|
content
YAML,
],
];
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Minor: add type‐hints / generator for the data-provider

Adding a small php-doc (or using a generator with yield) helps Psalm/PhpStan infer the returned shape and keeps large data-providers from holding the whole array in memory at once.

-  public static function dataProviderCollapseYamlEmptyLinesInLiteralBlocks(): array {
+  /**
+   * @return iterable<array{0:string,1:string}>
+   */
+  public static function dataProviderCollapseYamlEmptyLinesInLiteralBlocks(): iterable {
+    yield from [
       …
     ];
   }
🤖 Prompt for AI Agents
In .vortex/installer/tests/Unit/FileTest.php between lines 41 and 158, the data
provider method returns a large array without type hints or using a generator.
To improve static analysis and memory efficiency, add a PHPDoc block specifying
the return type as iterable with the expected key and value types, or refactor
the method to use yield statements to return each test case one by one instead
of building the entire array at once.

Comment on lines +13 to +17
+ labels:
+ lagoon.type: cli-persistent # See https://docs.lagoon.sh/using-lagoon-advanced/service-types/
+ lagoon.persistent.name: &lagoon-nginx-name nginx-php # Mount the persistent storage of nginx-php pod into this container.
+ lagoon.persistent: &lagoon-persistent-files /app/web/sites/default/files/ # Location where the persistent storage should be mounted.

Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Trailing spaces cause noisy lints

Several newly added lines contain only whitespace (or end with spaces). They are harmless at runtime but keep yamllint red. Consider trimming them so CI stays green.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 17-17: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docker-compose.yml
around lines 13 to 17, remove any trailing whitespace characters at the end of
the newly added lines to prevent yamllint warnings. Ensure that each line ends
immediately after the last visible character without extra spaces or tabs.

@@ -0,0 +1,95 @@
@@ -32,6 +32,7 @@
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

YAML broken – diff hunk header accidentally committed

@@ -32,6 +32,7 @@ is a git-diff marker and renders the whole file invalid YAML (confirmed by yamllint error “found character '@' that cannot start any token”). Docker Compose will refuse to start.

-@@ -32,6 +32,7 @@

Remove the line (and any other diff artefacts) before merging.

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

Suggested change
@@ -32,6 +32,7 @@
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1-1: syntax error: found character '@' that cannot start any token

(syntax)

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/docker-compose.yml
at line 1, remove the git-diff hunk header line starting with @@ as it is not
valid YAML and causes parsing errors. Ensure the file contains only valid YAML
content without any diff markers or git artefacts before merging.

Comment on lines +15 to +23
tasks:
post-rollout:
- run:
name: Show Vortex variables.
command: |
[ "${VORTEX_DEBUG-}" = "1" ] && env -0 | sort -z | tr '\0' '\n' | grep ^VORTEX_ || true
service: cli
shell: bash

Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Optional: tasks section grows – consider anchors for re-used env logic

The inline shell snippets for PR vs branch handling repeat three times. Anchoring them in a single &define_pr_branch_env block and re-using with *define_pr_branch_env reduces duplication and future maintenance.

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/.lagoon.yml
around lines 15 to 23, the shell command for showing Vortex variables is
repeated multiple times. To reduce duplication and ease maintenance, define this
shell snippet once using a YAML anchor (e.g., &define_pr_branch_env) and then
reference it in other places with the alias (*define_pr_branch_env). Refactor
the tasks section to use this anchor and alias for the repeated shell command
blocks.

Comment on lines +248 to +296
+ public function testEnvironmentLagoonDev(): void {
+ $this->setEnvVars([
+ 'LAGOON_KUBERNETES' => 1,
+ 'LAGOON_ENVIRONMENT_TYPE' => 'development',
+ 'LAGOON_ROUTES' => 'http://example1.com,https://example2/com',
+ 'LAGOON_PROJECT' => 'test_project',
+ 'LAGOON_GIT_BRANCH' => 'develop',
+ 'LAGOON_GIT_SAFE_BRANCH' => 'develop',
+ ]);
+
+ $this->requireSettingsFile();
+
+ $config['config_split.config_split.dev']['status'] = TRUE;
+ $config['environment_indicator.indicator']['bg_color'] = '#4caf50';
+ $config['environment_indicator.indicator']['fg_color'] = '#000000';
+ $config['environment_indicator.indicator']['name'] = static::ENVIRONMENT_DEV;
+ $config['environment_indicator.settings']['favicon'] = TRUE;
+ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE];
+ $config['shield.settings']['shield_enable'] = TRUE;
+ $config['system.performance']['cache']['page']['max_age'] = 900;
+ $config['system.performance']['css']['preprocess'] = 1;
+ $config['system.performance']['js']['preprocess'] = 1;
+ $this->assertConfig($config);
+
+ $settings['cache_prefix']['default'] = 'test_project_develop';
+ $settings['config_exclude_modules'] = [];
+ $settings['config_sync_directory'] = static::CONFIG_PATH_TESTING;
+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml';
+ $settings['entity_update_batch_size'] = 50;
+ $settings['environment'] = static::ENVIRONMENT_DEV;
+ $settings['file_private_path'] = static::PRIVATE_PATH_TESTING;
+ $settings['file_scan_ignore_directories'] = [
+ 'node_modules',
+ 'bower_components',
+ ];
+ $settings['file_temp_path'] = static::TMP_PATH_TESTING;
+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost');
+ $settings['reverse_proxy'] = TRUE;
+ $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP';
+ $settings['trusted_host_patterns'][] = '^.+\.docker\.amazee\.io$';
+ $settings['trusted_host_patterns'][] = '^nginx$';
+ $settings['trusted_host_patterns'][] = '^nginx\-php$';
+ $settings['trusted_host_patterns'][] = '^.+\.au\.amazee\.io$';
+ $settings['trusted_host_patterns'][] = '^example1\.com|example2/com$';
+ $this->assertSettings($settings);
+ }
+
+ /**
+ * Test per-environment settings for Test environment.
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Large duplicated assertion blocks – extract helper

Almost identical config/settings assertions are repeated for every environment. A small helper like assertCommonLagoonSettings($env, $branch) (or a data-provider driven approach) would make these tests shorter and easier to maintain.

🤖 Prompt for AI Agents
In
.vortex/installer/tests/Fixtures/install/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php
around lines 248 to 296, the testEnvironmentLagoonDev method contains large
duplicated config and settings assertion blocks that are repeated across
environment tests. Refactor by extracting these common assertions into a helper
method, such as assertCommonLagoonSettings($env, $branch), which accepts
environment and branch parameters to perform the shared assertions. Then update
the individual environment test methods to call this helper with appropriate
arguments, reducing duplication and improving maintainability.

@codecov
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.58%. Comparing base (7bfc092) to head (66c277b).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1697      +/-   ##
===========================================
+ Coverage    70.56%   70.58%   +0.01%     
===========================================
  Files           76       76              
  Lines         4349     4351       +2     
===========================================
+ Hits          3069     3071       +2     
  Misses        1280     1280              

☔ 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/fix-empty-lines-yaml-commands branch from b8c1ba6 to 66c277b Compare June 2, 2025 00:44
@github-actions github-actions bot temporarily deployed to commit June 2, 2025 00:46 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.vortex/installer/tests/Unit/FileTest.php (1)

41-158: Address the outstanding type hint suggestion for the data provider.

The data provider method lacks type hints as mentioned in a previous review. Adding type annotations improves static analysis and code clarity.

Apply this diff to add proper type hints:

-  public static function dataProviderCollapseYamlEmptyLinesInLiteralBlocks(): array {
+  /**
+   * @return iterable<array{0:string,1:string}>
+   */
+  public static function dataProviderCollapseYamlEmptyLinesInLiteralBlocks(): iterable {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8c1ba6 and 66c277b.

⛔ Files ignored due to path filters (16)
  • .vortex/installer/tests/Fixtures/install/hosting_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_lagoon/.lagoon.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_lagoon/docs/deployment.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.dockerignore is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.github/workflows/close-pull-request.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.ignorecontent is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/.lagoon.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/CLAUDE.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docker-compose.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/deployment.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/drush/sites/lagoon.site.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/provision_database_lagoon/web/sites/default/includes/providers/settings.lagoon.php is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (5)
  • .vortex/installer/src/Prompts/Handlers/Internal.php (1 hunks)
  • .vortex/installer/src/Utils/File.php (1 hunks)
  • .vortex/installer/tests/Functional/InstallTest.php (1 hunks)
  • .vortex/installer/tests/Unit/FileTest.php (1 hunks)
  • docs/deployment.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
.vortex/installer/src/Utils/File.php (1)
Learnt from: AlexSkrypnyk
PR: drevops/vortex#1693
File: .vortex/installer/src/Prompts/Handlers/Internal.php:52-52
Timestamp: 2025-06-01T08:10:15.903Z
Learning: The File utility class in .vortex/installer/src/Utils/File.php extends AlexSkrypnyk\File\File, and methods like collapseRepeatedEmptyLines() are available from this external parent class dependency.
🧬 Code Graph Analysis (2)
.vortex/installer/src/Prompts/Handlers/Internal.php (1)
.vortex/installer/src/Utils/File.php (2)
  • File (10-120)
  • collapseYamlEmptyLinesInLiteralBlocks (116-118)
.vortex/installer/tests/Unit/FileTest.php (1)
.vortex/installer/src/Utils/File.php (2)
  • File (10-120)
  • collapseYamlEmptyLinesInLiteralBlocks (116-118)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: build (1)
  • GitHub Check: build (0)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (4)
docs/deployment.md (1)

108-108: Fix typo in Lagoon database refresh instruction
Updated the phrase from "To fresh the database" to "To refresh the database" for clarity.

.vortex/installer/src/Utils/File.php (1)

102-118: LGTM! Well-implemented solution for YAML literal block processing.

The regex pattern /(?<=\|)(\n\s*\n)+/ correctly uses positive lookbehind to target empty lines specifically after YAML literal block indicators (|). The implementation effectively collapses multiple consecutive empty lines into a single newline while preserving content structure. The documentation is comprehensive and clearly explains the targeted behavior.

.vortex/installer/src/Prompts/Handlers/Internal.php (1)

53-53: Good integration following established patterns.

The placement of collapseYamlEmptyLinesInLiteralBlocks after the general collapseRepeatedEmptyLines call makes logical sense, and the conditional application respects the existing ignore list. This maintains consistency with the existing file processing workflow.

.vortex/installer/tests/Unit/FileTest.php (1)

35-39: Excellent test coverage with comprehensive scenarios.

The test method properly validates the new functionality with thorough edge case coverage including empty strings, mixed content, and various YAML literal block configurations.

Comment on lines +271 to +276
'provision, database, lagoon' => [
static::cw(function (): void {
Env::put(PromptManager::makeEnvName(ProvisionType::id()), ProvisionType::DATABASE);
Env::put(PromptManager::makeEnvName(HostingProvider::id()), HostingProvider::LAGOON);
}),
],
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Add test case for DATABASE provisioning with Lagoon hosting
This new DataProvider entry correctly configures both ProvisionType::DATABASE and HostingProvider::LAGOON. Please verify that the corresponding provision_database_lagoon fixtures and baseline directories exist and are populated with the expected YAML literal blocks, and consider adding an after closure to assert the absence of Acquia-specific artifacts (e.g., assertSutNotContains('acquia')) or to validate the presence of Lagoon-specific configuration.


🏁 Script executed:

#!/usr/bin/env bash
# Inspect fixture directories and YAML files for database+lagoon provisioning in Functional tests

echo "Subdirectories under .vortex/installer/tests/Functional:"
find .vortex/installer/tests/Functional -maxdepth 1 -type d | sed 's/^/  /'

echo -e "\nDirectories with 'provision' and 'database':"
find .vortex/installer/tests/Functional -type d | grep -i "provision.*database" || echo "  None found"

echo -e "\nDirectories with 'provision' and 'lagoon':"
find .vortex/installer/tests/Functional -type d | grep -i "provision.*lagoon" || echo "  None found"

echo -e "\nYAML fixtures containing 'database' or 'lagoon':"
find .vortex/installer/tests/Functional -type f \( -iname "*.yml" -o -iname "*.yaml" \) | grep -E "database|lagoon" || echo "  None found"

Length of output: 979


Missing fixtures for DATABASE+Lagoon provisioning
I don’t see any provision_database_lagoon fixture or baseline directories (nor YAML files) under .vortex/installer/tests/Functional. You’ll need to add these before this test will pass:

• File needing update:

  • .vortex/installer/tests/Functional/InstallTest.php (lines 271–276)
    • Add directories:
  • …/Functional/fixtures/provision_database_lagoon/
  • …/Functional/baselines/provision_database_lagoon/
    • Populate each with the expected YAML literal-block fixtures
    • Extend the DataProvider entry with an after closure to guard against Acquia artifacts and verify Lagoon config. For example:
   'provision, database, lagoon' => [
     static::cw(function (): void {
       Env::put(PromptManager::makeEnvName(ProvisionType::id()), ProvisionType::DATABASE);
       Env::put(PromptManager::makeEnvName(HostingProvider::id()), HostingProvider::LAGOON);
     }),
+    static::after(function (): void {
+      self::assertSutNotContains('acquia');
+      self::assertSutContains('lagoon');
+    }),
   ],
📝 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.

Suggested change
'provision, database, lagoon' => [
static::cw(function (): void {
Env::put(PromptManager::makeEnvName(ProvisionType::id()), ProvisionType::DATABASE);
Env::put(PromptManager::makeEnvName(HostingProvider::id()), HostingProvider::LAGOON);
}),
],
'provision, database, lagoon' => [
static::cw(function (): void {
Env::put(PromptManager::makeEnvName(ProvisionType::id()), ProvisionType::DATABASE);
Env::put(PromptManager::makeEnvName(HostingProvider::id()), HostingProvider::LAGOON);
}),
static::after(function (): void {
self::assertSutNotContains('acquia');
self::assertSutContains('lagoon');
}),
],
🤖 Prompt for AI Agents
In .vortex/installer/tests/Functional/InstallTest.php around lines 271 to 276,
the new DataProvider entry for DATABASE provisioning with Lagoon hosting lacks
the necessary fixture and baseline directories and files. Create the directories
.vortex/installer/tests/Functional/fixtures/provision_database_lagoon/ and
.vortex/installer/tests/Functional/baselines/provision_database_lagoon/, then
add the expected YAML literal-block fixture files inside them. Additionally,
extend the DataProvider entry by adding an after closure that asserts the
absence of Acquia-specific artifacts (e.g., using
assertSutNotContains('acquia')) and verifies the presence of Lagoon-specific
configuration to ensure the test validates the correct provisioning setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants