Skip to content

Conversation

abhishekmadan30
Copy link
Contributor

fixes #221 . Created a bunch of helpers to use this package in taskcluster.py . I also didnt completely depcreate the url creation as that is still used. I bypassed it and replaced all uses when to get request is made.

Copy link
Collaborator

@ahal ahal left a comment

Choose a reason for hiding this comment

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

This is shaping up nicely, thanks!

I have some changes to request. Once you put up a new revision I'll pull this down locally and see if it causes any differences in the graph (both here and in Gecko).

@abhishekmadan30 abhishekmadan30 requested a review from ahal August 19, 2025 19:45
@ahal
Copy link
Collaborator

ahal commented Aug 19, 2025

Thanks! I'll take a closer look at this tomorrow. I'll try and test it against gecko_taskgraph as well.

Copy link
Collaborator

@ahal ahal left a comment

Choose a reason for hiding this comment

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

Thanks, I tested this patch both in Taskgraph and the Gecko repo and it looks like it's working as expected!

But get_retry_post_session, _do_request and _handle_artifact are all unused now in taskcluster.py. Can you remove these and associated tests please?

@ahal
Copy link
Collaborator

ahal commented Aug 20, 2025

Also I think I changed my mind about leaving use_proxy in the function signature just for backwards compatibility.. We should remove it rather than confuse consumers who are attempting to set it to False or whatnot and then wondering why it isn't working.

We can do a major version bump for this.. no big deal.

Copy link
Collaborator

@ahal ahal left a comment

Choose a reason for hiding this comment

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

Thank you!

This is mostly cleanup, but there are two issues I neglected to catch in my first review:

  1. The _handle_artifact for yaml
  2. The .capitalize() issue

continue

raise e
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure the taskcluster client would return None on a 404? I would have thought it would raise an exception still.. Though it would probably be from aiohttp rather than requests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(I assume you verified this? It's important to preserve the 404 behaviour here)

@ahal ahal added the BREAKING CHANGE Backwards incompatible request that will require major version bump label Sep 3, 2025
Copy link
Collaborator

@ahal ahal left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the delay + additional iteration. Getting close :)

except HTTPError as e:
if e.response.status_code != 404:
raise
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I might be wrong, but I think if public/label-to-taskid.json is a 404 then it would raise an exception rather than return None. So this else clause is probably dead code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did these type failures start happening as a result of your changes? Or do you get these errors even on main? If the latter, I wonder if there's something you need to do locally to get the type checker working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These happened because of my change because currently task_def could be a json or a responce if it fails

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto

except requests.HTTPError as e:
task_def = get_task_definition(task_id)
except Exception as e:
raise e
Copy link
Collaborator

Choose a reason for hiding this comment

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

Re-raising the exception without doing anything is the same as not catching it in the first place. So you might as well remove the try/except block.

continue

raise e
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

(I assume you verified this? It's important to preserve the 404 behaviour here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Backwards incompatible request that will require major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the Taskcluster Python client rather than direct http requests
2 participants