Skip to content

Dev - #92

Open
TatevikGr wants to merge 3 commits into
mainfrom
dev
Open

Dev#92
TatevikGr wants to merge 3 commits into
mainfrom
dev

Conversation

@TatevikGr

@TatevikGr TatevikGr commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • API configuration is now provided consistently to the application and client interface.
    • Added generated dotenv configuration during configuration updates.
    • Improved session-based authentication handling for the single-page application.
  • Bug Fixes

    • Standardized API URL availability across rendered pages, improving reliability when loading application data.
    • Updated test bootstrapping and request handling to reflect the revised configuration flow.

Thanks for contributing to phpList!

* Refactor: env

* fix test

* app.api_base_url

* Remove api_base_url from controller render methods and add it as a global variable in twig configuration

* Remove api_token from controller render methods and update spa.html.twig to use app.session for auth_token

* Update API base URL configuration in templates and JavaScript

---------

Co-authored-by: Tatevik <tatevikg1@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 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: 9 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: 6f1dc42e-af5d-4e73-9f31-f9ad1fc4a456

📥 Commits

Reviewing files that changed from the base of the PR and between 0e57640 and cbf56ab.

📒 Files selected for processing (3)
  • assets/vue/views/TemplateEditView.vue
  • composer.json
  • tests/Unit/assets/vue/views/TemplateEditorView.spec.js
📝 Walkthrough

Walkthrough

The API base URL is now configured through the application parameter, exposed to Twig globally, rendered in an api-config meta element, and read by the Vue client. The SPA token is sourced from the session in the template. Controllers no longer pass API credentials or base URL as render props. PHPUnit now uses a dotenv-aware bootstrap, and integration tests register requests with RequestStack and use the renamed parameter.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague to describe the configuration and controller refactor in this pull request. Rename the PR to briefly state the main change, such as updating API configuration handling and Twig/client bootstrap wiring.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 dev

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/Integration/Controller/CampaignsControllerTest.php (1)

41-45: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the configured API URL in this test.

The assertion at Lines 58-60 still hard-codes http://api.phplist.local/, unlike AnalyticsControllerTest.php and BouncesControllerTest.php. Read app.api_base_url from the container and interpolate it so the test remains valid when configuration differs in CI or another environment.

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

In `@tests/Integration/Controller/CampaignsControllerTest.php` around lines 41 -
45, Update the test setup in CampaignsControllerTest to read app.api_base_url
from the container and use that configured value in the assertion currently
hard-coding http://api.phplist.local/. Match the configured-URL handling used by
AnalyticsControllerTest and BouncesControllerTest while preserving the existing
assertion behavior.
🤖 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.

Outside diff comments:
In `@tests/Integration/Controller/CampaignsControllerTest.php`:
- Around line 41-45: Update the test setup in CampaignsControllerTest to read
app.api_base_url from the container and use that configured value in the
assertion currently hard-coding http://api.phplist.local/. Match the
configured-URL handling used by AnalyticsControllerTest and
BouncesControllerTest while preserving the existing assertion behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cbb71002-bd7b-43f1-8ab4-16dc3b002fdc

📥 Commits

Reviewing files that changed from the base of the PR and between 244be0d and 0e57640.

📒 Files selected for processing (22)
  • assets/vue/api.js
  • composer.json
  • config/packages/twig.yaml
  • config/services.yml
  • phpunit.xml.dist
  • src/Controller/AnalyticsController.php
  • src/Controller/BouncesController.php
  • src/Controller/CampaignsController.php
  • src/Controller/DashboardController.php
  • src/Controller/ListsController.php
  • src/Controller/PublicPagesController.php
  • src/Controller/SettingsController.php
  • src/Controller/SubscribersController.php
  • src/Controller/TemplatesController.php
  • templates/base.html.twig
  • templates/spa.html.twig
  • tests/Integration/Controller/AnalyticsControllerTest.php
  • tests/Integration/Controller/BouncesControllerTest.php
  • tests/Integration/Controller/CampaignsControllerTest.php
  • tests/Integration/Controller/DashboardControllerTest.php
  • tests/Integration/Controller/ListsControllerTest.php
  • tests/bootstrap.php
💤 Files with no reviewable changes (9)
  • src/Controller/AnalyticsController.php
  • src/Controller/DashboardController.php
  • src/Controller/SettingsController.php
  • src/Controller/BouncesController.php
  • src/Controller/CampaignsController.php
  • src/Controller/ListsController.php
  • src/Controller/SubscribersController.php
  • src/Controller/TemplatesController.php
  • src/Controller/PublicPagesController.php

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