Skip to content

Conversation

@thomasd-
Copy link
Contributor

@thomasd- thomasd- commented May 9, 2018

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.

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.

1 participant