Component Governance
Each service fork registers what its image ships with Component Governance (CG) and keeps its NOTICE generated from that registration. The pipeline is .azuredevops/component-governance.yml, synced from the template, and it runs in Azure DevOps. This runbook connects a fork, runs it the first time, and makes NOTICE fork-owned. ADR-047 records the decision, and the README in .github/actions/component-governance/ describes each step.
Before you start
- The fork has synced a template that contains
.azuredevops/component-governance.yml. That sync also brings the acceptance resolver that accepts thecomponentGovernancesection: add the section only after it, or the fork's descriptor check fails. - Access to the OpenEnergyPlatform
OSDU-SPIAzure DevOps project with permission to create pipelines, and use of thegithub.com_Azureservice connection (the Azure Pipelines GitHub App). - The fork's latest push to
mainpublished its image: Validation's Docker Push job succeeded.
1. Declare the fork's inputs
Add the section to .spi/service.yaml in a pull request to the fork:
upstream is the OSDU community project, as in NOTICE-OSDU-SPI, without .git. Add the optional keys only where the defaults are wrong:
| Key | Default | Set it when |
|---|---|---|
image | The repository name | The fork's SERVICE_NAME variable makes Validation publish its image under another name. Azure DevOps cannot read GitHub variables, so the descriptor repeats it |
module | The Spring Boot module under provider/*-azure | The fork ships a module elsewhere, or has several under provider/*-azure. Indexer Queue sets indexer-queue-azure-enqueue |
profiles | [core, azure] | The module builds with other profiles. Indexer Queue sets [azure] |
ignoreDirectories | none | Directories that hold dependency files no image ships, such as Python acceptance suites (crs-catalog_acceptance_test, testing) or upstream's data/ images |
The descriptor check runs on the pull request: an unknown key, a URL outside community.opengroup.org/osdu, or an ignored directory that contains the module fails it.
2. Create the pipeline
In OSDU-SPI, Pipelines > New pipeline > GitHub > the fork (Azure/osdu-spi-<service>, through the github.com_Azure connection) > Existing Azure Pipelines YAML file > branch main, path /.azuredevops/component-governance.yml. Save it without running and name it <Service> CG.
The first run asks for permission to use the adme-custom-pool-eus2 pool, the github.com_Azure connection and the 1ESPipelineTemplates repository. A project administrator grants them to this pipeline only.
3. Run it on main
Queue the pipeline on main with Open a NOTICE pull request into the built branch checked and images left at auto. Without this, the first Monday run does the same; from then on the weekly run keeps the NOTICE pull request current.
Expected result: both jobs succeed. The Register shipped components job logs the resolved inputs and Docker Push succeeded for <sha>. CG lists the fork as a governed repository, with the shipped module's Maven components, the image's operating system packages, the upstream commit and the Application Insights agent. The Generate NOTICE job publishes the cg-notice artifact, adds the gap report to the run summary, and opens a draft pull request from chore/notice-refresh/main.
4. Merge the first NOTICE pull request
The first refresh also changes NOTICE: keep to NOTICE: strip in .github/upstream-filter.yml, so upstream syncs stop replacing the generated file.
- Read the gap report in the pull request body. It lists the shipped components the generated NOTICE has no entry for.
NOTICEis upstream-owned until this merges, so the ownership check fails. Add theportlabel and re-run Check Paths.- Mark the pull request ready, get it reviewed and merge it. Validation publishes the image that ships the new
NOTICE. -
The next upstream sync removes upstream's
NOTICEfromfork_upstream, and the cascade stops on one modify/delete conflict onNOTICEinfork_integrationand opens a conflict issue. The cascade pushes nothing when it stops, so the remotefork_integrationstill lacks the generated file: mergemainfirst, thenfork_upstream, and keep the fork's file:git fetch origin git checkout -B fork_integration origin/fork_integration git merge --no-edit origin/main git merge origin/fork_upstream # stops: NOTICE deleted upstream, modified here git add NOTICE && git commit --no-edit git push origin fork_integrationMerging
fork_upstreamwithoutmainfirst deletesNOTICEwithout a conflict. Later syncs never touchNOTICEagain.
Routine operation
The pipeline registers main every Monday at 06:00 UTC and every v* release tag. Compliance is read from main. The Monday run also refreshes NOTICE: it opens or updates the draft pull request from chore/notice-refresh/main when the generated NOTICE differs from main's, and leaves it alone when the branch already holds the same NOTICE for the same commit. Review and merge it like any other pull request. A pull request that changes only NOTICE skips the build, deploy and CodeQL analysis; the push to main that merges it builds the image that ships the new file. A pull request someone closed is not reopened for the same main commit. To refresh sooner, queue a run on main with the pull request option; a refresh only replaces an older one, and nothing is opened when NOTICE already matches. Don't queue a run while another run of the same branch is in progress.
Failures
| Message | Cause | What to do |
|---|---|---|
No push-triggered Docker Push run exists for <sha> | Validation published no image for the commit | Rerun Validation on main, or queue with the image listed explicitly |
has pull requests from main | The gate cannot tell a push run from a pull request run without Actions access | Queue with the image listed explicitly |
Docker Push for <sha> ended without success | The image was not published | Fix the build, then rerun |
<image> could not be scanned | The scan could not pull an image after the gate passed | Rerun; the snapshot is replaced by the next complete scan |
Snapshot type ... now belongs to build | Two runs of the same branch overlapped | Rerun when no other run is in progress |
has commits from someone else or has no Source-Commit/Build-Id trailers | The refresh branch was edited by hand | Merge or close its pull request, delete the branch, rerun |
componentGovernance... from the descriptor check | The section does not match the contract | Fix .spi/service.yaml as the message says |