Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict Scan: fails if label is already removed #17548

Closed
david-allison opened this issue Dec 4, 2024 · 0 comments · Fixed by #17558
Closed

Conflict Scan: fails if label is already removed #17548

david-allison opened this issue Dec 4, 2024 · 0 comments · Fixed by #17558
Labels
Milestone

Comments

@david-allison
Copy link
Member

david-allison commented Dec 4, 2024

Workflow file: https://github.com/ankidroid/Anki-Android/blob/main/.github/workflows/conflict.yaml

Relevant log
PR #17443 is unstable
PR #17443 is mergeable
Removing 'Has Conflicts' label from PR #17443
RequestError [HttpError]: Label does not exist
    at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:9537:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async removeLabel (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16), <anonymous>:31:5)
    at async checkPullRequests (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16), <anonymous>:88:25) {
  status: 404,
  response: {
    url: 'https://api.github.com/repos/ankidroid/Anki-Android/issues/17443/labels/Has%20Conflicts',
    status: 404,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Wed, 04 Dec 2024 15:57:22 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'github.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-accepted-github-permissions': 'issues=write; pull_requests=write',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
Error: Unhandled error: HttpError: Label does not exist
      'x-github-api-version-selected': '2022-11-28',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': 'C009:194EDA:B6F65D:16A336D:67507BE1',
      'x-ratelimit-limit': '5000',
      'x-ratelimit-remaining': '4862',
      'x-ratelimit-reset': '[173](https://github.com/ankidroid/Anki-Android/actions/runs/12163504786/job/33922865806?pr=17443#step:2:174)3330283',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '138',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Label does not exist',
      documentation_url: 'https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue',
      status: '404'
    }
  },
  request: {
    method: 'DELETE',
    url: 'https://api.github.com/repos/ankidroid/Anki-Android/issues/[174](https://github.com/ankidroid/Anki-Android/actions/runs/12163504786/job/33922865806?pr=17443#step:2:175)43/labels/Has%20Conflicts',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'actions/github-script octokit-core.js/5.0.1 Node.js/20.18.0 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: [Agent],
      fetch: [Function: proxyFetch],
      hook: [Function: bound bound register]
    }
  }
}

https://github.com/ankidroid/Anki-Android/actions/runs/12163504786/job/33922865806?pr=17443


Endpoint docs: https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#remove-a-label-from-an-issue

This endpoint returns a 404 Not Found status if the label does not exist.

Note: "does not exist" could mean to me that the label does not exist on the PR (expected), or the label does not exist at all (catastrophic error)

I suspect it's the former, and we should handle this by ignoring the error and continuing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant