Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for the effective branching model #88

Open
bertoost opened this issue Dec 11, 2024 · 0 comments
Open

Support for the effective branching model #88

bertoost opened this issue Dec 11, 2024 · 0 comments

Comments

@bertoost
Copy link

Hi there,

Just discovered that the branching-model calls are literally the repository settings. Not the inherited settings, if configured. With the effective-branching-model, this should be fixed.

https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branching-model/#api-repositories-workspace-repo-slug-effective-branching-model-get

use Bitbucket\Api\Repositories\Workspaces\AbstractWorkspacesApi;
use Bitbucket\HttpClient\Util\UriBuilder;

class EffectiveBranchingModel extends AbstractWorkspacesApi
{
    public function show(array $params = []): array
    {
        $uri = $this->buildEffectiveBranchingModelUri();

        return $this->get($uri, $params);
    }

    protected function buildEffectiveBranchingModelUri(string ...$parts): string
    {
        return UriBuilder::build('repositories', $this->workspace, $this->repo, 'effective-branching-model', ...$parts);
    }
}

In the workspaces part;

public function effectiveBranchingModel(string $repo): EffectiveBranchingModel
{
    return new EffectiveBranchingModel($this->getClient(), $this->workspace, $repo);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant