View Your Project's Artifacts
important
Projects are assigned artifacts in two ways:
- You can manually add an artifact to a project by adding it to the project's
.yaml
file in oss-directory. - OSO discovers downstream artifacts linked to projects. For instance, if a project owns a GitHub organization, OSO will discover all the GitHub repositories owned by that organization and link them as project artifacts.
Lookup All Artifacts for a Project
You can look up your project's artifacts from pyoso or using our GraphQL API.
It's always safer to query on the project_id
field rather than the name
or display_name
fields.
- Python
- GraphQL
query = """
SELECT
artifact_id,
artifact_name,
artifact_namespace
FROM artifacts_by_project_v1
WHERE project_name = 'opensource-observer'
"""
df = client.to_pandas(query)
query findProject {
oso_artifactsByProjectV1(
where: { projectName: { _eq: "opensource-observer" } }
) {
artifactId
artifactName
artifactNamespace
}
}
Lookup a Specific Artifact
You can lookup a specific artifact by its artifact_name
and/or artifact_namespace
using either SQL or our API:
- Python
- GraphQL
query = """
SELECT
artifact_id,
artifact_name,
artifact_namespace
FROM artifacts_by_project_v1
WHERE artifact_name = 'oso' AND artifact_namespace = 'opensource-observer'
"""
df = client.to_pandas(query)
query findArtifact {
oso_artifactsByProjectV1(
where: { artifactName: { _eq: "oso" }, artifactNamespace: { _eq: "opensource-observer" } }
) {
artifactId
artifactName
artifactNamespace
}
}
Lookup Artifacts by Data Source
You can lookup artifacts by their data source using either SQL or our API:
- Python
- GraphQL
query = """
SELECT
artifact_id,
artifact_name,
artifact_namespace
FROM artifacts_by_project_v1
WHERE artifact_source = 'GITHUB'
"""
df = client.to_pandas(query)
query findArtifactsBySource {
oso_artifactsByProjectV1(
where: { artifactSource: { _eq: "GITHUB" } }
) {
artifactId
artifactName
artifactNamespace
}
}