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

Improve handling of missing files for BB and BBS #20267

Draft
wants to merge 2 commits into
base: ft/use-correct-name-with-bbs
Choose a base branch
from

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Oct 3, 2024

Description

Merging blocked by #20264, that's why this is a draft

For GitLab, GitHub and Azure DevOps we have a unified error message for a missing file. This PR brings that to Bitbucket and Bitbucket Server.

Fixes ENT-851

How to test

Try opening these two links:

image

@filiptronicek
Copy link
Member Author

Bitbucket Server seems to be working as expected as well
image

@filiptronicek
Copy link
Member Author

Test results:

gitpod /workspace/gitpod/components/server (ft/bitbucket-files-not-found) $ yarn build && yarn mocha './**/bitbucket*-file-provider.spec.js' --exclude './node_modules/**' --exit 
yarn run v1.22.22
$ yarn generate && npx tsc
$ leeway run components/spicedb:generate-ts > src/authorization/definitions.ts && npx prettier --write src/authorization/definitions.ts
src/authorization/definitions.ts 174ms
Done in 7.96s.
yarn run v1.22.22
$ /workspace/gitpod/node_modules/.bin/mocha './**/bitbucket*-file-provider.spec.js' --exclude './node_modules/**' --exit


  TestBitbucketServerFileProvider
BBS GET https://bitbucket.gitpod-dev.com/rest/api/1.0/users/filip/repos/spring-petclinic/raw/.gitpod.yml?at=main - OK
    ✔ test_getGitpodFileContent_ok (90ms)
BBS: GET https://bitbucket.gitpod-dev.com/rest/api/1.0/users/filip/repos/spring-petclinic/commits?limit=1&path=.gitpod.yml&until=ft/invalid-docker - OK
    ✔ test_getLastChangeRevision_ok (78ms)
BBS: GET https://bitbucket.gitpod-dev.com/rest/api/1.0/users/filip/repos/spring-petclinic/commits?limit=1&path=gitpod.Dockerfile&until=ft/invalid-docker - OK
    ✔ test_getLastChangeRevision_not_found (68ms)

  TestBitbucketFileProvider
    ✔ testGetFileContents (273ms)
    ✔ testGetLastChangeRevision_ok (301ms)
    ✔ testGetLastChangeRevision_not_found (270ms)


  6 passing (1s)

Done in 1.88s.

@roboquat roboquat added size/L and removed size/M labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants