Fixed a bug where the repo:has.description() parameter shows repo name instead of description on Bitbucket server repos#46752
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 88234f3...e7b72d1.
|
indradhanush
left a comment
There was a problem hiding this comment.
Great PR @mibali and thank you so much for the fix! ❤️
The changes look good to me however the tests are failing and would need to be updated. For API tests we use real API response data but save it and reuse it for subsequent test runs. In this case since we're adding a new field that we expect from the API, we should update the tests by adding the -update flag to the test command. In this case I can see two relevant tests that need to be updated:
TestClient_LabeledReposTestClient_ProjectRepos
To update them you will need access to an API token for our test instance which you can find in 1pass. You may run the tests like:
cd internal/extsvc/bitbucketserver
BITBUCKET_SERVER_TOKEN=<insert-token-here> go test -v -run TestClient_LabeledRepods -updateRepeat this for all the other test that need to be updated.
Additionally I would also recommend to add a description to one of the repos in the instance which get fetched from our tests and see if that is reflecting in the newly generated testdata. This should help with validating in our tests that the new changes work.
sashaostrikov
left a comment
There was a problem hiding this comment.
Thanks for the fix!
Agree on what Indra wrote, after fixing the test it is good to merge.
| status: 200 OK | ||
| code: 200 | ||
| - '@TCJ96Jx619x10993429x1' | ||
| status: 401 Unauthorized |
There was a problem hiding this comment.
This doesn't look right to me. These are the files that I updated. Let me take a look.
There was a problem hiding this comment.
Okay I fixed the token in the test run and I'm seeing the same timeout error as you. I'll investigate this.
There was a problem hiding this comment.
Interestingly Buildkite is all green on my end
There was a problem hiding this comment.
Yep it is, but the generated file is not correct. Take a look at the status: 401 Unauthorized. This was likely me having a typo in the token. I've fixed it with the correct token and I am now seeing the timeout locally.
fixes #46713
Previously, we set the description to be the repo name (See here). This made the
repo:has.descriptionparameter shows repo name instead of the description on Bitbucket server repos.In this PR, I added a
Descriptiontype for the Repo struct and then modified theDescriptionin theBitbucketServerSourcefunction to point to the description. This would make therepo:has.descriptionparameter to now show the actual description instead of the repo name.Test plan
Tested locally.