Skip to content

Create ES indices in CI#321

Merged
PGijsbers merged 2 commits intomainfrom
populate-es-in-gha
May 2, 2026
Merged

Create ES indices in CI#321
PGijsbers merged 2 commits intomainfrom
populate-es-in-gha

Conversation

@PGijsbers
Copy link
Copy Markdown
Contributor

I noticed that the ES indices were not created during CI and so some of the integration tests were skipped.

@PGijsbers PGijsbers added automation CI/CD, pre-commit, ... tests labels May 2, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

Walkthrough

This change adds Elasticsearch index initialization capability to the testing workflow and documents its configuration. The workflow's "Start services" step now includes a modification to docker/php/.env that sets INDEX_ES_DURING_STARTUP=true when the php_api matrix option is enabled, ensuring indices are created during container startup. Documentation was added to the testing guide explaining that Elasticsearch indices are required for certain tests, index creation is disabled by default, and can be enabled by configuring the INDEX_ES_DURING_STARTUP environment variable in docker/php/.env.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: enabling ES index creation during CI to resolve skipped integration tests.
Description check ✅ Passed The description is directly related to the changeset, explaining the problem (ES indices not created in CI) and the solution being implemented.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch populate-es-in-gha

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Relying on sed to replace INDEX_ES_DURING_STARTUP=false in docker/php/.env is a bit brittle (e.g., if the default changes or the line is absent); consider passing the env var via docker compose (--env-file override or environment variables in the workflow step) instead of mutating the file in place.
  • Because the workflow edits docker/php/.env in the checked-out workspace, double-check that no later CI steps assume the original value of INDEX_ES_DURING_STARTUP, or else reset the file after starting the services to avoid unexpected side effects.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Relying on `sed` to replace `INDEX_ES_DURING_STARTUP=false` in `docker/php/.env` is a bit brittle (e.g., if the default changes or the line is absent); consider passing the env var via `docker compose` (`--env-file` override or environment variables in the workflow step) instead of mutating the file in place.
- Because the workflow edits `docker/php/.env` in the checked-out workspace, double-check that no later CI steps assume the original value of `INDEX_ES_DURING_STARTUP`, or else reset the file after starting the services to avoid unexpected side effects.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.66%. Comparing base (fe55bd5) to head (531a73f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   93.53%   93.66%   +0.12%     
==========================================
  Files          67       67              
  Lines        3109     3109              
  Branches      221      221              
==========================================
+ Hits         2908     2912       +4     
+ Misses        143      138       -5     
- Partials       58       59       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/contributing/tests.md`:
- Around line 31-33: Replace the two copy nits in the paragraph: change the
phrase "elastic search" to the branded single-word "Elasticsearch" and hyphenate
"time consuming" to "time-consuming" where used as a compound adjective (update
the occurrences of the strings "elastic search" and "time consuming" in the
paragraph).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5047f8d8-ac60-4787-bd1f-aa22fda6af00

📥 Commits

Reviewing files that changed from the base of the PR and between fe55bd5 and 531a73f.

📒 Files selected for processing (2)
  • .github/workflows/tests.yml
  • docs/contributing/tests.md

Comment on lines +31 to +33
Some tests require elastic search indices to be constructed.
These indices can be constructed by the PHP API container on startup,
but by default this is turned off because it can be a time consuming process.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Two minor copy nits in the new paragraph

  1. "elastic search" (line 31) should be the branded product name "Elasticsearch" (one word).
  2. "time consuming" (line 33) should be hyphenated when used as a compound adjective — "time-consuming".
✏️ Proposed fix
-Some tests require elastic search indices to be constructed.
+Some tests require Elasticsearch indices to be constructed.
 These indices can be constructed by the PHP API container on startup,
-but by default this is turned off because it can be a time consuming process.
+but by default this is turned off because it can be a time-consuming process.
🧰 Tools
🪛 LanguageTool

[grammar] ~33-~33: Use a hyphen to join words.
Context: ...s is turned off because it can be a time consuming process. If you see skipped te...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/contributing/tests.md` around lines 31 - 33, Replace the two copy nits
in the paragraph: change the phrase "elastic search" to the branded single-word
"Elasticsearch" and hyphenate "time consuming" to "time-consuming" where used as
a compound adjective (update the occurrences of the strings "elastic search" and
"time consuming" in the paragraph).

@PGijsbers PGijsbers merged commit 6350bbf into main May 2, 2026
9 checks passed
@PGijsbers PGijsbers deleted the populate-es-in-gha branch May 2, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation CI/CD, pre-commit, ... tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant