Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill missing JSON reporter fields #543

Open
marcomicera opened this issue Feb 2, 2021 · 1 comment
Open

Fill missing JSON reporter fields #543

marcomicera opened this issue Feb 2, 2021 · 1 comment

Comments

@marcomicera
Copy link
Member

The result's schema is the following.
Missing fields:

  • package_metadata
  • input.forge
@marcomicera marcomicera transferred this issue from another repository Feb 2, 2021
@marcomicera
Copy link
Member Author

Package metadata

{
    "payload": {
        "package_metadata": [
            {
                "licenses": ["BSD-3-Clause", "Apache 2.0"],
                "authors": ["Frances Allen", "Grace Hopper"],
            },
            ...
        ]
    }
}

This could be achieved either with a separate query:

query PackagesAndFilesMetadata($itype: string, $dtype: string) {
	
	PackageNodes(func: has(packageNodeType)) @cascade {
		
		# Package info
		name
		version
		
		# Package metadata
		additionalInfo @filter(eq(type, $itype))(orderdesc: confidenceScore, first: 1) { # InfoNodes
			type
			dataNodes @filter(eq(type, $dtype)) { # DataNodes
				data
			}
		}
	}
}

Or by extending the current one:

query PackagesAndFilesMetadata($itype: string, $dtype: string) {
	
	PackageNodes(func: has(packageNodeType)) @cascade {
		
		# Package info
		name
		version

		# Package files
		targets { # FileNodes

			# File info
			path

			# File metadata
			fileData { # FileDataNodes
				hash
				additionalInfo @filter(eq(type, $itype))(orderdesc: confidenceScore, first: 1) { # InfoNodes
					type
					dataNodes @filter(eq(type, $dtype)) { # DataNodes
						data
					}
				}
			}
		}
		
		# Package metadata
		additionalInfo @filter(eq(type, $itype))(orderdesc: confidenceScore, first: 1) { # InfoNodes
			type
			dataNodes @filter(eq(type, $dtype)) { # DataNodes
				data
			}
		}
	}
}

With $itype = "license" and $dtype = "name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant