Skip to content

Commit 494e279

Browse files
authored
Support labels in fossa-deps files (#1505)
1 parent c63817d commit 494e279

File tree

16 files changed

+812
-325
lines changed

16 files changed

+812
-325
lines changed

Changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# FOSSA CLI Changelog
22

3+
## 3.10.0
4+
- Support for user-provided dependency labels in `fossa-deps` ([#1505](https://github.com/fossas/fossa-cli/pull/1505)).
5+
For details, see the [`fossa-deps` documentation](https://github.com/fossas/fossa-cli/blob/master/docs/references/files/fossa-deps.md).
36

47
## 3.9.48
58
- General: Fix a bug where directory traversal could fail if the user does not have permission to read a directory ([#1508](https://github.com/fossas/fossa-cli/pull/1508)).

docs/references/files/fossa-deps.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Denotes listing of dependencies, which are to be analyzed in conjunction with th
1515
- `type`: Type of dependency. (Required)
1616
- `name`: Name of the dependency. It should be the same name as listed in dependencies registry. (Required)
1717
- `version`: Revision of the dependency. If left unspecified, the latest version discovered from the registry will be used.
18-
18+
- `labels`: An optional list of labels to be added to the dependency.
1919
```yaml
2020
referenced-dependencies:
2121
- type: gem
@@ -91,6 +91,57 @@ vendored-dependencies:
9191

9292
For more details, please refer to the [feature](../../features/vendored-dependencies.md) walk through.
9393

94+
## Labels
95+
96+
Each kind of dependency referenced above can have a `labels` field, which is a list of labels to be added to the dependency.
97+
These labels are **user-defined**; you may choose any labels. What they mean is up to you and/or your organization.
98+
99+
Labels have a `scope` field, which is the scope of the label. The possible scopes are:
100+
- `org`: The label is scoped to the organization.
101+
- `revision`: The label is scoped to the revision.
102+
- `project`: The label is scoped to the project.
103+
104+
You may attach multiple labels to a single dependency.
105+
For example:
106+
107+
```yaml
108+
referenced-dependencies:
109+
- type: pypi
110+
name: numpy
111+
version: 2.2.0
112+
labels:
113+
- label: numbers-go-brr
114+
scope: org
115+
- label: oss-approved
116+
scope: revision
117+
118+
custom-dependencies:
119+
- name: somecorp-api-client
120+
version: 1.2.3
121+
license: Proprietary
122+
metadata:
123+
homepage: https://www.partner.somecorp.com/interface/client/wrapper/lib
124+
description: Gives access to the SomeCorp API.
125+
labels:
126+
- label: proprietary
127+
scope: version
128+
- label: license-paid-2024
129+
scope: revision
130+
131+
vendored-dependencies:
132+
- name: Django
133+
path: vendor/Django-3.4.16.zip
134+
version: 3.4.16
135+
metadata:
136+
homepage: https://djangoproject.com
137+
description: Django
138+
labels:
139+
- label: hr-docs
140+
scope: project
141+
- label: internal-dependency
142+
scope: revision
143+
```
144+
94145
## Errors in the `fossa-deps` file
95146

96147
The `fossa-deps` scanner tries to report clear error messages when fields are missing, incorrect, or invalid. For example:

0 commit comments

Comments
 (0)