atlassian-python-api
atlassian-python-api copied to clipboard
Unable to trigger a specific pipeline without providing commit key
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.
I think the whole if block can be removed. Please also update the documentation. A commit or/and a pattern can be given.
@Spacetown - I've raised a PR, please check and ack.
@Spacetown - have addressed the comments.
@gonchik This can be closed.