Skip to content

Conversation

zkoppert
Copy link
Member

@zkoppert zkoppert commented Jul 7, 2025

Pull Request

This pull request includes updates to error handling in the dependabot_file.py and evergreen.py files. The changes clarify that missing files are handled properly, are not errors, and we shouldn't create unnecessary logging unnecessary messages.

Proposed Changes

Error handling improvements:

  • dependabot_file.py: Updated the build_dependabot_file function to handle github3.exceptions.NotFoundError by continuing to the next file when a required file is missing, avoiding error raising or logging. This change is repeated in three different parts of the function. [1] [2] [3]
  • evergreen.py: Updated the check_existing_config function to handle github3.exceptions.NotFoundError similarly, ensuring that missing files are treated as non-critical and returning None instead of raising errors.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance or breaking
    This pull request introduces consistent handling for cases where a required file is not found in the repository. Instead of raising errors or logging, the code now explicitly continues to the next file, ensuring smoother execution in scenarios where certain files are optional.

…taken

Signed-off-by: Zack Koppert <zkoppert@github.com>
@zkoppert zkoppert self-assigned this Jul 7, 2025
@Copilot Copilot AI review requested due to automatic review settings July 7, 2025 22:06
@zkoppert zkoppert requested a review from a team as a code owner July 7, 2025 22:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds explanatory comments to empty except blocks that handle github3.exceptions.NotFoundError to clarify why no action is taken when files are not found. The changes improve code readability by documenting the intentional behavior of continuing execution when optional files are missing.

  • Adds consistent explanatory comments to four empty except blocks
  • Clarifies that missing files are treated as non-critical and execution should continue
  • Improves code maintainability by documenting the reasoning behind empty exception handlers

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
evergreen.py Added comment explaining why NotFoundError is ignored in check_existing_config function
dependabot_file.py Added identical explanatory comments to three separate NotFoundError exception handlers in build_dependabot_file function

@github-actions github-actions bot added the fix label Jul 7, 2025
Copy link
Member

@jmeridth jmeridth left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe in future we create another error type that inherits from this type that is explicitly named?

@zkoppert zkoppert merged commit 3f693d3 into main Jul 7, 2025
33 checks passed
@zkoppert zkoppert deleted the fix-empty-excepts branch July 7, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants