Skip to content

Expand APPSEC integration testing: Symfony - #4268

Open
estringana wants to merge 9 commits into
masterfrom
estringana/test-more-symfony-versions
Open

estringana wants to merge 9 commits into
masterfrom
estringana/test-more-symfony-versions

Conversation

@estringana

@estringana estringana commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Expand appsec integration testing to all supported versions of Symfony

Right now only one version of symfony was tested. This PR expands the testing to all supported versions

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 3 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | test_integrations_frankenphp: [8.4] — ❌ 1 test failed

View more details · View in GitLab

❌ DDTrace\Tests\Integrations\Frankenphp\CommonScenariosTest::testScenario from frankenphp-test.DDTrace\Tests\Integrations\Frankenphp\CommonScenariosTest
m/prometheus/client_model@v0.6.2/go/metrics.pb.go:25:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/github.com/prometheus/common@v0.70.1/model/metric.go:28:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/github.com/prometheus/common@v0.70.1/expfmt/decode.go:25:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/github.com/prometheus/common@v0.70.1/expfmt/encode.go:24:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/github.com/smallstep/certificates@v0.30.2/api/render/render.go:9:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/google.golang.org/grpc@v1.81.1/internal/pretty/pretty.go:28:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/google.golang.org/grpc@v1.81.1/binarylog/grpc_binarylog_v1/binarylog.pb.go:30:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/google.golang.org/genproto/googleapis/rpc@v0.0.0-20260526163538-3dc84a4a5aaa/status/status.pb.go:29:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/github.com/smallstep/linkedca@v0.25.0/config.pb.go:12:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
/home/circleci/go/pkg/mod/github.com/golang/protobuf@v1.5.4/proto/buffer.go:12:2: google.golang.org/protobuf@v1.36.11: read "https://proxy.golang.org/google.golang.org/protobuf/@v/v1.36.11.zip": stream error: stream ID 33; INTERNAL_ERROR; received from peer
...
DataDog/apm-reliability/dd-trace-php | test_integrations_frankenphp: [8.5] — 🔄 Retry may pass, looks flaky

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-php | publish docker image for system tests

View more details · View in GitLab

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.38% (-0.01%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 556192a | Docs | View more details | Give us feedback!

@estringana
estringana marked this pull request as ready for review October 5, 2026 13:20
@estringana
estringana requested review from a team as code owners October 5, 2026 13:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T13:36:51.129864Z a6110d0 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-05T13:31:29.312658Z a6110d0 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: a6110d0811

ℹ️ 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 tests/Frameworks/Symfony/Version_7_3/composer.lock
Comment thread tests/Frameworks/Symfony/Version_5_2/docker-init.sh

Copilot AI left a comment

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.

Copilot review overview

🟢 Approval recommended

The implementation is coherent, with only a non-blocking inaccurate documentation statement identified.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Expands AppSec Symfony integration coverage across supported fixture versions using a shared test suite.

Changes:

  • Adds Symfony 4.4, 5.2, 7.3, and latest integration suites.
  • Extracts shared AppSec assertions from the Symfony 6.2 suite.
  • Adds fixture routes, Apache rewrites, SQLite initialization, and endpoint probes.
File Description
tests/​Frameworks/​Symfony/​Version_7_3/​src/​Controller/​HomeController.php Adds test routes.
tests/​Frameworks/​Symfony/​Version_7_3/​public/​outside_of_framework.php Adds endpoint-state probe.
tests/​Frameworks/​Symfony/​Version_7_3/​public/​.htaccess Enables front-controller routing.
tests/​Frameworks/​Symfony/​Version_7_3/​docker-init.sh Initializes the SQLite fixture.
tests/​Frameworks/​Symfony/​Version_7_3/​composer.json Limits mocks to development autoloading.
tests/​Frameworks/​Symfony/​Version_5_2/​src/​Controller/​HomeController.php Adds test routes.
tests/​Frameworks/​Symfony/​Version_5_2/​public/​outside_of_framework.php Adds endpoint-state probe.
tests/​Frameworks/​Symfony/​Version_5_2/​public/​.htaccess Enables front-controller routing.
tests/​Frameworks/​Symfony/​Version_5_2/​docker-init.sh Initializes the SQLite fixture.
tests/​Frameworks/​Symfony/​Version_4_4/​src/​Controller/​HomeController.php Adds version-compatible test routes.
tests/​Frameworks/​Symfony/​Version_4_4/​public/​outside_of_framework.php Adds endpoint-state probe.
tests/​Frameworks/​Symfony/​Version_4_4/​public/​.htaccess Enables front-controller routing.
tests/​Frameworks/​Symfony/​Version_4_4/​docker-init.sh Initializes the SQLite fixture.
tests/​Frameworks/​Symfony/​Latest/​src/​Controller/​HomeController.php Adds current Symfony test routes.
tests/​Frameworks/​Symfony/​Latest/​public/​outside_of_framework.php Adds endpoint-state probe.
tests/​Frameworks/​Symfony/​Latest/​public/​.htaccess Enables front-controller routing.
tests/​Frameworks/​Symfony/​Latest/​docker-init.sh Initializes the SQLite fixture.
tests/​Frameworks/​Symfony/​Latest/​composer.json Limits mocks to development autoloading.
appsec/​tests/​integration/​src/​test/​groovy/​com/​datadog/​appsec/​php/​integration/​SymfonyLatestTests.groovy Adds latest-version coverage.
appsec/​tests/​integration/​src/​test/​groovy/​com/​datadog/​appsec/​php/​integration/​Symfony73Tests.groovy Adds Symfony 7.3 coverage.
appsec/​tests/​integration/​src/​test/​groovy/​com/​datadog/​appsec/​php/​integration/​Symfony62Tests.groovy Adopts the shared suite.
appsec/​tests/​integration/​src/​test/​groovy/​com/​datadog/​appsec/​php/​integration/​Symfony52Tests.groovy Adds Symfony 5.2 coverage.
appsec/​tests/​integration/​src/​test/​groovy/​com/​datadog/​appsec/​php/​integration/​Symfony44Tests.groovy Adds Symfony 4.4 coverage.
appsec/​tests/​integration/​src/​test/​groovy/​com/​datadog/​appsec/​php/​integration/​AbstractSymfonyAppsecTests.groovy Defines shared AppSec assertions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cataphract cataphract left a comment

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.

Approved with two comments

Comment on lines +45 to +52
/** Status code the fixture returns after a successful form_login. */
int expectedLoginSuccessStatus() { 302 }

/** Status code the fixture returns after a failed form_login. */
int expectedLoginFailureStatus() { 302 }

/** Status code the fixture returns after a successful signup. */
int expectedSignupStatus() { 302 }

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.

Wouldn't it be better to unify the several versions' implementations?

Comment on lines +11 to +54
export DATABASE_URL="sqlite:////var/www/var/app.db"
export APP_ENV=prod

# The committed config/packages/doctrine.yaml hard-codes a mysql URL (shared with
# trace integration tests that run against a mysql service). Drop a prod-env
# override so DATABASE_URL is honoured and the fixture can run on sqlite.
mkdir -p config/packages/prod
cat > config/packages/prod/doctrine_appsec.yaml << 'YAMLEOF'
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
server_version: ~
YAMLEOF
mark "wrote doctrine_appsec.yaml"

composer config optimize-autoloader false
mark "composer config done"
if [[ -f composer.lock ]]; then
composer install --no-dev --no-scripts
else
composer update --no-dev --no-scripts
fi
mark "composer install/update done"

mkdir -p var
# Nuke any residual state from a cached volume: Symfony prod cache AND the
# sqlite database. Starting from a clean DB file lets `doctrine:schema:create`
# succeed without needing a separate `doctrine:database:drop` step (which has
# been observed to hang silently under some SSI setups).
rm -rf var/cache/* var/app.db
mark "cleaned var/"

php bin/console doctrine:schema:create
mark "schema:create done"

php << 'PHPEOF'
<?php
// Symfony 7+ ships a `MakerBundle`-generated User with an extra NOT-NULL
// `is_verified` column. We seed it explicitly so SQLite doesn't reject the
// INSERT (which `OR IGNORE` would silently swallow).
$db = new PDO('sqlite:/var/www/var/app.db');
$stmt = $db->prepare('INSERT OR IGNORE INTO "user" (email, password, roles, is_verified) VALUES (?, ?, ?, ?)');
$stmt->execute(['test-user@email.com', '$2y$13$WNnAxSuifzgXGx9kYfFr.eMaXzE50MmrMnXxmrlZqxSa21oiMyy0i', '[]', 1]);
PHPEOF

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.

You can also use a mysql container (see org.testcontainers.mysql.MySQLContainer). That's probably the best option if it doesn't slow down the tests too much

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.

3 participants