Skip to content

Add Composer Project Service (updated)

gitlab-qa-bot requested to merge github/fork/ikappas/master into master

Created by: ikappas

This commit adds the per-project option to expose a project as a composer package. It generates and maintains a packages.json file along with a project specific /p/project-{id}.json file (conforming to https://getcomposer.org/doc/05-repositories.md#includes) in the public/ folder, allowing the GitLab install to be used as a Composer repository.

Note: There is a known issue integrating with the GitLab-Omnibus, namely that the public folder is owned by 'root' and GitLab is run as 'git'. The GitLab-Omnibus chef script needs to be updated to allow access to both packages.json and the /p/ folder in the public/ folder

It extends on the original idea providing extended service configuration options that allow to work with packages that do not include a composer.json

It has three operational modes allowing for:

  1. Default: Searches for a composer.json file in the source code root folder and if found exports the package.
  2. Project: Parse project attributes to create a virtual composer.json to use for exporting the package.
  3. Advanced: Parse a custom json string supplied in the service configuration to export the package.

It also has branch / tag filters that allows fine-grained filtering of specific branches/tags to be exposed as composer packages.

In the process of providing a more complex configuration screen i added support for rendering fieldsets, and options in project service configuration along with enabling hints. Also notifications are enabled for Tag/Branch deletion from the gitlab host.

This is and updated merge request for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/106 working with the latest source code.

Please see feature thread http://feedback.gitlab.com/forums/176466-general/suggestions/5953067-provide-composer-package-repository-support

When a project that has activated the composer service receives a push, the public /packages.json file and project specific json file will be refreshed to include version definitions for the branches and tags as specified in the service configuration in the project's repository.

Merge request reports