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

[BUG]: Commit not found when it exists #657

Open
1 task done
jstafford5380 opened this issue Feb 8, 2024 · 2 comments
Open
1 task done

[BUG]: Commit not found when it exists #657

jstafford5380 opened this issue Feb 8, 2024 · 2 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@jstafford5380
Copy link

jstafford5380 commented Feb 8, 2024

What happened?

When calling getCommit() with valid parameters, I'm getting a 404 error. I noticed in the log that it called the endpoint:

https://:host/api/v3/repos/:org/:repo/git/commits?sha={sha}

I was unable to find this in the REST documentation. However, in the REST documentation, the endpoint for getting a single commit is:

https://:host/api/v3/repos/:org/:repo/commits/:sha

When I call this endpoint with the same sha, I get a result.

This is against GitHub Enterprise 3.10.1. It's also worth noting that in the particular case, the sha im trying to look up is on a branch being PR'd. Not sure if that matters. Like I said, the endpoint that octokit uses vs. the documented endpoint suceeeds.

Versions

octokit-core.js/5.1.0 Node.js/20.8.1

Relevant log output

{
  status: 404,
  response: {
    url: 'https://!!redacted!!/api/v3/repos/MyOrg/my-repo/git/commits?sha=3f2eb6269eeee22fa62b0d70fd851874eb0298ae',
    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: 'Thu, 08 Feb 2024 19:12:29 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains',
      'transfer-encoding': 'chunked',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-api-version-selected': '2022-11-28',
      'x-github-enterprise-version': '3.10.1',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '61347356-e8cf-4224-ade7-efeb767f2c5b',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Not Found',
      documentation_url: 'https://docs.github.com/enterprise-server@3.10/rest'
    }
  },
  request: {
    method: 'GET',
    url: 'https://!!redacted!!/api/v3/repos/MyOrg/my-repo/git/commits?sha=3f2eb6269eeee22fa62b0d70fd851874eb0298ae',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/5.1.0 Node.js/20.8.1 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object: null prototype] {
          keepAlive: true,
          scheduling: 'lifo',
          timeout: 5000,
          noDelay: true,
          path: null
        },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {},
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: 1000,
        keepAlive: true,
        maxSockets: Infinity,
        maxFreeSockets: 256,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 0,
        maxCachedSessions: 100,
        _sessionCache: { map: {}, list: [] },
        [Symbol(kCapture)]: false
      },
      fetch: [Function: proxyFetch],
      hook: [Function: bound bound register]
    }
  }
}

Node.js v20.8.1

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jstafford5380 jstafford5380 added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Feb 8, 2024
Copy link
Contributor

github-actions bot commented Feb 8, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Feb 12, 2024
@wolfy1339
Copy link
Member

Are you using the appropriate plugin for GHES?
https://github.com/octokit/plugin-enterprise-server.js/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants