Skip to content

Improve handling of missing files for BB and BBS #20267

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

Merged
merged 6 commits into from
Oct 7, 2024

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
Base automatically changed from ft/use-correct-name-with-bbs to main October 7, 2024 12:27
@filiptronicek filiptronicek marked this pull request as ready for review October 7, 2024 12:27
@filiptronicek filiptronicek requested review from a team as code owners October 7, 2024 12:27
@filiptronicek
Copy link
Member Author

filiptronicek commented Oct 7, 2024

Spinning up a workspace to resolve the conflicts and clean up and also re-trigger the preview env

It's now up: https://ft-bitbuck372abf7f33.preview.gitpod-dev.com/workspaces

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM tested and works ✔️ 🎉

@roboquat roboquat merged commit 2a5da84 into main Oct 7, 2024
18 checks passed
@roboquat roboquat deleted the ft/bitbucket-files-not-found branch October 7, 2024 12:51
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.

3 participants