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

Wait for some time between creating the release PR and searching for it #56

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

jcouball
Copy link
Member

@jcouball jcouball commented Jan 9, 2024

To output the link to the release PR, this gem searches for the PR number for the PR for the release branch as follows:

gh pr list --search "head:#{release_branch}" --json number --jq ".[].number

A problem was found that this was returning an empty string if called too quickly after creating the PR. Perhaps GitHub has eventual consistency or is indexing the result.

This PR makes a change to TRY to get the PR number up to 10 times sleeping 0.5 seconds between each attempt until a non-empty string is returned.

Note that Project#release_pr_number maps the empty string to a nil so the implementation is waiting for this method to return a non-nil.

@jcouball jcouball requested a review from a team as a code owner January 9, 2024 16:39
Copy link

codeclimate bot commented Jan 9, 2024

Code Climate has analyzed commit f2ca7c5 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@jcouball jcouball merged commit 5442745 into main Jan 9, 2024
8 checks passed
@jcouball jcouball deleted the wait_for_pr branch January 9, 2024 16:42
This was referenced Jan 9, 2024
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