Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5842786
Try datadog test optimization
michael-richey Apr 17, 2025
d7f5799
move
michael-richey Apr 17, 2025
266ea37
on push
michael-richey Apr 17, 2025
58c80e0
format
michael-richey Apr 17, 2025
50af3a0
Swich to env
michael-richey Apr 17, 2025
d7e7527
Remove agent
michael-richey Apr 17, 2025
8dfb907
install requirements
michael-richey Apr 17, 2025
2e320bc
Add checkout
michael-richey Apr 17, 2025
0da283c
Need this
michael-richey Apr 17, 2025
ceb9ec3
actually run the tests
michael-richey Apr 17, 2025
28cfd17
Fix indent
michael-richey Apr 17, 2025
c67e078
record
michael-richey Apr 17, 2025
553a0ff
Move record
michael-richey Apr 17, 2025
beecfa4
Turn of record
michael-richey Apr 17, 2025
524e7fe
Turn off recording
michael-richey Apr 17, 2025
918db69
switch to sha
michael-richey Apr 17, 2025
823b3f7
add sha256:
michael-richey Apr 17, 2025
76d77d2
Version
michael-richey Apr 17, 2025
d6f6936
Add version
michael-richey Apr 17, 2025
f558a13
Try sha again
michael-richey Apr 17, 2025
64380b2
sha for this
michael-richey Apr 17, 2025
7ddbee7
sha for checkout
michael-richey Apr 17, 2025
c835de1
Test config
michael-richey Apr 18, 2025
defdb83
Change this to scheduled
michael-richey May 7, 2025
4308c0b
They specifically recommend not running at the 0 minute
michael-richey May 7, 2025
516278c
Run on mac and windows too
michael-richey May 7, 2025
b8a93aa
Trigger on push
michael-richey May 7, 2025
b846f5d
Refine the schedule and remove my branch from the push trigger
michael-richey May 7, 2025
15c374a
Merge branch 'main' into michael.richey/dd-test-opt
michael-richey May 7, 2025
d2ec8c2
Add the ddtrace option
michael-richey May 7, 2025
a770634
Add my branch back
michael-richey May 7, 2025
c689cb7
Try this instead, found in test optimization doc
michael-richey May 7, 2025
9b105ef
Try this way
michael-richey May 7, 2025
2ff03aa
Try through tox
michael-richey May 7, 2025
7bf5c6b
Remove thes
michael-richey May 7, 2025
a20d372
Try updating ddtrace
michael-richey May 7, 2025
9d3275b
Set env var back to true
michael-richey May 7, 2025
944bdaa
Add the agent for traces
michael-richey May 7, 2025
6a534b4
Move the agent into the os matrix
michael-richey May 7, 2025
0484e7f
Back to trying the visibility script
michael-richey May 7, 2025
0cfbd7b
Java -> Python for lang
michael-richey May 7, 2025
4be2b7d
Directly pass in --ddtrace to pytest
michael-richey May 8, 2025
a4261da
Pass args into tox differently
michael-richey May 8, 2025
a29d267
Merge branch 'main' into michael.richey/dd-test-opt
michael-richey May 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/datadog_test_optimization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Datadog Test Optimization

permissions:
checks: write
contents: read

on:
schedule:
# every hour, 9-5 eastern, M-F
- cron: '15 12-21 * * 1-5'

push:
branches:
- 'main'
- 'michael.richey/dd-test-opt'

env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_DESTINATION_API_KEY: ${{ secrets.DD_DESTINATION_API_KEY }}
DD_DESTINATION_APP_KEY: ${{ secrets.DD_DESTINATION_APP_KEY }}
DD_DESTINATION_API_URL: ${{ secrets.DD_DESTINATION_API_URL }}
DD_SOURCE_API_KEY: ${{ secrets.DD_SOURCE_API_KEY }}
DD_SOURCE_APP_KEY: ${{ secrets.DD_SOURCE_APP_KEY }}
DD_SOURCE_API_URL: ${{ secrets.DD_SOURCE_API_URL }}
RECORD: false
DD_ENV: ci
DD_SERVICE: datadog-sync-cli
DD_TAGS: "team:hamr"
DD_TRACE_ANALYTICS_ENABLED: "true"

jobs:
test-optimization:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Python
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c
with:
python-version: 3.12
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Configure Datadog Test Optimization
uses: datadog/test-visibility-github-action@v2

Choose a reason for hiding this comment

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

🟠 Code Vulnerability

Workflow depends on a GitHub actions pinned by tag instead of a hash. (...read more)

Pin GitHub Actions by commit hash to ensure supply chain security.

Using a branch (@main) or tag (@v1) allows for implicit updates, which can introduce unexpected or malicious changes. Instead, always pin actions to a full length commit SHA. You can find the commit SHA for the latest tag from the action’s repository and ensure frequent updates via auto-updaters such as dependabot. Include a comment with the corresponding full-length SemVer tag for clarity:

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

View in Datadog  Leave us feedback  Documentation

Choose a reason for hiding this comment

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

🔴 High: Code Vulnerability

Workflow depends on a GitHub actions pinned by tag instead of a hash. (...read more)

Pin GitHub Actions by commit hash to ensure supply chain security.

Using a branch (@main) or tag (@v1) allows for implicit updates, which can introduce unexpected or malicious changes. Instead, always pin actions to a full length commit SHA. You can find the commit SHA for the latest tag from the action’s repository and ensure frequent updates via auto-updaters such as dependabot. Include a comment with the corresponding full-length SemVer tag for clarity:

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

View in Datadog  Leave us feedback  Documentation

with:
languages: python
api_key: ${{ secrets.DD_API_KEY }}
site: datadoghq.com
- name: Install requirements
run: |
python -m pip install .
python -m pip install tox
- name: Run unit tests
run: tox -e py312 -- --ddtrace
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ env:
DD_SOURCE_API_KEY: ${{ secrets.DD_SOURCE_API_KEY }}
DD_SOURCE_APP_KEY: ${{ secrets.DD_SOURCE_APP_KEY }}
DD_SOURCE_API_URL: ${{ secrets.DD_SOURCE_API_URL }}
PYTEST_ADDOPTS: "--ddtrace"
DD_ENV: ci
DD_SERVICE: datadog-sync-cli
DD_TAGS: "team:hamr"
DD_TRACE_ANALYTICS_ENABLED: "true"

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
DD_AGENT_HOST: localhost
DD_ENV: ci
DD_SERVICE: datadog-sync-cli
DD_TAGS: "team:integrations-tools-and-libraries"
DD_TAGS: "team:hamr"
DD_TRACE_ANALYTICS_ENABLED: "true"
RECORD: "none"
PYTEST_ADDOPTS: "--ddtrace"
Expand Down
18 changes: 18 additions & 0 deletions scripts/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
boto3==1.35.91
click==8.1.7
configobj==5.0.8

Choose a reason for hiding this comment

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

🟡 Low: Library Vulnerability

configobj → 5.0.8

configobj ReDoS exploitable by developer using values in a server-side configuration file

View in Datadog  Leave us feedback  Documentation

deepdiff==6.7.1
aiohttp==3.9.5

Choose a reason for hiding this comment

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

🟠 Medium: Library Vulnerability

aiohttp → 3.9.5

In aiohttp, compressed files as symlinks are not protected from path traversal

View in Datadog  Leave us feedback  Documentation

tqdm==4.66.2

Choose a reason for hiding this comment

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

🟡 Low: Library Vulnerability

tqdm → 4.66.2

tqdm CLI arguments injection attack

View in Datadog  Leave us feedback  Documentation

certifi>=2022.12.7

Choose a reason for hiding this comment

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

🔴 High: Library Vulnerability

certifi → 2022.12.7

Removal of e-Tugra root certificate

View in Datadog  Leave us feedback  Documentation

python-dateutil
setuptools>=67.6.0

Choose a reason for hiding this comment

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

🔴 High: Library Vulnerability

setuptools → 67.6.0

setuptools vulnerable to Command Injection via package URL

View in Datadog  Leave us feedback  Documentation

setuptools_scm
ddtrace==2.21.1
black==24.3.0
pytest==8.1.1
pytest-black
pytest-console-scripts
pytest-recording
vcrpy@git+https://github.com/skarimo/vcrpy.git
freezegun==1.5.0