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(ci_visibility): don't log exception when codeowners can't be loaded #10423

Conversation

romainkomorndatadog
Copy link
Collaborator

@romainkomorndatadog romainkomorndatadog commented Aug 28, 2024

Reverts the Codeowners.__init__() behavior introduced in #10094 which changed the exception being caught by the CIVisibility service when instantiating Codeowners(), resulting in undesirable log messages.

Codeowners.__init__() raising a ValueError exception, caught by the sole caller (CIVisibility.__init__()).

The of() behavior is maintained and the caller is updated to check for [] as an indication that no codeowner was found.

There is no release note as #10094 was only backported into 2.12.

As a bonus, type hints are converted from comments to annotations.

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

@romainkomorndatadog romainkomorndatadog added the changelog/no-changelog A changelog entry is not required for this PR. label Aug 28, 2024
@romainkomorndatadog romainkomorndatadog self-assigned this Aug 28, 2024
Copy link
Contributor

CODEOWNERS have been resolved as:

ddtrace/internal/ci_visibility/recorder.py                              @DataDog/ci-app-libraries
ddtrace/internal/codeowners.py                                          @DataDog/apm-core-python @datadog/ci-app-libraries

@datadog-dd-trace-py-rkomorn
Copy link

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

Datadog Report

Branch report: romain.komorn/chore/stop_logging_warnings_for_codeowners
Commit report: a3a6b2f
Test service: dd-trace-py

✅ 0 Failed, 288 Passed, 1914 Skipped, 4m 58.02s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Aug 28, 2024

Benchmarks

Benchmark execution time: 2024-08-29 08:12:57

Comparing candidate commit a3a6b2f in PR branch romain.komorn/chore/stop_logging_warnings_for_codeowners with baseline commit 03f3219 in branch main.

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

@romainkomorndatadog
Copy link
Collaborator Author

Adding @brettlangdon and @emmettbutler as reviewers since you two seem to have the most knowledge behind the original "remove crashing behavior" work.

ddtrace/internal/ci_visibility/recorder.py Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@romainkomorndatadog romainkomorndatadog left a comment

Choose a reason for hiding this comment

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

Added a3a6b2f to make things a little more resilient.

ddtrace/internal/ci_visibility/recorder.py Outdated Show resolved Hide resolved
@romainkomorndatadog romainkomorndatadog enabled auto-merge (squash) August 29, 2024 15:20
@romainkomorndatadog romainkomorndatadog merged commit ca182d0 into main Aug 29, 2024
166 of 170 checks passed
@romainkomorndatadog romainkomorndatadog deleted the romain.komorn/chore/stop_logging_warnings_for_codeowners branch August 29, 2024 15:28
romainkomorndatadog added a commit that referenced this pull request Aug 30, 2024
…aded (#10423)

Reverts the `Codeowners.__init__()` behavior introduced in #10094 which
changed the exception being caught by the `CIVisibility` service when
instantiating `Codeowners()`, resulting in undesirable log messages.

`Codeowners.__init__()` raising a `ValueError` exception, caught by the
sole caller (`CIVisibility.__init__()`).

The `of()` behavior is maintained and the caller is updated to check for
`[]` as an indication that no codeowner was found.

There is no release note as #10094 was only backported into `2.12`.

As a bonus, type hints are converted from comments to annotations.

## 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
- [ ] 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)

(cherry picked from commit ca182d0)
romainkomorndatadog added a commit that referenced this pull request Aug 30, 2024
…aded [backport 2.12] (#10455)

Backport ca182d0 from #10423 to 2.12. 

Reverts the `Codeowners.__init__()` behavior introduced in #10094 which
changed the exception being caught by the `CIVisibility` service when
instantiating `Codeowners()`, resulting in undesirable log messages.

`Codeowners.__init__()` raising a `ValueError` exception, caught by the
sole caller (`CIVisibility.__init__()`).

The `of()` behavior is maintained and the caller is updated to check for
`[]` as an indication that no codeowner was found.

There is no release note as #10094 was only backported into `2.12`.

As a bonus, type hints are converted from comments to annotations.

## 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
backport 2.12 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.

4 participants