Skip to content

GitLab directory listing turns a 404 into "directory … contains no files" - asserting the opposite of what happened (GitHub errors explicitly) #193

Description

@eljulians

Component: crates/sources (resolver.rs) | Severity: Low-Medium | Status: Code-traced

The GitLab tree pagination loop treats a 4xx (get_jsonOk(None)) as end-of-listing and returns Ok(vec![]). A typo'd path on a valid project (modern GitLab answers 404) then surfaces as "directory my-group/proj/skills/relese contains no files" - claiming the directory exists but is empty. The GitHub equivalent surfaces an explicit listing failure. v1.7.2 claims this class was fixed for both forges.

Where: crates/sources/src/resolver.rs:377-379, :410-412; message from crates/sources/src/sync.rs:742-745; GitHub contrast resolver.rs:787-792.

Repro (unit): mock client returning Ok(None) (404) for the first tree page → listing returns empty → sync error text says "contains no files".

Expected: distinguish "listing request failed / path invalid" from "genuinely empty" (error on 404-page-one).
Actual: misleading empty-dir error.

Fix sketch: on page 1 a Missing response → return Err("failed to list directory … (404 - check the path)"); only later pages' end conditions terminate pagination.

Tests: unit in resolver.rs (mock): 404 first page → Err mentioning the path; empty-200 first page → Ok(empty) keeps the current message.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions