Skip to content

Refactor: env - #385

Open
TatevikGr wants to merge 5 commits into
mainfrom
env
Open

Refactor: env#385
TatevikGr wants to merge 5 commits into
mainfrom
env

Conversation

@TatevikGr

@TatevikGr TatevikGr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Configuration
    • Updated API endpoint configuration to derive the API base from a single environment URL and append /api/v2.
    • Consolidated API base settings under application configuration and removed the dedicated REST API base environment variable.
    • Moved configuration defaults into .env.dist, with runtime values sourced from environment variables.
  • Environment & Bootstrapping
    • Added Symfony Dotenv support to load values from .env during startup.
    • Improved .env generation behavior and updated ignore rules for environment files.
  • Documentation
    • Updated server setup instructions to use .env (generated from .env.dist).

Thanks for contributing to phpList!

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 6 minutes

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

How can I continue?

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

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

How do review limits work?

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

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

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6fe8d7b0-779f-4c12-856c-bb1d92da1310

📥 Commits

Reviewing files that changed from the base of the PR and between 8a7278d and f078d2f.

📒 Files selected for processing (12)
  • .env.dist
  • .gitignore
  • CHANGELOG.md
  • README.md
  • composer.json
  • config/parameters.yml
  • config/parameters.yml.dist
  • public/app.php
  • public/app_dev.php
  • public/app_test.php
  • src/Composer/ScriptHandler.php
  • src/Core/Bootstrap.php
📝 Walkthrough

Walkthrough

The application now uses .env.dist for configuration defaults, generates .env during Composer configuration, loads dotenv values during bootstrap, and removes inline parameter defaults. API URLs share API_BASE_URL, with the REST API path appended as /api/v2.

Changes

Environment configuration

Layer / File(s) Summary
Dotenv generation and configuration wiring
.env.dist, composer.json, src/Composer/ScriptHandler.php, .gitignore
Adds environment defaults, generates .env from .env.dist, preserves existing .env files, and registers dotenv configuration during Composer updates.
Bootstrap environment loading
src/Core/Bootstrap.php
Loads .env before debugging and application-kernel configuration, setting APP_ENV to the configured environment.
Environment parameter migration
config/parameters.yml.dist, README.md, CHANGELOG.md
Removes inline environment defaults, updates API URL wiring to use API_BASE_URL, and documents .env configuration.Each row should have paths etc.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to environment config changes, but it is too vague to clearly describe the main addition of dotenv support. Use a specific title like "Add dotenv support for .env configuration" so the primary change is clear at a glance.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch env

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@config/parameters.yml.dist`:
- Around line 37-39: Normalize API_BASE_URL to remove any trailing slash before
appending /api/v2 in app.rest_api_base_url, while preserving app.api_base_url
and downstream URL values without duplicate slashes. Ensure the default
configuration and deployment-provided values follow the same no-trailing-slash
behavior.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a9189fb3-cd53-4927-a570-613d605161a1

📥 Commits

Reviewing files that changed from the base of the PR and between c5efbd8 and 3ef0af5.

📒 Files selected for processing (1)
  • config/parameters.yml.dist

Comment thread config/parameters.yml.dist Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@src/Core/Bootstrap.php`:
- Around line 165-166: Update the environment-loading logic around Bootstrap so
production does not load the tracked .env.dist fallback when .env is absent.
Require a generated .env file, or inspect the fallback contents and reject it
when PHPLIST_SECRET still contains the unreplaced %s placeholder before invoking
Dotenv::loadEnv. Preserve normal loading for a valid generated .env.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 04ad5282-5997-4940-a98f-291373fea210

📥 Commits

Reviewing files that changed from the base of the PR and between 3ef0af5 and 8a7278d.

📒 Files selected for processing (8)
  • .env.dist
  • .gitignore
  • CHANGELOG.md
  • README.md
  • composer.json
  • config/parameters.yml.dist
  • src/Composer/ScriptHandler.php
  • src/Core/Bootstrap.php

Comment thread src/Core/Bootstrap.php
@TatevikGr
TatevikGr force-pushed the env branch 2 times, most recently from 424c01f to a350de0 Compare July 26, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants