- GiteaBranch, GiteaBranchName, GiteaPullRequest: require ROLE_USER - All 22 MCP tools: require ROLE_USER (ROLE_ADMIN for users/clients listing) Tickets: T-002, T-007 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\ApiResource;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\GetCollection;
|
|
use App\State\GiteaPullRequestProvider;
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
|
|
#[ApiResource(
|
|
operations: [
|
|
new GetCollection(
|
|
uriTemplate: '/tasks/{taskId}/gitea/pull-requests',
|
|
normalizationContext: ['groups' => ['gitea_pr:read']],
|
|
provider: GiteaPullRequestProvider::class,
|
|
security: "is_granted('ROLE_USER')",
|
|
),
|
|
],
|
|
)]
|
|
final class GiteaPullRequest
|
|
{
|
|
#[Groups(['gitea_pr:read'])]
|
|
public int $number = 0;
|
|
|
|
#[Groups(['gitea_pr:read'])]
|
|
public string $title = '';
|
|
|
|
#[Groups(['gitea_pr:read'])]
|
|
public string $state = '';
|
|
|
|
#[Groups(['gitea_pr:read'])]
|
|
public bool $merged = false;
|
|
|
|
#[Groups(['gitea_pr:read'])]
|
|
public string $headBranch = '';
|
|
|
|
#[Groups(['gitea_pr:read'])]
|
|
public string $author = '';
|
|
|
|
#[Groups(['gitea_pr:read'])]
|
|
public string $url = '';
|
|
|
|
/**
|
|
* @var array<array{context: string, status: string, target_url: string}>
|
|
*/
|
|
#[Groups(['gitea_pr:read'])]
|
|
public array $ciStatuses = [];
|
|
}
|