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

Raise URLNotFoundError instead of infinite retry #288

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

LucasG0
Copy link
Contributor

@LucasG0 LucasG0 commented Feb 28, 2025

Fixes #5800.

  • Raise a URLNotFoundError on 404 errors, typically while trying to perform a graphql query on an unexisting branch.
  • Adds an arbitrary 300 seconds maximum duration to avoid infinite loop.

@LucasG0 LucasG0 requested a review from a team February 28, 2025 11:15
Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/client.py 66.66% 2 Missing and 1 partial ⚠️
@@            Coverage Diff             @@
##           stable     #288      +/-   ##
==========================================
+ Coverage   70.35%   70.38%   +0.02%     
==========================================
  Files          81       81              
  Lines        7510     7522      +12     
  Branches     1465     1467       +2     
==========================================
+ Hits         5284     5294      +10     
- Misses       1842     1844       +2     
  Partials      384      384              
Flag Coverage Δ
integration-tests 22.54% <35.71%> (+0.03%) ⬆️
python-3.10 45.44% <28.57%> (-0.05%) ⬇️
python-3.11 45.44% <28.57%> (-0.05%) ⬇️
python-3.12 45.44% <28.57%> (-0.05%) ⬇️
python-3.9 44.28% <35.71%> (-0.04%) ⬇️
python-filler-3.12 23.99% <28.57%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/config.py 87.37% <100.00%> (+0.12%) ⬆️
infrahub_sdk/exceptions.py 81.11% <100.00%> (+0.87%) ⬆️
infrahub_sdk/client.py 67.12% <66.66%> (+0.03%) ⬆️

@LucasG0 LucasG0 force-pushed the lgu-fix-url-not-found branch 2 times, most recently from 8028a02 to 3f0b603 Compare February 28, 2025 11:23
@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Feb 28, 2025
@LucasG0 LucasG0 force-pushed the lgu-fix-url-not-found branch from 3f0b603 to de43a7b Compare February 28, 2025 14:16
Copy link
Contributor

@dgarros dgarros left a comment

Choose a reason for hiding this comment

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

so today we're retry indefinitely ?

@@ -181,6 +181,6 @@ def generate_infrahubctl(context: Context) -> None:


@task(name="generate-sdk")
def generate_python_sdk(context: Context) -> None:
def generate_python_sdk(context: Context) -> None: # noqa: ARG001
Copy link
Contributor

Choose a reason for hiding this comment

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

you can remove context if we don't use it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to be required by invoke tasks

@LucasG0
Copy link
Contributor Author

LucasG0 commented Mar 3, 2025

so today we're retry indefinitely ?

If we delete a branch while a task in running on this branch and triggers this path, typically git-repository-pull-read-only, yes

@LucasG0 LucasG0 requested a review from dgarros March 3, 2025 11:29
@LucasG0 LucasG0 force-pushed the lgu-fix-url-not-found branch from 9b7ff87 to fd67def Compare March 4, 2025 12:51
@LucasG0 LucasG0 merged commit 5f02b64 into stable Mar 4, 2025
18 checks passed
@LucasG0 LucasG0 deleted the lgu-fix-url-not-found branch March 4, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/documentation Improvements or additions to documentation
Projects
None yet
3 participants