You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add repo flag validation rules, repo-id guidance, and Jenkins usage (#153)
## Summary
- Expanded the repo metadata flags table in the [repositories
tutorial](/tutorials/repositories) with detailed descriptions
- Added `--repo-url` format section explaining URL validation rules
(HTTPS web URLs vs clone URLs vs SSH URLs)
- Added `--repo-id` guidance section recommending stable unique
identifiers per VCS provider
- Added section on using repo flags in unsupported CI systems (e.g.
Jenkins) with a Jenkinsfile example
- Updated the existing example to include `--repo-id`
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: tutorials/repositories.md
+49-5Lines changed: 49 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,14 +33,57 @@ You can also provide repo metadata explicitly using these flags on `kosli attest
33
33
34
34
| Flag | Description |
35
35
|---|---|
36
-
|`--repository`| Name of the git repo as registered in Kosli (e.g. `my-org/my-repo`) |
37
-
|`--repo-provider`| VCS provider: `github`, `gitlab`, `bitbucket`, or `azure-devops`|
38
-
|`--repo-url`| URL of the repository |
39
-
|`--repo-id`| Unique identifier of the repository in the VCS provider |
36
+
|`--repository`| Name of the git repo as registered in Kosli (e.g. `my-org/my-repo`). |
37
+
|`--repo-provider`| VCS provider: `github`, `gitlab`, `bitbucket`, or `azure-devops`. Must be one of these values if provided. |
38
+
|`--repo-url`| URL of the repository. Must be a valid URL with a scheme and host (see URL format details below). |
39
+
|`--repo-id`| Unique identifier of the repository in the VCS provider (see choosing a repo ID below). |
40
+
41
+
All four flags are needed to fully populate repository information in Kosli. In [supported CI systems](/integrations/ci_cd), some of these flags are auto-defaulted from environment variables. In unsupported CI systems (e.g. Jenkins), you must provide all flags explicitly.
42
+
43
+
### `--repo-url` format
44
+
45
+
The `--repo-url` flag must be a valid URL with a scheme (`https://`) and a host. The CLI validates this when the flag is provided.
46
+
47
+
-**HTTPS web URLs** (recommended): `https://github.com/my-org/my-repo` or `https://bitbucket.org/my-workspace/my-repo`
48
+
-**HTTPS clone URLs**: `https://bitbucket.org/my-workspace/my-repo.git` — these pass validation and work, but we recommend dropping the `.git` suffix for consistency with how Kosli displays the URL in the app and CLI output.
49
+
-**SSH clone URLs**: `git@github.com:my-org/my-repo.git` — these **do not work** because they lack a URL scheme and fail CLI validation.
50
+
51
+
<Tip>
52
+
Use the plain web URL without `.git` (e.g. `https://bitbucket.org/my-workspace/my-repo`). This is the canonical format used across Kosli and matches what appears in the UI and CLI output.
53
+
</Tip>
54
+
55
+
### Choosing a `--repo-id`
56
+
57
+
The `--repo-id` should be a **stable, unique identifier** for the repository in your VCS provider. Avoid using the repository name, as it can change if the repo is renamed or moved to another provider.
58
+
59
+
Good choices for `--repo-id`:
60
+
-**GitHub**: The numeric repository ID (available via the GitHub API).
61
+
-**GitLab**: The `CI_PROJECT_ID` environment variable.
62
+
-**Bitbucket**: The `BITBUCKET_REPO_UUID` environment variable (available in Bitbucket Pipelines). If running in Jenkins with a Bitbucket repo, retrieve this value from the Bitbucket API or check a UUID into the repo in a file.
63
+
-**Azure DevOps**: The `Build.Repository.ID` predefined variable.
64
+
65
+
### Using repo flags in unsupported CI systems
66
+
67
+
If your CI system is not in the [list of supported CI systems](/integrations/ci_cd) (e.g. Jenkins, Bamboo), the CLI cannot auto-default repo metadata from environment variables. You must provide all four flags explicitly — `--repository`, `--repo-provider`, `--repo-url`, and `--repo-id`.
68
+
69
+
For example, in a Jenkinsfile for a Bitbucket repository:
0 commit comments