The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dist::Zilla::Plugin::GitLab::Meta - Add a GitLab repo's info to META.{yml,json}

VERSION

version 1.0002

SYNOPSIS

Configure git with your GitLab login name:

    $ git config --global gitlab.user LoginName
    $ git config --global gitlab.token AccessToken

Set up an access token on GitLab, in your profile under "Personal Access Tokens." You must grant the token the api scope!

then, in your dist.ini:

    # default config
    [GitLab::Meta]

    # to override the repo name
    [GitLab::Meta]
    repo = SomeRepo

See "ATTRIBUTES" for more options.

DESCRIPTION

This Dist::Zilla plugin adds some information about the distribution's GitLab repository to the META.{yml,json} files, using the official CPAN::Meta specification.

Note that, to work properly, GitLab::Meta needs the network to connect to GitLab itself. If the network is not available, it will try to come up with sensible data, but it may be inaccurate.

GitLab::Meta currently sets the following fields:

homepage

The official home of this project on the web.

repository
web

URL pointing to the GitLab page of the project.

url

URL pointing to the GitLab repository (git://...).

type

This is set to git by default.

bugtracker
web

URL pointing to the GitLab issues page of the project. If the bugs option is set to false (default is true) or the issues are disabled in the GitLab repository, this will be skipped.

When offline, this is not set.

ATTRIBUTES

bugs

The META bugtracker web field will be set to the issue's page of the repository on GitLab, if this option is set to true (default) and if the GitLab Issues happen to be activated (see the GitLab repository's General settings panel).

fork

If the repository is a GitLab fork of another repository this option will make all the information be taken from the original repository instead of the forked one, if it's set to true (default).

metacpan

The GitLab homepage field will be set to the metacpan.org distribution URL (e.g. https://metacpan.org/release/Dist-Zilla-Plugin-GitLab) if this option is set to true (default).

This takes precedence over the p3rl options (if both are true, metacpan will be used).

meta_home

The GitLab homepage field will be set to the value present in the dist meta (e.g. the one set by other plugins) if this option is set to true (default is false). If no value is present in the dist meta, this option is ignored.

This takes precedence over the metacpan and p3rl options (if all three are true, meta_home will be used).

p3rl

The GitLab homepage field will be set to the p3rl.org shortened URL (e.g. https://p3rl.org/Dist::Zilla::Plugin::GitLab) if this option is set to true (default is false).

remote

Specifies the git remote name to be used when guessing the repo name (default origin).

repo

The name of the GitLab repository. By default the name will be extracted from the URL of the remote specified in the remote option, and if that fails the dist name (from dist.ini) is used. It can also be in the form user/repo when it belongs to another GitLab user/organization.

wiki

The META homepage field will be set to the URL of the wiki of the GitLab repository, if this option is set to true (default is false) and if the GitLab Wiki happens to be activated (see the GitLab repository's Admin panel).

AUTHOR

D Ruth Holloway <ruth@hiruthie.me>

COPYRIGHT AND LICENSE

This software is copyright (c) 2022 by D Ruth Holloway.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.