Skip to content

[php] Add symfony framework#7193

Open
estringana wants to merge 15 commits into
mainfrom
estringana/symfony
Open

[php] Add symfony framework#7193
estringana wants to merge 15 commits into
mainfrom
estringana/symfony

Conversation

@estringana

@estringana estringana commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Motivation

Adds a new symfony7x PHP weblog built with Symfony's idiomatic patterns (security component, form-based login, Doctrine ORM). The app implements the standard system-tests endpoint surface including AppSec, login events, automated payment events, and user/session
tracking.

Updates manifests/php.yml with per-test declarations for symfony7x, marking unsupported scenarios as missing_feature where the weblog or tracer version doesn't yet cover them.

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

utils/build/docker/php/symfony7x.Dockerfile                             @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/.apache.conf                   @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/Acme/composer.json             @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/Acme/src/Acme.php              @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/bin/console                    @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/bin/init-db.php                @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/composer.json                  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/config/bundles.php             @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/config/packages/doctrine.yaml  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/config/packages/framework.yaml  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/config/packages/security.yaml  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/config/routes.yaml             @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/config/services.yaml           @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/public/.htaccess               @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/public/index.php               @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Controller/AppController.php  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Controller/LoginController.php  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Entity/User.php            @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Kernel.php                 @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Repository/UserRepository.php  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Security/LoginFailureHandler.php  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Security/LoginSuccessHandler.php  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/src/Security/UserProvider.php  @DataDog/apm-php @DataDog/system-tests-core
utils/build/docker/php/weblogs/symfony7x/var/cache/.gitkeep             @DataDog/apm-php @DataDog/system-tests-core
docs/execute/build.md                                                   @DataDog/system-tests-core
manifests/php.yml                                                       @DataDog/apm-php @DataDog/asm-php
tests/appsec/test_automated_login_events.py                             @DataDog/asm-libraries @DataDog/system-tests-core

@datadog-system-tests-org

datadog-system-tests-org Bot commented Jun 22, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 61 Pipeline jobs failed

Testing the test | System Tests (golang, prod) / parametric / parametric (1)   View in Datadog   GitHub Actions

Testing the test | System Tests (php, dev) / End-to-end #1 / apache-mod-7.2-zts 1   View in Datadog   GitHub Actions

Testing the test | System Tests (php, dev) / End-to-end #1 / laravel11x 1   View in Datadog   GitHub Actions

View all 61 failed jobs.

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6c14076 | Docs | Give us feedback!

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 22, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 27cdcbf | Docs | Datadog PR Page | Give us feedback!

@estringana estringana changed the title Estringana/symfony [php] Add symfony framework Jun 25, 2026
@estringana estringana force-pushed the estringana/symfony branch 2 times, most recently from 421f8d9 to acc6539 Compare June 25, 2026 13:31
@estringana estringana changed the base branch from main to estringana/add-laravel-weblog June 25, 2026 14:51
@estringana estringana force-pushed the estringana/add-laravel-weblog branch 2 times, most recently from 3c04eef to 8eb08bc Compare June 29, 2026 15:15
Base automatically changed from estringana/add-laravel-weblog to main June 30, 2026 08:57
@estringana estringana force-pushed the estringana/symfony branch 2 times, most recently from ac7cac8 to 4e373c0 Compare July 1, 2026 15:31
@estringana estringana force-pushed the estringana/symfony branch from faf23d9 to 27cdcbf Compare July 9, 2026 14:00
@estringana estringana marked this pull request as ready for review July 9, 2026 16:08
@estringana estringana requested a review from a team as a code owner July 9, 2026 16:08
@estringana estringana requested review from a team as code owners July 9, 2026 16:08

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27cdcbf696

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread manifests/php.yml
tests/appsec/test_automated_payment_events.py: v1.17.0-dev
tests/appsec/test_automated_payment_events.py:
- weblog_declaration:
"*": missing_feature (Stripe endpoints not implemented)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep payment tests enabled for existing PHP weblogs

For non-symfony7x PHP weblogs this wildcard now marks the entire automated payment suite as missing_feature, replacing the previous file-level v1.17.0-dev activation. The existing PHP apps already expose the Stripe endpoints (utils/build/docker/php/common/rewrite-rules.conf maps them for plain, and utils/build/docker/php/weblogs/laravel11x/routes/web.php defines them for Laravel), so this silently stops exercising payment-event coverage for all existing PHP variants when their tracer version is new enough. Keep the default enabled and override only weblogs that truly lack the endpoints.

Useful? React with 👍 / 👎.

return new Response('Invalid status', 400, ['Content-Type' => 'text/plain']);
}

#[Route('/otel_drop_in_baggage_api_otel', name: 'otel_drop_in_baggage_api_otel', methods: ['GET'])]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the missing /otel_drop_in Symfony route

When WEBLOG_VARIANT=symfony7x runs the integrations scenario, manifests/php.yml leaves tests/integrations/test_otel_drop_in.py::Test_Otel_Drop_In enabled for PHP 8.2-style weblogs, and that test calls /otel_drop_in to instantiate CachedInstrumentation and emit otel.* telemetry. This controller only adds the baggage-specific OTel routes, so /otel_drop_in returns Symfony's 404 and never emits the telemetry the test waits for; add the route or mark symfony7x missing_feature for that test.

Useful? React with 👍 / 👎.

# Pre-create .env with APP_SECRET and APP_ENV
RUN mkdir -p /var/www/html && \
echo "APP_ENV=prod" > /var/www/html/.env && \
php -r "echo 'APP_SECRET=' . bin2hex(random_bytes(16)) . PHP_EOL;" >> /var/www/html/.env && \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Load or export the Symfony secret

This only writes APP_SECRET into .env, but neither bin/console nor public/index.php loads Dotenv, and symfony/dotenv is not required by the new app. Because config/packages/framework.yaml reads %env(APP_SECRET)%, the Apache runtime environment will not contain the secret that Symfony's security/session services need, so login/session-backed requests can fail even though the file exists. Export the value into the container environment or explicitly load Dotenv before booting the kernel.

Useful? React with 👍 / 👎.

assert self.config_state_2.state == rc.ApplyState.ACKNOWLEDGED

if context.library not in libs_without_user_id:
if login_success_includes_usr_id_meta():

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the blocking test from passing without assertions

For WEBLOG_VARIANT=symfony7x, the new helper returns false, so test_login_event_blocking_auto_id only checks the initial login and remote-config ACKs and never validates that self.r_login_blocked produced the block-user-id attack or a 403. That turns an enabled test into a no-op for this weblog; mark the Symfony case in the manifest or split the expectation instead of gating the core assertions at runtime.

Useful? React with 👍 / 👎.

return new Response('OK', 200, ['Content-Type' => 'text/plain']);
}

#[Route('/endpoint_fallback.php', name: 'endpoint_fallback', methods: ['GET'])]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the resource renaming endpoint for Symfony

The PHP manifest enables tests/test_resource_renaming.py for PHP weblogs, and those tests call /resource_renaming/... expecting an HTTP endpoint tag. I don't see any matching Symfony route in this new controller, so symfony7x will return 404 for those requests and the endpoint-tag assertions will fail; add the catch-all resource-renaming route or mark this weblog as unsupported for that test.

Useful? React with 👍 / 👎.

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.

1 participant