This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.1] fix Bitbucket Cloud exclude regex to make it work with AJV.#54496
Merged
Conversation
### The problem The regular expression used in matching the exclusion by UUID in Bitbucket.org (Cloud) code host connection was unsupported by [AJV](https://ajv.js.org/), which was added for validation purposes in https://github.com/sourcegraph/sourcegraph/pull/52012. The problem surfaced in an ugly way as an uncaught error that prevented the loading of create/edit code host UI for Bitbucket Cloud, which schema contained the invalid regex. The issue was reported in Slack: https://sourcegraph.slack.com/archives/C05EMJM2SLR/p1688132947851839. ### Customer impact Customers using Bitbucket.org (Cloud) are unable to create new or edit existing code host connections. ### What is changed AJV JSON schema validator treated the escaped `-` sign as invalid. Removing the escaping from it fixed the problem. Test plan: Local sg run and verify that Bitbucket Cloud code hosts can be created and updated using UUID excludes, changes are stored in the DB, and UI validation with AJV works. --------- Co-authored-by: Thorsten Ball <mrnugget@gmail.com> (cherry picked from commit 66044a7)
sashaostrikov
approved these changes
Jun 30, 2023
Contributor
Contributor
|
@sashaostrikov can you make sure the build works? |
Contributor
|
Hmm, I must have wrongly remembered that it passed, taking a look now |
Contributor
|
It passed in the original PR, but in this one -- the backport PR -- there seem to be problems with the formatting. |
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 4a6fa5d...885ac80.
|
BolajiOlajide
approved these changes
Jul 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
The regular expression used in matching the exclusion by UUID in Bitbucket.org (Cloud) code host connection was unsupported by AJV, which was added for validation purposes in https://github.com/sourcegraph/sourcegraph/pull/52012.
The problem surfaced in an ugly way as an uncaught error that prevented the loading of create/edit code host UI for Bitbucket Cloud, which schema contained the invalid regex.
The issue was reported in Slack: https://sourcegraph.slack.com/archives/C05EMJM2SLR/p1688132947851839.
Customer impact
Customers using Bitbucket.org (Cloud) are unable to create new or edit existing code host connections.
What is changed
AJV JSON schema validator treated the escaped
-sign as invalid. Removing the escaping from it fixed the problem.Test plan:
Local sg run and verify that Bitbucket Cloud code hosts can be created and updated using UUID excludes, changes are stored in the DB, and UI validation with AJV works.
Backport 66044a7 from #54494