SCM metadata YAML spec
Reference for YAML emitted by cce scm describe. This is SCM API metadata only; it does not scan source code or emit Backstage catalog entities.
Package design (providers, auth, extension rules): pkg/scmmeta/README.md
Future work / go-scm plans (agents): features/scmmeta/
Command
cce scm describe \
--provider gitlab \
--base-url https://gitlab.com \
--repo group/sub/project \
--token "$GITLAB_TOKEN" \
-o repo.yaml
--provider selects the SCM type (default gitlab). Self-hosted GitLab CE/EE: set --base-url to your instance root (for example https://gitlab.example.com).
Envelope
| Key | Meaning |
|---|---|
schema_version |
Core schema version ("4" today) |
fetched_at |
RFC3339 UTC when metadata was fetched |
provider |
SCM provider id from --provider |
host |
API host (gitlab.com or self-hosted host) |
repo |
Canonical repo path (group/sub/project) |
Core sections
repository
Cross-provider repository metadata: id, name, full_name, description, default_branch, visibility, clone/html URLs, created/updated timestamps, archived, empty, fork.
activity
| Sub-key | Source (GitLab) |
|---|---|
pipelines |
Reserved (supported: false, empty items) |
Pull requests and commit statuses are not included (schema v4): they inflate YAML without helping catalog emit.
Extensions
Provider-native fields that do not map cleanly to core keys live under extensions.<provider>.
GitLab example:
extensions:
gitlab:
path_with_namespace: group/sub/project
topics:
- platform
license:
key: apache-2.0
name: Apache License 2.0
namespace:
id: "42"
name: subgroup
path: subgroup
kind: group
full_path: group/subgroup
web_url: https://gitlab.example.com/groups/group/subgroup
owner:
id: "7"
username: platform-bot
name: Platform Bot
state: active
web_url: https://gitlab.example.com/platform-bot
groups:
- id: "99"
name: shared-team
full_path: org/shared-team
access_level: 30
access: developer
members:
- id: "7"
username: platform-bot
name: Platform Bot
state: active
access_level: 50
access: owner
| Field | Source |
|---|---|
license |
Project license from GET /projects/:id?license=true (key, name only; omitted when null) |
namespace |
Project namespace object |
owner |
Project owner when present (often absent for group-owned projects) |
groups |
Project shared_with_groups |
members |
GET /projects/:id/members/all (capped, sorted by username) |
Adding a core key requires a schema_version bump. Prefer extensions first when only one provider exposes a field.
Relationship to Backstage export
pkg/backstage enriches local checkout metadata for cce --format backstage. pkg/scmmeta fetches live SCM API repository and ownership fields. The packages stay separate; a future workflow may merge API metadata hints with Backstage resolver precedence.
See also pkg/scmmeta/README.md (scmmeta vs pkg/source clone auth vs backstage).
Relationship to GitHub scan (--repo)
cce --repo owner/repo uses pkg/source (go-git clone, Basic x-access-token auth) to materialize a checkout for static analysis. That is unrelated to cce scm describe, which uses go-scm REST + Bearer and does not clone.
Limitations
- Implemented provider today: GitLab (
--provider gitlab) - No pipeline list (
activity.pipelines.supported: false) - No code scan, classification, or Glean integration
- Members are capped (default 50); not a full IAM dump