Fix CodeQL threadflow steps (#15873)

* Upload SARIF artifact

* Test removal of empty object

* Fix polynomial-redos

* Revert fail-fast change

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
ian
2022-10-13 03:01:13 +07:00
committed by GitHub
parent 5fcb3c84c7
commit 6cdd0eead4
4 changed files with 24 additions and 6 deletions

View File

@@ -110,7 +110,7 @@ export default async function getASTFromQuery(
const children: (NestedCollectionNode | FieldNode | FunctionFieldNode)[] = [];
const relationalStructure: Record<string, string[] | anyNested> = {};
const relationalStructure: Record<string, string[] | anyNested> = Object.create(null);
for (const fieldKey of fields) {
let name = fieldKey;

View File

@@ -6,12 +6,19 @@ type RelationInfo = {
relationType: string | null;
};
function checkImplicitRelation(field: string) {
if (field.startsWith('$FOLLOW(') && field.endsWith(')')) {
return field.slice(8, -1).split(',');
}
return null;
}
export function getRelationInfo(relations: Relation[], collection: string, field: string): RelationInfo {
if (field.startsWith('$FOLLOW') && field.length > 500) {
throw new Error(`Implicit $FOLLOW statement is too big to parse. Got: "${field.substring(500)}..."`);
}
const implicitRelation = field.match(/^\$FOLLOW\((.*?),(.*?)(?:,(.*?))?\)$/)?.slice(1);
const implicitRelation = checkImplicitRelation(field);
if (implicitRelation) {
if (implicitRelation[2] === undefined) {