atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

Unable to trigger a specific pipeline without providing commit key

Open arvind-kalyan opened this issue 3 years ago • 4 comments

Hello, I'm trying out the bitbucket pipelines python api, but running into an issue where it mandatorily asks for commit to be non None while calling pipelines.trigger() API.

What I'm trying to do is to be able to trigger a custom pipeline for a branch : r.pipelines.trigger(branch="master", pattern="deployment-to-test-infra", variables=[{'key': 'SERVER_ENV', 'value': 'test-01'}) , it's giving the error : ValueError: Missing argument [commit]..

I'm however able to trigger the HTTP API directly without commits and it works fine.

        if pattern is not None:
            if commit is None:
                raise ValueError("Missing argument [commit].")
            data["target"]["selector"] = {
                "type": "custom",
                "pattern": pattern,
            }

I'm not sure why this inner IF check was added. I can help with the PR if you can let me know the changes required.

arvind-kalyan avatar Aug 26 '21 12:08 arvind-kalyan

I think the whole if block can be removed. Please also update the documentation. A commit or/and a pattern can be given.

Spacetown avatar Aug 26 '21 12:08 Spacetown

@Spacetown - I've raised a PR, please check and ack.

arvind-kalyan avatar Aug 26 '21 13:08 arvind-kalyan

@Spacetown - have addressed the comments.

arvind-kalyan avatar Aug 27 '21 07:08 arvind-kalyan

@gonchik This can be closed.

Spacetown avatar May 23 '22 18:05 Spacetown