Skip to content

Conversation

@romainkomorn-exdatadog
Copy link
Contributor

@romainkomorn-exdatadog romainkomorn-exdatadog commented Oct 26, 2023

Prevents a poorly-structured (but still valid JSON) response from causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare" except is probably overly broad (based on the code, I can only see AttributeError, KeyError or TypeError exceptions), but since the goal is to prevent crashing the test runner, I think the broad except makes sense.

No release note because ITR is in beta.

Checklist

  • Change(s) are motivated and described in the PR description.
  • Testing strategy is described if automated tests are not included in the PR.
  • Risk is outlined (performance impact, potential for breakage, maintainability, etc).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Library release note guidelines are followed. If no release note is required, add label changelog/no-changelog.
  • Documentation is included (in-code, generated user docs, public corp docs).
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Title is accurate.
  • No unnecessary changes are introduced.
  • Description motivates each change.
  • Avoids breaking API changes unless absolutely necessary.
  • Testing strategy adequately addresses listed risk(s).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Release note makes sense to a user of the library.
  • Reviewer has explicitly 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
  • If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

@romainkomorn-exdatadog
Copy link
Contributor Author

I guess I should note I went a bit of a different direction with the tests. They're the first class-based tests in test_ci_visibility.py, but I wanted to be able to share some the CIVisibility mock (since _fetch_tests_to_skip is called after __init__() and last in _start_service().

I'm open to other suggestions, though.

@pr-commenter
Copy link

pr-commenter bot commented Oct 26, 2023

Benchmarks

Benchmark execution time: 2023-10-30 14:01:12

Comparing candidate commit c552512 in PR branch romain.komorn/CIVIS-7807/fix_nonetype_in_fetch_tests_to_skip with baseline commit 6962e47 in branch 2.x.

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

ZStriker19
ZStriker19 previously approved these changes Oct 26, 2023
ericlaz
ericlaz previously approved these changes Oct 27, 2023
ericlaz
ericlaz previously approved these changes Oct 27, 2023
ZStriker19
ZStriker19 previously approved these changes Oct 27, 2023
ZStriker19
ZStriker19 previously approved these changes Oct 27, 2023
ericlaz
ericlaz previously approved these changes Oct 27, 2023
@majorgreys majorgreys enabled auto-merge (squash) October 27, 2023 18:50
…_skip' of github.com:DataDog/dd-trace-py into romain.komorn/CIVIS-7807/fix_nonetype_in_fetch_tests_to_skip
@majorgreys majorgreys merged commit 756ba7e into 2.x Oct 30, 2023
@majorgreys majorgreys deleted the romain.komorn/CIVIS-7807/fix_nonetype_in_fetch_tests_to_skip branch October 30, 2023 14:22
@github-actions
Copy link
Contributor

The backport to 1.20 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.20 1.20
# Navigate to the new working tree
cd .worktrees/backport-1.20
# Create a new branch
git switch --create backport-7369-to-1.20
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 756ba7ecf99a17e6c3f69caf9fe85144f2454772
# Push it to GitHub
git push --set-upstream origin backport-7369-to-1.20
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.20

Then, create a pull request where the base branch is 1.20 and the compare/head branch is backport-7369-to-1.20.

github-actions bot pushed a commit that referenced this pull request Oct 30, 2023
…fetch_tests_to_skip (#7369)

Prevents a poorly-structured (but still valid JSON) response from
causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare"
`except` is probably overly broad (based on the code, I can only see
`AttributeError`, `KeyError` or `TypeError` exceptions), but since the
goal is to prevent crashing the test runner, I think the broad except
makes sense.

No release note because ITR is in beta.

## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] 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)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.

(cherry picked from commit 756ba7e)
github-actions bot pushed a commit that referenced this pull request Oct 30, 2023
…fetch_tests_to_skip (#7369)

Prevents a poorly-structured (but still valid JSON) response from
causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare"
`except` is probably overly broad (based on the code, I can only see
`AttributeError`, `KeyError` or `TypeError` exceptions), but since the
goal is to prevent crashing the test runner, I think the broad except
makes sense.

No release note because ITR is in beta.

## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] 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)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.

(cherry picked from commit 756ba7e)
romainkomorn-exdatadog added a commit that referenced this pull request Oct 30, 2023
…fetch_tests_to_skip (#7369)

Prevents a poorly-structured (but still valid JSON) response from
causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare"
`except` is probably overly broad (based on the code, I can only see
`AttributeError`, `KeyError` or `TypeError` exceptions), but since the
goal is to prevent crashing the test runner, I think the broad except
makes sense.

No release note because ITR is in beta.

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] 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)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.

(cherry picked from commit 756ba7e)
emmettbutler added a commit that referenced this pull request Oct 31, 2023
…fetch_tests_to_skip [backport 2.1] (#7419)

Backport 756ba7e from #7369 to 2.1.

Prevents a poorly-structured (but still valid JSON) response from
causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare"
`except` is probably overly broad (based on the code, I can only see
`AttributeError`, `KeyError` or `TypeError` exceptions), but since the
goal is to prevent crashing the test runner, I think the broad except
makes sense.

No release note because ITR is in beta.

## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] 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)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.

Co-authored-by: Romain Komorn <136473744+romainkomorndatadog@users.noreply.github.com>
Co-authored-by: Emmett Butler <723615+emmettbutler@users.noreply.github.com>
romainkomorn-exdatadog added a commit that referenced this pull request Oct 31, 2023
….. [backport 1.20] (#7420)

... _fetch_tests_to_skip

Backport 756ba7e from #7369 to 1.20.

Prevents a poorly-structured (but still valid JSON) response from
causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare"
`except` is probably overly broad (based on the code, I can only see
`AttributeError`, `KeyError` or `TypeError` exceptions), but since the
goal is to prevent crashing the test runner, I think the broad except
makes sense.

No release note because ITR is in beta.

## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] 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)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.
romainkomorn-exdatadog added a commit that referenced this pull request Nov 6, 2023
….. [backport 2.0] (#7418)

... _fetch_tests_to_skip

Backport 756ba7e from #7369 to 2.0.

Prevents a poorly-structured (but still valid JSON) response from
causing an exception while fetching tests to skip.

An uncaught exception would cause the test runner to crash. The "bare"
`except` is probably overly broad (based on the code, I can only see
`AttributeError`, `KeyError` or `TypeError` exceptions), but since the
goal is to prevent crashing the test runner, I think the broad except
makes sense.

No release note because ITR is in beta.

## Checklist

- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed. If no release note is required, add label
`changelog/no-changelog`.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
- [x] 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)
- [x] If this PR touches code that signs or publishes builds or
packages, or handles credentials of any kind, I've requested a review
from `@DataDog/security-design-and-guidance`.
- [x] This PR doesn't touch any of that.

Co-authored-by: Romain Komorn <136473744+romainkomorndatadog@users.noreply.github.com>
Co-authored-by: Eric Navarro <eric.navarro@datadoghq.com>
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. CI App [DEPRECATED] backport 1.20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants