Skip to content

Commit 9361b7c

Browse files
committed
ci: scan each published package as its own FOSSA project
Switch the FOSSA workflow from a single gooddata-python-sdk project (with all 8 packages' deps merged) to one FOSSA project per PyPI artifact: gooddata-sdk, gooddata-pandas, gooddata-dbt, gooddata-fdw, gooddata-flight-server, gooddata-flexconnect, gooddata-pipelines, and gooddata-api-client. This aligns FOSSA's data model with how the artifacts are actually shipped: each PyPI package has its own license inventory, attribution report, and policy gate, and the FOSSA "branch" axis is freed up for its intended purpose (tracking license drift across git branches over time). The legacy gooddata-python-sdk project keeps the historical fossa_gd_* branch snapshots; new scans no longer write to it. Local `fossa analyze` invocations still target the legacy project via the committed .fossa.yml so ad-hoc runs cannot accidentally pollute the per-package projects. Implementation is a matrix workflow: each shard rewrites .fossa.yml with its project id + paths.only, then runs fossa-action's analyze and test steps. fail-fast is disabled so one package's policy failure does not mask the others. The branch label defaults to github.ref_name (the dispatched git ref) with an optional manual override input. Prerequisites for the first dispatch to fully succeed: - The seven new FOSSA project ids must be auto-creatable (or pre- provisioned) by an admin if the org restricts project creation. - Confirm with whoever owns the FOSSA contract that moving from 1 to 8 projects has no licensing/billing impact under the current plan. JIRA: TRIVIAL risk: nonprod
1 parent 1c4dfe4 commit 9361b7c

2 files changed

Lines changed: 40 additions & 21 deletions

File tree

.fossa.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
# (C) 2023 GoodData Corporation
22
version: 3
33

4+
# The canonical FOSSA configuration lives in .github/workflows/fossa.yaml,
5+
# which generates a per-package .fossa.yml on each scan and uploads to one
6+
# FOSSA project per published artifact (gooddata-sdk, gooddata-pandas, ...).
7+
#
8+
# This anchor file exists so that running `fossa analyze` locally without
9+
# arguments has a sane default. It points at the legacy roll-up project
10+
# (gooddata-python-sdk) on purpose — local ad-hoc runs go to the legacy
11+
# project so they cannot accidentally pollute the per-package projects.
412
project:
513
id: gooddata-python-sdk
614

715
telemetry:
816
scope: 'off'
9-
10-
# Scope the scan to the published gooddata-* workspace packages + the
11-
# generated gooddata-api-client. Each pyproject.toml is scanned independently
12-
# (FOSSA's pdm strategy reports declared deps); the gooddata-api-client setup.py
13-
# is read by setuptools. Internal helpers (tests-support, scripts) are excluded.
14-
paths:
15-
only:
16-
- packages/gooddata-sdk
17-
- packages/gooddata-pandas
18-
- packages/gooddata-dbt
19-
- packages/gooddata-fdw
20-
- packages/gooddata-flight-server
21-
- packages/gooddata-flexconnect
22-
- packages/gooddata-pipelines
23-
- gooddata-api-client

.github/workflows/fossa.yaml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,57 @@ on:
55
workflow_dispatch:
66
inputs:
77
branch:
8-
description: Branch label to attach to the FOSSA scan.
8+
description: Override the FOSSA branch label (defaults to the dispatched git ref).
99
required: false
10-
default: master
10+
default: ""
1111

1212
concurrency:
1313
group: fossa-${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
# Each PyPI artifact is scanned as its own FOSSA project so license inventory,
17+
# policy gates, and attribution reports match what is actually shipped. The
18+
# FOSSA "branch" axis is left to its intended purpose (track license drift
19+
# across git branches over time).
1620
jobs:
1721
fossa:
18-
name: FOSSA scan
22+
name: FOSSA ${{ matrix.package.project }}
1923
runs-on:
2024
group: infra1-runners-arc
2125
labels: runners-small
2226
permissions:
2327
contents: read
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
package:
32+
- { path: packages/gooddata-sdk, project: gooddata-sdk }
33+
- { path: packages/gooddata-pandas, project: gooddata-pandas }
34+
- { path: packages/gooddata-dbt, project: gooddata-dbt }
35+
- { path: packages/gooddata-fdw, project: gooddata-fdw }
36+
- { path: packages/gooddata-flight-server, project: gooddata-flight-server }
37+
- { path: packages/gooddata-flexconnect, project: gooddata-flexconnect }
38+
- { path: packages/gooddata-pipelines, project: gooddata-pipelines }
39+
- { path: gooddata-api-client, project: gooddata-api-client }
2440
steps:
2541
- name: Checkout the code
2642
uses: actions/checkout@v6
2743
with:
2844
fetch-depth: 0
2945

30-
- name: Check that .fossa.yml exists
46+
- name: Scope .fossa.yml to ${{ matrix.package.project }}
3147
shell: bash
3248
run: |
33-
[ -f ./.fossa.yml ] || { echo "Missing .fossa.yml in repo root; FOSSA needs it for project id." >&2; exit 1; }
49+
cat > .fossa.yml <<EOF
50+
version: 3
51+
project:
52+
id: ${{ matrix.package.project }}
53+
telemetry:
54+
scope: 'off'
55+
paths:
56+
only:
57+
- ${{ matrix.package.path }}
58+
EOF
3459
3560
- name: Workaround for "no targets found" error
3661
shell: bash
@@ -41,10 +66,11 @@ jobs:
4166
uses: fossas/fossa-action@v1.9.0
4267
with:
4368
api-key: ${{ secrets.FOSSA_API_KEY }}
44-
branch: ${{ inputs.branch }}
69+
branch: ${{ inputs.branch != '' && inputs.branch || github.ref_name }}
4570

4671
- name: Run FOSSA test (policy gate)
4772
uses: fossas/fossa-action@v1.9.0
4873
with:
4974
api-key: ${{ secrets.FOSSA_API_KEY }}
5075
run-tests: true
76+
branch: ${{ inputs.branch != '' && inputs.branch || github.ref_name }}

0 commit comments

Comments
 (0)