-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BitbucketLastCommit] Add Bitbucket last commit #10043
Conversation
|
It would be possible split this current implementation into separate branch and non-branch variations (like the GitHub and Gitea last commit API), but as far as I can see this would require an preliminary request to
{
"mainbranch": {
"name": "main",
"type": "branch"
}
} Happy to implement, but let me know what you think. |
🚀 Updated review app: https://pr-10043-badges-shields.fly.dev |
Given BitBucket doesn't give us a way to get the default branch without making an extra request, I think it is fine to just say branch is a required param. That is what we have done for the BitBucket Pipelines badge. |
}).required() | ||
|
||
const queryParamSchema = Joi.object({ | ||
path: Joi.string().uri({ relativeOnly: true }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once we merge the other related PR, this could become relativeUri
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | ||
}, | ||
schema, | ||
httpErrors: { 403: 'private repo' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we give a custom 404 error here as well to explain what wasn't found in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const data = await this.fetch({ user, repo, branch, path }) | ||
const [commit] = data.values | ||
|
||
if (!commit) throw new NotFound() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..and then also here. Probably 'no commits found'
for this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: chris48s <chris48s@users.noreply.github.com>
77db9ea
to
e289228
Compare
🚀 Updated review app: https://pr-10043-badges-shields.fly.dev |
nice - thanks 👍 |
Add support for Bitbucket last commit: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commits-revision-get