Skip to content

fix(cli): keep a GitLab subgroup project's full path in the report - #266

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/observe-gitlab-subgroup-path
Nov 18, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:fix/observe-gitlab-subgroup-path

Conversation

@FredApps

@FredApps FredApps commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Needs maintainer: confirm that the observation ingest server accepts a repository.ownerName with more than two segments (group/sub/project). If it validates owner/name strictly, it needs to accept the GitLab subgroup form first, or those reports would be rejected. I could not check this from the repository.

Fixes #265

Changed behavior

observe now reports the full repository path from the CI environment as repository.ownerName when it has at least two non-empty segments. A GitLab project in a subgroup (CI_PROJECT_PATH=group/sub/project) is reported as group/sub/project instead of group/sub. Two-segment names (GitHub, top-level GitLab projects) are unchanged, and a value without a / is still omitted. The ObservationRepository.ownerName doc comment mentions the longer GitLab form.

Note for reviewers: if the ingest server validates ownerName as exactly owner/name, it needs to accept the longer GitLab path too. I could not check that from this repository.

Validation

  • New test in tests/client/observe.test.ts: observing with GITLAB_CI=true and CI_PROJECT_PATH=group/sub/project. It fails on main (group/sub) and passes with this change.
  • node --import tsx --test tests/client/observe.test.ts tests/client/context.test.ts: 37 passed.
  • tsc --noEmit -p packages/diffci-cli: clean.

observe kept only the first two segments of CI_PROJECT_PATH, so
group/sub/project was reported as group/sub.

Fixes DiffCI#265

Signed-off-by: FredApps <[email protected]>
@FredApps

Copy link
Copy Markdown
Contributor Author

Cross-review (FredApps, head 8542d86). Not an approval.

Checked

Fixed: nothing needed.

Open

  • For a maintainer: I can't check from this repository whether the ingest service accepts an ownerName with three or more segments, as the issue notes.

@adityankale190895
adityankale190895 marked this pull request as ready for review November 18, 2026 05:44
@adityankale190895
adityankale190895 merged commit a0972e3 into DiffCI:main Nov 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

observe: a GitLab subgroup project is reported as its parent group (ownerName drops the project name)

2 participants