Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update hatch version and remove hatch-containers #10373

Merged
merged 25 commits into from
Aug 27, 2024

Conversation

taegyunkim
Copy link
Contributor

@taegyunkim taegyunkim commented Aug 24, 2024

Initially, started this PR to not use pip install to install hatch. hatch docs doesn't recommend installing hatch via pip, as it could modify the Python environment in which you choose to install.

I addressed some of them but not all.

Removing hatch-containers, which was used to build docs on local mac. It can now build docs natively by installing enchant, also running hatch run docs:build in scripts/ddtest works too.

Checklist

  • 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
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • 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 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

@taegyunkim taegyunkim requested a review from a team as a code owner August 24, 2024 00:31
@taegyunkim taegyunkim requested a review from erikayasuda August 24, 2024 00:31
@taegyunkim taegyunkim added the changelog/no-changelog A changelog entry is not required for this PR. label Aug 24, 2024
Copy link
Contributor

github-actions bot commented Aug 24, 2024

CODEOWNERS have been resolved as:

.circleci/config.templ.yml                                              @DataDog/python-guild @DataDog/apm-core-python
.github/workflows/generate-package-versions.yml                         @DataDog/python-guild @DataDog/apm-core-python
.github/workflows/unit_tests.yml                                        @DataDog/python-guild @DataDog/apm-core-python
.readthedocs.yml                                                        @DataDog/python-guild @DataDog/apm-core-python
docker/Dockerfile                                                       @DataDog/apm-core-python
docs/contributing-testing.rst                                           @DataDog/python-guild
hatch.toml                                                              @DataDog/python-guild
scripts/ddtest                                                          @DataDog/apm-core-python
scripts/docs/build.sh                                                   @DataDog/python-guild
scripts/docs/install.sh                                                 @DataDog/python-guild

@taegyunkim taegyunkim enabled auto-merge (squash) August 24, 2024 00:32
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Aug 24, 2024

Datadog Report

Branch report: taegyunkim/ddtest-hatch-no
Commit report: 73de7c3
Test service: dd-trace-py

✅ 0 Failed, 141066 Passed, 1673 Skipped, 9h 11m 40.15s Total duration (1m 26.04s time saved)
❄️ 4 New Flaky

New Flaky Tests (4)

  • test_iter_events_multi_thread - test_memalloc.py - Last Failure

    Expand for error
     assert 815 >= 1000
    
  • test_cmdi - test_pygoat.py - Last Failure

    Expand for error
     HTTPConnectionPool(host='0.0.0.0', port=9126): Max retries exceeded with url: /test/session/traces?test_session_token=pygoat_test (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f09957c92a0>: Failed to establish a new connection: [Errno 111] Connection refused'))
    
  • test_sqli - test_pygoat.py - Last Failure

    Expand for error
     HTTPConnectionPool(host='0.0.0.0', port=9126): Max retries exceeded with url: /test/session/start?test_session_token=pygoat_test (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0991e788b0>: Failed to establish a new connection: [Errno 111] Connection refused'))
    
  • test_ssrf2 - test_pygoat.py - Last Failure

    Expand for error
     HTTPConnectionPool(host='0.0.0.0', port=9126): Max retries exceeded with url: /test/session/start?test_session_token=pygoat_test (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0991e4a560>: Failed to establish a new connection: [Errno 111] Connection refused'))
    

@taegyunkim taegyunkim requested a review from a team as a code owner August 24, 2024 01:10
@pr-commenter
Copy link

pr-commenter bot commented Aug 24, 2024

Benchmarks

Benchmark execution time: 2024-08-26 21:37:10

Comparing candidate commit 73de7c3 in PR branch taegyunkim/ddtest-hatch-no with baseline commit 769579f in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 353 metrics, 47 unstable metrics.

@taegyunkim taegyunkim changed the title chore: don't install hatch via pip in scripts/ddtest chore: don't install hatch via pip Aug 24, 2024
@taegyunkim
Copy link
Contributor Author

taegyunkim commented Aug 26, 2024

This keeps failing on dd_coverage, something more fundamental is wrong looking at discussion on our slack regarding testrunner image

@taegyunkim taegyunkim closed this Aug 26, 2024
auto-merge was automatically disabled August 26, 2024 13:54

Pull request was closed

@taegyunkim taegyunkim reopened this Aug 26, 2024
@taegyunkim taegyunkim changed the title chore: don't install hatch via pip [do not merge] chore: don't install hatch via pip Aug 26, 2024
@taegyunkim taegyunkim force-pushed the taegyunkim/ddtest-hatch-no branch from c6c223d to 0d4e88f Compare August 26, 2024 14:43
@taegyunkim taegyunkim changed the title [do not merge] chore: don't install hatch via pip chore: update hatch version and remove hatch-containers Aug 26, 2024
@taegyunkim taegyunkim force-pushed the taegyunkim/ddtest-hatch-no branch from 0037f4b to 73de7c3 Compare August 26, 2024 21:01
Copy link
Contributor

@erikayasuda erikayasuda left a comment

Choose a reason for hiding this comment

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

Just some clarifying questions, otherwise LGTM

.circleci/config.templ.yml Show resolved Hide resolved
docker/Dockerfile Show resolved Hide resolved
@taegyunkim taegyunkim merged commit ecc5741 into main Aug 27, 2024
206 of 207 checks passed
@taegyunkim taegyunkim deleted the taegyunkim/ddtest-hatch-no branch August 27, 2024 00:11
romainkomorn-exdatadog pushed a commit that referenced this pull request Aug 27, 2024
#10373 modified docker/Dockerfile but didn't trigger conftests circle ci
test and merged. After the merge on main, conftests started to fail on
main.

1. Fix it by specifying the python version on `hatch.toml`. This
actually looks like a bug on hatch and for now setting the version to be
3.10 as circle ci docker image we use for conftests is based on python
3.10, and hatch seems to pick up the version when it's available. If not
set, hatch installs 3.12 and results in this weird error, [failing to
install ddtrace as it can't find clang compiler.
](https://app.circleci.com/pipelines/github/DataDog/dd-trace-py/70063/workflows/21549ae8-682f-4538-bd5a-b1b1077e5043/jobs/4254100)
2. Also updates suitespec generator 
gen_circleci_config.py calls `fnmatch.filter(changed_files, pattern)` to
get the list of files matching pattern and look below.

```
❯ python
Python 3.12.5 (main, Aug 20 2024, 16:07:54) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fnmatch
>>> fnmatch.filter(["docker/Dockerfile"], "docker")
[]
>>> fnmatch.filter(["docker/Dockerfile"], "docker*")
['docker/Dockerfile']
```


## 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)
@taegyunkim taegyunkim mentioned this pull request Aug 28, 2024
2 tasks
taegyunkim added a commit that referenced this pull request Aug 28, 2024
1. Upgrade testrunner image to the one generated by #10373 
2. testrunner now runs python 3.11.9 (upgraded from 3.11.3) and gevent
isn't compatible with python 3.11.9,
python/cpython#117983, so update the test to
run when version < 3.11.9
3. Regenerate riot file for appsec_integrations using python 3.12, as
outdated pydantic doesn't work with 3.12.4, see
pydantic/pydantic#9637. This also resulted in
updating pytest version and `setup_module` is used instead of `setup`.
4. Add `CMAKE_BUILD_PARALLEL_LEVEL` to a few places


## 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants