Skip to content

Provide better error message when branch protection API are disabled #273

Open
@blkt

Description

@blkt

In case a repository is configured with Branch Protection API disabled, any remediation action will fail giving an ugly error message (see "404 branch protection has been disabled" message).

      entity: repository
      entityInfo:
        provider: github-app-blkt
        repo_name: demo-repo-python
        repo_owner: blkt
        repository_id: cbad8277-cf35-431c-a92f-48be2d3e8c5a
      profileId: 4d59b709-d3d7-417c-8086-dc0b79034be4
      remediationDetails: 'error getting branch protection: error getting branch protection: GET https://api.github.com/repos/blkt/demo-repo-python/branches/main/protection: 404 Branch protection has been disabled on this reposito>
      remediationStatus: error
      ruleDescriptionName: branch_protection_allow_force_pushes
      ruleId: 6a29d6fe-73c7-4d2d-b8d1-fa0517366d65
      ruleName: branch_protection_allow_force_pushes
      ruleTypeName: branch_protection_allow_force_pushes
      status: failure

We should provide the user a better message in case the API is not enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Nice to fix: non-critical items that should be evaluated and planned during issue triagegood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions