Skip to content

batches: handle colon in search query

Warren Gifford requested to merge bo/fix-batch-change-from-search-quote into main

Created by: BolajiOlajide

Closes #38737 (closed)

When a colon is included in a search query (example: context:global fork:yes repo:^github\.com/foo/bar$ file:package.json "@types/node": "..." patternType:structural), creating a batch change from said query results in an error in the Configuration page. This happens because the YAML parser assumes the colon is signifying a node.

An easy fix for this is to leverage multi-line values in YAML so the parser understands that it's part of the current node.

I took the approach of checking if appending the search query to - repositoriesMatchingQuery results in a valid YAML, if it doesn't then I make it a multi-line YAML.

Test plan

Tested with search query containing an extra colon

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading