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

build: Add LifecycleScopedRelationship constraints #517

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions model/Build/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,38 @@ SPDX-License-Identifier: Community-Spec-1.0

## Summary

Everything having to do with the build profile.
The Build Profile defines the set of information required to describe an instance of a Software Build.

## Description

The Build namespace defines concepts related to building of artifacts.
A Software Build is defined here as the act of converting software inputs into software artifacts using software build tools. Inputs can include source code, config files, artifacts that are build environments, and build tools. Outputs can include intermediate artifacts to other build inputs or the final artifacts.

The Build profile provides a subclass of Element called Build. It also provides a minimum set of required Relationship Types from the Core profile:

- hasInputs: Describes the relationship from the Build element to its inputs.
- hasOutputs: Describes the relationship from the Build element to its outputs.
- invokedBy: Describes the relationship from the Build element to the Agent that invoked it.

In addition, the following Relationship Types may be used to describe a Build.

- hasHost: Describes the relationship from the Build element to the build stage or host.
- configures: Describes the relationship from a configuration to the Build element.
- ancestorOf: Describes a relationship from a Build element to Build eelements that describe its child builds.
- decendentOf: Describes a relationship from a child Build element to its parent.
- usesTool: Describes a relationship from a Build element to a build tool.

All relationships in the Build Profile are scoped to the "build" LifecycleScopeType period.

The `hasInputs` relationship can be applied to a config file or a build tool if the nature of these inputs are not known at the creation of an SPDX document.

## Metadata

- id: https://rdf.spdx.org/v3/Build
- name: Build


## Profile Conformance

Conformance to the Build profile requires one or more instances of the Build class. In addition, there must be at least three instances `Relationship`s with type `LifecycleScopedRelationship`, where the "scope" property must be "build" and the "from" property must be the Build instance.

At the minimum, the build profile must contain a `hasInputs`, `hasOutputs`, and `invokedBy` relationshipType. If an input is known to be a build configuration or a build tool, the `hasInputs` relationshipType can be replaced by a `configures` or `usesTool` relationshipType.
5 changes: 2 additions & 3 deletions model/Build/Classes/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ Class that describes a build instance of software/artifacts.
A build is a representation of the process in which a piece of software or artifact is built. It encapsulates information related to a build process and
provides an element from which relationships can be created to describe the build's inputs, outputs, and related entities (e.g. builders, identities, etc.).

Definitions of "BuildType", "ConfigSource", "Parameters" and "Environment" follow
those defined in [SLSA provenance](https://slsa.dev/provenance/v0.2).
Definitions of "buildType", "configSourceEntrypoint", "configSourceUri", "parameters" and "environment" follow those defined in [SLSA provenance](https://slsa.dev/provenance/v0.2).

ExternalIdentifier of type "urlScheme" may be used to identify build logs. In this case, the comment of the ExternalIdentifier should be "LogReference".

Note that buildStart and buildEnd are optional, and may be omitted to simplify creating reproducible builds.
Note that buildStartTime and buildEndTime are optional, and may be omitted to simplify creating reproducible builds.

## Metadata

Expand Down