Skip to content

Add explicit timeout to Cloudsmith API requests#32

Draft
Copilot wants to merge 37 commits intomainfrom
copilot/sub-pr-15-8144aa03-7724-45dc-882a-1dcc8dd1ada3
Draft

Add explicit timeout to Cloudsmith API requests#32
Copilot wants to merge 37 commits intomainfrom
copilot/sub-pr-15-8144aa03-7724-45dc-882a-1dcc8dd1ada3

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

requests.get and requests.put in update_policy.py had no timeout, risking the workflow hanging indefinitely on slow or unresponsive API calls.

Changes

  • exemptions/update_policy.py
    • Added REQUEST_TIMEOUT = 30 constant
    • Applied timeout=REQUEST_TIMEOUT to both fetch_policy (GET) and update_policy (PUT)
REQUEST_TIMEOUT = 30

def fetch_policy():
    r = requests.get(POLICY_URL, headers=HEADERS, timeout=REQUEST_TIMEOUT)
    ...

def update_policy(policy, rego):
    ...
    r = requests.put(POLICY_URL, headers=HEADERS, json=payload, timeout=REQUEST_TIMEOUT)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

ciaracarey and others added 30 commits February 18, 2026 21:49
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan

* fix(readme): wrap repository structure in fenced code block

Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
* Initial plan

* Fix spelling: "Specialised" -> "Specialized" in README.md

Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
* Initial plan

* Remove import rego.v1 from advanced/huggingface-recipes policies

Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
Added section on GitOps workflow for managing policy exemptions.
chore: tidy rego based on regal output
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
markmcmurray and others added 6 commits March 11, 2026 11:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ciaracarey <84123925+ciaracarey@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback on Epm baseline refactor PR Add explicit timeout to Cloudsmith API requests Mar 11, 2026
@ciaracarey ciaracarey force-pushed the epm-baseline-refactor branch from 3185b50 to aa38feb Compare March 12, 2026 13:35
Base automatically changed from epm-baseline-refactor to main March 12, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants