Skip to content

Conversation

@abhishekmadan30
Copy link
Contributor

@abhishekmadan30 abhishekmadan30 commented Oct 7, 2025

I thought adding a block_proxy flag to get_root_url, would be the best option for get_rool_url so we could avoid having to duplicate the code from get_root_url if use_proxy is not used in get_artifact_url without it accidently picking up the proxy url even if that is set to false

@abhishekmadan30 abhishekmadan30 requested a review from a team as a code owner October 7, 2025 21:43
@abhishekmadan30 abhishekmadan30 requested a review from ahal October 7, 2025 21:43
def get_artifact_url(task_id, path):
artifact_tmpl = liburls.api(get_root_url(), "queue", "v1", "task/{}/artifacts/{}")
def get_artifact_url(task_id, path, use_proxy=False):
if use_proxy:
Copy link
Contributor

@hneiva hneiva Oct 7, 2025

Choose a reason for hiding this comment

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

I wonder if we should bypass this flag if TASKCLUSTER_PROXY_URL is not in os.environ.
aka make it if use_proxy and "TASKCLUSTER_PROXY_URL" in os.environ:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be better to raise the error as instead if they are expecting a proxy to be use but the environment variable isn't set I think we should throw an error

@abhishekmadan30 abhishekmadan30 force-pushed the artifact-url branch 2 times, most recently from a4f4124 to f129b62 Compare October 8, 2025 14:35
else:
artifact_tmpl = liburls.api(
get_root_url(block_proxy=True), "queue", "v1", "task/{}/artifacts/{}"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can move the liburls.api() call out of this if statement, then only set the url here to de-dupe a bit.

@abhishekmadan30 abhishekmadan30 merged commit a7262b7 into taskcluster:main Oct 8, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants