Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

fix Bitbucket Cloud exclude regex to make it work with AJV.#54494

Merged
mrnugget merged 3 commits into
mainfrom
ao/fix-regex-unsupported-by-ajv
Jun 30, 2023
Merged

fix Bitbucket Cloud exclude regex to make it work with AJV.#54494
mrnugget merged 3 commits into
mainfrom
ao/fix-regex-unsupported-by-ajv

Conversation

@sashaostrikov

@sashaostrikov sashaostrikov commented Jun 30, 2023

Copy link
Copy Markdown
Contributor

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.

AJV JSON schema validator treated escaped `-` sign as invalid, removing the escaping from it, fixed the problem. The problem was surfaced in an ugly way as an uncaught error which prevented 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.

Test plan:
Local sg run and verifying that Bitbucket Cloud code hosts can be created and updated using UUID excludes, changes are stored into the DB and UI validation with AJV works.
@sashaostrikov sashaostrikov requested review from a team and mrnugget June 30, 2023 14:57
@sashaostrikov sashaostrikov self-assigned this Jun 30, 2023
@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2023
@mrnugget mrnugget requested a review from a team June 30, 2023 15:05
@sourcegraph-bot

sourcegraph-bot commented Jun 30, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff f457244...8bc7e77.

Notify File(s)
@eseliger internal/database/external_services_test.go

Comment thread CHANGELOG.md
@mrnugget mrnugget merged commit 66044a7 into main Jun 30, 2023
@mrnugget mrnugget deleted the ao/fix-regex-unsupported-by-ajv branch June 30, 2023 15:58
github-actions Bot pushed a commit that referenced this pull request Jun 30, 2023
### 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)
BolajiOlajide pushed a commit that referenced this pull request Jul 3, 2023
… AJV. (#54496)

### 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.
 <br> Backport 66044a7 from #54494

Co-authored-by: Alex Ostrikov <alex.ostrikov@sourcegraph.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants