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

Use an API call to check for new versions instead of git ls-remote #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thomasd-
Copy link

When using this resource with a webhook trigger, the resource sometimes fails to detect new pull request because Bitbucket calls the webhook URL before creating the refs in the git repository.

Since the resource used git ls-remote to check for new PRs, it happens often that the repo is not ready when the check is done, and then no new version is detected and no job is started.

This commit change the behavior of the check command to use an API call to get the pull requests, which will hopefully be up to date when the webhook calls for the update.

Since we don't have access to the pull-request/<id>/merge hash from the API, the structure of the version is slightly changed :

  • hash is replace by from_hash and to_hash, pointing to the HEAD of the source and target branches
  • to_hash is only populated when the source indicates that a new build is to be made when the target change. This ensure that a new version is made only when needed.

@mmb
Copy link
Owner

mmb commented Oct 16, 2020

I'm sorry this pull request has been open for this long. I'll review it and merge it. Is there anything you would change about it since so much time has gone by?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants