Skip to content
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
3 changes: 3 additions & 0 deletions client_reference/kosli_attest_sonar.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ If there are delays in the scan processing (either because the scanned project i
the scan results are not available by the time the attest sonar command is executed. In this case you can use the `--max-wait` flag to retry the command while waiting for the scan to be processed.
This flag takes the maximum number of seconds to wait for the results to be available. The Kosli CLI will then attempt to retrieve the scan results until the maximum wait time is reached, with
exponential backoff between retries. Once the results are available they are attested to Kosli as usual.
On SonarQube Cloud, only the latest scan of a short-lived branch records its commit. So this way, or with `--sonar-ce-task-url`, fails if another scan of the project
has finished since, or another scan of the branch is still being processed. Then use `--sonar-project-key` and `--sonar-revision` instead.

2. Providing the Sonar project key and either the revision or the pull-request ID of the scan (plus the SonarQube server URL if relevant).
For branch scans: if running the Kosli CLI in some CI/CD pipeline, the revision is defaulted to the commit SHA. If you are running the command locally,
or have overridden the revision in SonarQube via parameters to the Sonar scanner, you can provide the correct revision using the `--sonar-revision` flag.
If the scan ran on a branch other than the project's main branch in SonarQube, also provide the branch name using the `--sonar-branch` flag.
SonarQube only searches the project's main branch unless told otherwise, so without this flag the scan cannot be found.
On SonarQube Cloud, a short-lived branch keeps only its latest analysis, so the revision must be the latest commit analysed on that branch.
For pull request scans: provide the pull-request ID using the `--pull-request` flag instead of the revision.
SonarQube keeps only the latest analysis of a pull request, so if the scan for the current push has not finished, that is the previous push's analysis.
To make sure the attested analysis is of the commit you expect, also pass `--sonar-revision`: the command then fails if the pull request's analysis is of another commit.
Expand Down
28 changes: 10 additions & 18 deletions client_reference/kosli_diff_snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ kosli diff snapshots aws-beta aws-prod --output=json
```json
{
"snappish1": {
"snapshot_id": "aws-beta#8755",
"snapshot_id": "aws-beta#8767",
"artifacts": [
{
"fingerprint": "19ec5fa8d3a1d4140f41ec9ce85fce6ff45e9d670800c370e1c2f30200f94e4f",
Expand All @@ -84,14 +84,6 @@ kosli diff snapshots aws-beta aws-prod --output=json
"commit_url": "https://github.com/cyber-dojo/custom-start-points/commit/f988f2fc03966492f54b1a58b78c66b221609604",
"instance_count": 1
},
{
"fingerprint": "4fbb8f1c531b24dcb2a38c71c268e0b8d7244e650cb96ce042d62fb8c07cb85b",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/nginx:c6834ec@sha256:4fbb8f1c531b24dcb2a38c71c268e0b8d7244e650cb96ce042d62fb8c07cb85b",
"most_recent_timestamp": 1792490710,
"flow": "nginx-ci",
"commit_url": "https://github.com/cyber-dojo/nginx/commit/c6834ecc2c5b9e5622428f14be5c4de3b49dde46",
"instance_count": 1
},
{
"fingerprint": "69b1a9a10599734f7733def9dee3f3a207007220a49d7971f291d825e44fe1be",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/dashboard:eb9f90d@sha256:69b1a9a10599734f7733def9dee3f3a207007220a49d7971f291d825e44fe1be",
Expand Down Expand Up @@ -135,7 +127,7 @@ kosli diff snapshots aws-beta aws-prod --output=json
]
},
"snappish2": {
"snapshot_id": "aws-prod#5502",
"snapshot_id": "aws-prod#5513",
"artifacts": [
{
"fingerprint": "0fe7da2f4c8a0afd88f81bb066bbdd30e02e45f4872f6a0a4538f527185d729f",
Expand Down Expand Up @@ -169,14 +161,6 @@ kosli diff snapshots aws-beta aws-prod --output=json
"commit_url": "https://github.com/cyber-dojo/custom-start-points/commit/270c3c87aecb0e008e90879be753e67983e692c8",
"instance_count": 1
},
{
"fingerprint": "896a2cd49408db95a29b752857d17c6b68df23d8a27b75e70f2e55aa0c3d367f",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/nginx:b17fe49@sha256:896a2cd49408db95a29b752857d17c6b68df23d8a27b75e70f2e55aa0c3d367f",
"most_recent_timestamp": 1791648263,
"flow": "nginx-ci",
"commit_url": "https://github.com/cyber-dojo/nginx/commit/b17fe49939a63ae7b3996c4bf4f80e2362d537a2",
"instance_count": 1
},
{
"fingerprint": "9b6ccf0845871128cd22f33e8ec0e0a29b1794e736b5ef783ade3c8bca11c80b",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/runner:ef6768e@sha256:9b6ccf0845871128cd22f33e8ec0e0a29b1794e736b5ef783ade3c8bca11c80b",
Expand Down Expand Up @@ -216,6 +200,14 @@ kosli diff snapshots aws-beta aws-prod --output=json
"commit_url": "https://github.com/cyber-dojo/differ/commit/ce9bf5fdfb6e10b5d2de1b324fd03483e8b67173",
"instance_count": 1
},
{
"fingerprint": "4fbb8f1c531b24dcb2a38c71c268e0b8d7244e650cb96ce042d62fb8c07cb85b",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/nginx:c6834ec@sha256:4fbb8f1c531b24dcb2a38c71c268e0b8d7244e650cb96ce042d62fb8c07cb85b",
"most_recent_timestamp": 1792493363,
"flow": "nginx-ci",
"commit_url": "https://github.com/cyber-dojo/nginx/commit/c6834ecc2c5b9e5622428f14be5c4de3b49dde46",
"instance_count": 1
},
{
"fingerprint": "da7984414ab096232877f301d3d7cea1daf3cdd3fdb72157f530fe186cba3d78",
"name": "244531986313.dkr.ecr.eu-central-1.amazonaws.com/web:83553f5@sha256:da7984414ab096232877f301d3d7cea1daf3cdd3fdb72157f530fe186cba3d78",
Expand Down
6 changes: 3 additions & 3 deletions client_reference/kosli_get_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ kosli get environment aws-prod --output=json
"name": "aws-prod",
"type": "ECS",
"description": "The ECS cluster for production cyber-dojo",
"last_modified_at": 1792492798.5837657,
"last_reported_at": 1792492798.34876,
"last_changed_at": 1792486738.3284767,
"last_modified_at": 1792747979.6438622,
"last_reported_at": 1792747978.4493206,
"last_changed_at": 1792737118.3849633,
"state": true,
"include_scaling": false,
"tags": {
Expand Down
Loading
Loading