NAME

WWW::Gitea::PullRequest - Gitea pull request entity

VERSION

version 0.001

SYNOPSIS

my $pr = $gitea->pulls->get('getty', 'p5-www-gitea', 12);

print $pr->number, " ", $pr->title, "\n";
print $pr->head_branch, " -> ", $pr->base_branch, "\n";

$pr->merge(Do => 'squash') unless $pr->is_merged;

DESCRIPTION

Lightweight wrapper around the JSON returned for a Gitea pull request. Lifecycle methods delegate back to the client's WWW::Gitea::API::PullRequests controller. The owning repository is taken from the explicit "owner"/"repo" passed at construction, falling back to the base.repo block embedded in the pull-request JSON. The raw decoded data is always available via "data".

data

Raw decoded JSON for the pull request. Writable so "refresh" and "edit" can update it in place.

owner

Owner of the repository this pull request belongs to. Optional; falls back to the embedded data->{base}{repo}{owner}{login}.

repo

Name of the repository this pull request belongs to. Optional; falls back to the embedded data->{base}{repo}{name}.

id

Global numeric pull-request ID.

number

Per-repository pull-request index (shared with the issue number space).

title

Pull-request title.

body

Pull-request body (Markdown).

state

open or closed.

merged

True if the pull request has been merged (from the entity JSON).

mergeable

True if Gitea considers the pull request mergeable.

html_url

Web URL of the pull request.

created_at

ISO-8601 creation timestamp.

updated_at

ISO-8601 last-update timestamp.

user_login

Login name of the pull request's author.

head_branch

The source (head) branch name.

base_branch

The target (base) branch name.

refresh

$pr->refresh;

Re-fetches the pull request and updates "data" in place.

edit

$pr->edit(title => 'New title');

Edits the pull request and updates "data" in place.

merge

$pr->merge(Do => 'squash');

Merges the pull request. Delegates to "merge" in WWW::Gitea::API::PullRequests.

is_merged

if ($pr->is_merged) { ... }

Checks via the API whether the pull request has been merged. Delegates to "is_merged" in WWW::Gitea::API::PullRequests.

close

$pr->close;

Closes the pull request (shortcut for $pr->edit(state => 'closed')).

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://codeberg.org/getty/p5-www-gitea/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

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