-
Notifications
You must be signed in to change notification settings - Fork 468
fix(ci_visibility): add safety checks and exception handling around _fetch_tests_to_skip #7369
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
fix(ci_visibility): add safety checks and exception handling around _fetch_tests_to_skip #7369
Conversation
|
I guess I should note I went a bit of a different direction with the tests. They're the first class-based tests in I'm open to other suggestions, though. |
BenchmarksBenchmark execution time: 2023-10-30 14:01:12 Comparing candidate commit c552512 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 90 metrics, 0 unstable metrics. |
27585e5
51d7e31
…_skip' of github.com:DataDog/dd-trace-py into romain.komorn/CIVIS-7807/fix_nonetype_in_fetch_tests_to_skip
5279131
|
The backport to 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.20Then, create a pull request where the |
…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)
…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)
…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)
…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>
….. [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.
….. [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>
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"
exceptis probably overly broad (based on the code, I can only seeAttributeError,KeyErrororTypeErrorexceptions), 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
changelog/no-changelog.Reviewer Checklist
@DataDog/security-design-and-guidance.