Skip to content

Commit f44f52e

Browse files
ci(iast): update hatch iast envs configuration [backport 3.2] (#12746)
Backport 170e126 from #12740 to 3.2. Removed environment variables from Python commands in `envs.[scenario].scripts` and moved them to `[envs.[scenario].env-vars]`. This improves command readability. Additionally, the internal variable `_DD_IAST_PATCH_MODULES` has been included to prevent potential conflicts observed in other refactors, such as #12639. This PR is a cherry-pick of one of the commits of this PR #12639 ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Alberto Vara <[email protected]>
1 parent 313e56c commit f44f52e

File tree

1 file changed

+53
-13
lines changed

1 file changed

+53
-13
lines changed

hatch.toml

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,17 @@ dependencies = [
296296
"mysqlclient==2.1.1",
297297
]
298298

299+
[envs.appsec_iast_default.env-vars]
300+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
301+
DD_IAST_REQUEST_SAMPLING = "100"
302+
DD_IAST_DEDUPLICATION_ENABLED = "false"
303+
304+
299305
[envs.appsec_iast_default.scripts]
300306
test = [
301307
"uname -a",
302308
"pip freeze",
303-
"DD_IAST_REQUEST_SAMPLING=100 DD_IAST_DEDUPLICATION_ENABLED=false python -m pytest {args:tests/appsec/iast/}",
309+
"python -m pytest {args:tests/appsec/iast/}",
304310
]
305311

306312
[[envs.appsec_iast_default.matrix]]
@@ -322,6 +328,11 @@ dependencies = [
322328
"pytest-memray"
323329
]
324330

331+
[envs.appsec_iast_memcheck.env-vars]
332+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
333+
DD_IAST_REQUEST_SAMPLING = "100"
334+
DD_IAST_DEDUPLICATION_ENABLED = "false"
335+
325336
[envs.appsec_iast_memcheck.scripts]
326337
test = [
327338
"uname -a",
@@ -342,6 +353,11 @@ dependencies = [
342353
"clang"
343354
]
344355

356+
[envs.appsec_iast_native.env-vars]
357+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
358+
DD_IAST_REQUEST_SAMPLING = "100"
359+
DD_IAST_DEDUPLICATION_ENABLED = "false"
360+
345361
[envs.appsec_iast_native.scripts]
346362
test = [
347363
"cmake -DCMAKE_BUILD_TYPE=Debug -DPYTHON_EXECUTABLE=python -S ddtrace/appsec/_iast/_taint_tracking -B ddtrace/appsec/_iast/_taint_tracking",
@@ -366,19 +382,22 @@ dependencies = [
366382
"virtualenv-clone"
367383
]
368384

385+
[envs.appsec_iast_packages.env-vars]
386+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
387+
DD_IAST_REQUEST_SAMPLING = "100"
388+
DD_IAST_DEDUPLICATION_ENABLED = "false"
389+
DD_FAST_BUILD = "0"
390+
369391
[envs.appsec_iast_packages.scripts]
370392
test = [
371393
"uname -a",
372394
"pip freeze",
373-
"DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 DD_IAST_DEDUPLICATION_ENABLED=false python -m pytest tests/appsec/iast_packages",
395+
"python -m pytest tests/appsec/iast_packages",
374396
]
375397

376398
[[envs.appsec_iast_packages.matrix]]
377399
python = ["3.9", "3.10", "3.11", "3.12"]
378400

379-
[envs.appsec_iast_packages.env-vars]
380-
DD_FAST_BUILD = "0"
381-
382401
## ASM iast_tdd_propagation
383402

384403
[envs.iast_tdd_propagation]
@@ -398,11 +417,16 @@ dependencies = [
398417
"aiosqlite",
399418
]
400419

420+
[envs.iast_tdd_propagation.env-vars]
421+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
422+
DD_IAST_REQUEST_SAMPLING = "100"
423+
DD_IAST_DEDUPLICATION_ENABLED = "false"
424+
401425
[envs.iast_tdd_propagation.scripts]
402426
test = [
403427
"uname -a",
404428
"pip freeze",
405-
"DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 DD_IAST_DEDUPLICATION_ENABLED=false python -m pytest tests/appsec/iast_tdd_propagation",
429+
"python -m pytest tests/appsec/iast_tdd_propagation",
406430
]
407431

408432
[[envs.iast_tdd_propagation.matrix]]
@@ -423,11 +447,18 @@ dependencies = [
423447
"Django{matrix:django}",
424448
]
425449

450+
[envs.appsec_integrations_django.env-vars]
451+
DD_TRACE_AGENT_URL = "http://testagent:9126"
452+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
453+
DD_IAST_REQUEST_SAMPLING = "100"
454+
DD_IAST_DEDUPLICATION_ENABLED = "false"
455+
456+
426457
[envs.appsec_integrations_django.scripts]
427458
test = [
428459
"uname -a",
429460
"pip freeze",
430-
"DD_TRACE_AGENT_URL=\"http://testagent:9126\" DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 DD_IAST_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/django_tests/}",
461+
"python -m pytest -vvv {args:tests/appsec/integrations/django_tests/}",
431462
]
432463

433464
[[envs.appsec_integrations_django.matrix]]
@@ -455,11 +486,17 @@ dependencies = [
455486
"flask{matrix:flask}",
456487
]
457488

489+
[envs.appsec_integrations_flask.env-vars]
490+
DD_TRACE_AGENT_URL = "http://testagent:9126"
491+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
492+
DD_IAST_REQUEST_SAMPLING = "100"
493+
DD_IAST_DEDUPLICATION_ENABLED = "false"
494+
458495
[envs.appsec_integrations_flask.scripts]
459496
test = [
460497
"uname -a",
461498
"pip freeze",
462-
"DD_TRACE_AGENT_URL=\"http://testagent:9126\" DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_ENABLED=true DD_IAST_REQUEST_SAMPLING=100 DD_IAST_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/flask_tests/}",
499+
"python -m pytest -vvv {args:tests/appsec/integrations/flask_tests/}",
463500
]
464501

465502
[[envs.appsec_integrations_flask.matrix]]
@@ -506,11 +543,17 @@ dependencies = [
506543
"fastapi{matrix:fastapi}"
507544
]
508545

546+
[envs.appsec_integrations_fastapi.env-vars]
547+
DD_TRACE_AGENT_URL = "http://testagent:9126"
548+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec."
549+
DD_IAST_REQUEST_SAMPLING = "100"
550+
DD_IAST_DEDUPLICATION_ENABLED = "false"
551+
509552
[envs.appsec_integrations_fastapi.scripts]
510553
test = [
511554
"uname -a",
512555
"pip freeze",
513-
"DD_TRACE_AGENT_URL=\"http://testagent:9126\" DD_CIVISIBILITY_ITR_ENABLED=0 DD_IAST_REQUEST_SAMPLING=100 DD_IAST_DEDUPLICATION_ENABLED=false python -m pytest -vvv {args:tests/appsec/integrations/fastapi_tests/}",
556+
"python -m pytest -vvv {args:tests/appsec/integrations/fastapi_tests/}",
514557
]
515558

516559

@@ -529,7 +572,6 @@ fastapi = ["==0.94.1"]
529572
python = ["3.8", "3.10", "3.13"]
530573
fastapi = ["~=0.114.2"]
531574

532-
533575
## ASM FastAPI
534576

535577
[envs.appsec_threats_fastapi]
@@ -584,7 +626,7 @@ dependencies = [
584626

585627
[envs.iast_aggregated_leak_testing.env-vars]
586628
DD_IAST_ENABLED = "true"
587-
_DD_IAST_PATCH_MODULES = "scripts.iast"
629+
_DD_IAST_PATCH_MODULES = "benchmarks.,tests.appsec.,scripts.iast."
588630
DD_FAST_BUILD = "0"
589631

590632
[envs.iast_aggregated_leak_testing.scripts]
@@ -598,8 +640,6 @@ test = [
598640
[[envs.iast_aggregated_leak_testing.matrix]]
599641
python = ["3.10", "3.11", "3.12"]
600642

601-
602-
603643
## pytorch profiling test
604644

605645
[envs.profiling_pytorch]

0 commit comments

Comments
 (0)