Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9939

Closed
Open
Created Dec 30, 2015 by Administrator@rootOwner

repository archive API results: project id vs namespace/projectname

Created by: aadmathijssen

If I understand correctly, the API allows two ways of specifying a project: by id and by namespace/projectname.

When using the repository archive api url (http://doc.gitlab.com/ce/api/repositories.html#get-file-archive), these two ways of specying a project return different results (assuming project foo/bar has id 123):

  • GET /projects/123/repository/archive returns a tar.gz file of the tip of the repository (which is what I would expect)
  • GET /projects/foo%2Fbar/repository/archive does not return an archive, but shows the following JSON:
    {
        "RepoPath":"/var/opt/gitlab/git-data/repositories/foo/bar.git",
        "ArchivePrefix":"bar-master-488e92b382b54dfcbe8fbb6398520a9257cae657",
        "ArchivePath":"/var/opt/gitlab/gitlab-rails/shared/cache/archive/bar.git/bar-master-488e92b382b54dfcbe8fbb6398520a9257cae657.tar.gz",
        "CommitId":"488e92b382b54dfcbe8fbb6398520a9257cae657"
    }

I think this is a bug, but I am not sure, since the documentation of the repository archive api only mentions that the id can be specified using "the ID of the project"; it doesn't explicitly state that the namespace/projectname syntax is also supported. On the other hand, this syntax is supported by other api url's that I have used.

I encountered this when using composer to install dependencies from a locally installed GitLab CE 8.3.0 using the GitLab driver. This driver uses the namespace/projectname syntax to download archives.

Assignee
Assign to
Time tracking