chore(scm): fill in get_file and check_file for Bitbucket and Azure DevOps
Current state of the SCM APIs implemented related to RepositoryMixin:
| check_file | get_file | |
|---|---|---|
| GitHub | Y | Y |
| GitHub Enterprise | Y | Y |
| Gitlab | Y | Y |
| Bitbucket | Y | N |
| Bitbucket Server | N | N |
| Azure DevOps (VSTS) | Y | N |
To make the abstraction easier we can fill the rest of these in. Besides Bitbucket Server, the check_file function is already implemented. The difference between check_file and get_file is that we just fully read the file (self.get with raw_response=True), possibly with a slightly different URL, see example implementation in Gitlab:
https://github.com/getsentry/sentry/blob/a0eca661fa254cb6af507d65bee97b1c999dd345/src/sentry/integrations/gitlab/client.py#L310-L327 https://github.com/getsentry/sentry/blob/a0eca661fa254cb6af507d65bee97b1c999dd345/src/sentry/integrations/gitlab/client.py#L329-L344
Notes
- For Bitbucket, the
check_fileURL already returns the raw file (docs) - For Bitbucket Server, I referenced this to get the file: -- it seems that you need to add an extra
?rawparameter to fetch the raw file (and another reference to the?rawpart here - For AzureDevOps, it also looks like the original
check_fileURL works forget_file. You can add an extra param to download the file but we don't need that (docs)
This PR is useful for https://github.com/getsentry/sentry/pull/74908