Skip to content

Add timeouts and status handling to GitHub workflow cancellation script #2

@outwrit

Description

@outwrit

Problem

scripts/cancel_github_workflows.py uses requests.request(...) without a timeout and assumes every response body can be parsed as JSON. In CI or local maintenance workflows this can hang indefinitely or hide HTTP status failures behind confusing JSON errors.

Proposed remediation

Make the GitHub API helper fail fast and report clearer errors.

Acceptance criteria

  • Add a sensible request timeout for every GitHub API call.
  • Call raise_for_status() or otherwise surface non-2xx responses before consuming the response body.
  • Preserve the existing Click CLI behavior and error style.
  • Add focused unit tests around the request() helper if practical.

Suggested validation

  • python -m py_compile scripts/cancel_github_workflows.py
  • Focused tests for successful JSON, API error message, non-JSON/HTTP error, and timeout behavior if a lightweight test location exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    automation-candidateCandidate for autonomous maintenance automationdevin-remediateQueue for Devin remediation automationdevin-status/pr-openedManaged by Devin remediation automationsecurity-hardeningSecurity hardening remediation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions