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 env sha for build:wait when there's a project with no commit #1008

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

wwilsman
Copy link
Contributor

What is this?

With the build:wait command, a project and commit can be provided to search for a build to wait on. However, sometimes the HEAD commit, or even local CI environment variables, can refer to a merge commit instead of the branch commit. When a build is created, we use the correct commit in most environments. However when a user provides a commit to the build:wait command, it might not match the commit that was used when creating the build. This causes the API to return an empty list since there are no builds associated with that commit for a project.

This PR addresses this issue in two primary ways. First, the command will log Waiting for build... when the API returns an empty list. This is because this command can be started before a build is actually created, and will update with the correct info once a matching build is found within the command timeout. An error will be thrown if a build is not found within the timeout. Second, rather than relying on the user to provide the correct commit, we can default to the commit found in the environment, which is the same commit that would be used when creating a new build. This default commit is only used when providing the --project flag without a --commit flag.

@wwilsman wwilsman added the ✨ enhancement New feature or request label Jul 27, 2022
@wwilsman wwilsman requested a review from Robdel12 July 27, 2022 16:15
@wwilsman wwilsman force-pushed the ww/build-wait-env-commit-sha branch 2 times, most recently from f70e111 to 3165290 Compare July 27, 2022 16:45
@wwilsman wwilsman force-pushed the ww/build-wait-env-commit-sha branch from 3165290 to 2e8d8b4 Compare July 27, 2022 16:53
Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏁

@wwilsman wwilsman merged commit d5e21c4 into master Jul 28, 2022
@wwilsman wwilsman deleted the ww/build-wait-env-commit-sha branch July 28, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants