Reporting an Integration Build - Per component update/delete - Java or Node.js

The following steps describe the requirements to report an integration build using the Java agent or Node.js agent per component as they are updated or deleted

Report a session ID

Each integration build gets reported as a new build to Sealights, and therefore needs a new session ID of its own:

Please notice in this documentation page, we refer to the file containing the build Session-Id for the Integration Build as named as integrationBSID.txt instead of its default name produced by the agent (buildSessionId.txt in Java and buildSessionId in NodeJS).

Adding a new component or updating a new one

The same command is used for both adding and updating components in the integration build. If a component is encountered for the first time it is added to the existing ones, and if it already exists, then it is updated with the new build name.
You can report this either by providing the session ID of the components in the command line itself or by providing a JSON array in a file with the session ID's or app/branch/build details of one or more components.

Note that components can only be reported for a single build once. If you need to report multiple components you must do this in one call or on multiple builds

Samples using the -componentids option for Java or Node JS

Java

java -jar sl-build-scanner.jar -componentUpdate -tokenfile sltoken.txt -buildsessionidfile integrationBSID.txt -componentids <component_bsid>

NodeJS

./node_modules/.bin/slnodejs componentUpdate --tokenfile sltoken.txt --buildsessionidfile integrationBSID.txt --componentIds <component_bsid>

Samples using the -componentfile option for Java or Node JS

Java

java -jar sl-build-scanner.jar -componentUpdate -tokenfile sltoken.txt -buildsessionidfile integrationBSID.txt -componentfile <JSON_dependencies_file_path_and_filename>

NodeJS

The JSON array file should be in one of the following formats:

app/branch/build per component

BSID per component

app/branch/build per component

BSID per component

The JSON file format does not currently support comments. In order to assist CI job troubleshooting when reporting a large number of components using the BSID only method, an arbitrary field can be added which serves as a component name comment e.g.

[ { "component": “sample-frontend”, "buildSessionId": "<bsid_value" }, { “component”: “sample-backend”, "buildSessionId": "<bsid_value>" } ]

Note that the keywords "appName", "branch" and "build" are reserved and cannot be used as the additional field name

All the components being updated/deleted must be referring to builds already reported to Sealights (including the Build Scan step) using exact same appName/branchName/buildName or BSID parameters reported

Deleting a component

If you no longer use a component in your environment and want to remove it from the integration build, you will need to specifically update that a component was deleted as Sealights assumes a component not reported is just not updated.
Like with the update command above, you can do so by providing the session ID of the components in the command line itself or by providing a JSON array in a file with the session IDs or app/branch/build details of one or more components.
The only difference is using the componentDelete instead of the componentUpdate option.

Java

NodeJS