Repository navigation
fix: skip the readiness check when sqlcmd can't run - #350
Merged
Merged
Conversation
install() retried the sqlcmd login with an exponential backoff, and its tests had to replace the global setTimeout to run the loop. Move the loop into waitForDatabase(), which now returns whether the database became ready and how many retries it made. It waits with the setTimeout from node:timers/promises, which the utils tests already mock. The single sqlcmd login moves into queryDatabase(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The readiness check tries to log in up to 6 times: once, then again after waits of 1, 2, 4, 8 and 16 seconds. The wait-for-ready description said that it made up to 10 attempts, and the log messages counted the retries, so the action reported "Database not ready after 5 attempts" after 6 attempts. Count the attempts, number them in the debug log, and describe the real attempts and waits in action.yml and the README. A test checks the description against the attempts and waits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@actions/exec rejects when it can't find sqlcmd on the PATH. The readiness check didn't catch this, so the action failed after a successful install, left the "Waiting for database" log group open and printed Detail.txt and the error logs as if setup had failed. waitForDatabase() now reports that the check is unavailable when sqlcmd can't run, and the action skips the check with a warning. If setup asked for a reboot (exit code 3010), the action fails with a clear error instead, because it can't tell whether the instance works without that reboot. The check runs in core.group(), which closes the log group in all cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dhensby
marked this pull request as ready for review
November 21, 2026 14:13
|
🎉 This PR is included in version 4.1.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
wait-for-ready: true(the default), the action runssqlcmdafter setup to check that the instance accepts logins.@actions/execrejects when it can't findsqlcmdon the PATH, and the action didn't catch this. A successful install then failed, theWaiting for databaselog group stayed open, and the action printedDetail.txtand the error logs as if setup had failed. The GitHub-hosted images includesqlcmd, so this mainly affects self-hosted runners and custom images. The input description and the log messages also gave the wrong number of attempts.install()intowaitForDatabase()insrc/utils.ts, with no change in behaviour. It waits with thesetTimeoutfromnode:timers/promises, so the backoff tests use the existing mock and no longer replace the globalsetTimeout.action.ymlsaid "A maximum of 10 attempts", and the log messages counted the retries, so the action printed "Database not ready after 5 attempts" after 6 attempts. The messages now count attempts, and the debug log numbers each one ("attempt 2 of 6"). The input description gives the real attempts and waits, and a test checks it against the code.sqlcmdcan't run.waitForDatabase()now returnsunavailablewith the reason whensqlcmdcan't run, on the first or a later attempt. The action then skips the check with a warning, and the install succeeds. If setup asked for a reboot (exit code 3010), the action fails with a clear error instead, because it can't tell whether the instance works without that reboot. This matches how a failed readiness check is already fatal after a 3010. The check runs incore.group(), which closes the log group in all cases.wait-for-readydescription says that the action warns and continues when the database isn't ready orsqlcmdcan't run, and fails instead after a 3010. The README "Reboot requests" section and step 7 of the architecture in.github/copilot-instructions.mdsay the same.sqlcmdthat can't run on the first or a later attempt, a non-Errorrejection, a database that becomes ready on the last attempt, each outcome with and without a 3010,wait-for-ready: false, and a check that runs inside its log group.sqlcmdcan't run in one more case that this PR doesn't handle. Ifsqlcmd.exeexists but Node can't start it (for example because the file is damaged), Node throws while@actions/execstarts the process. The promise thatexecreturns then never settles, and the action stops with an unhandled rejection. This was already the case before this change, and the fix belongs in@actions/exec.Closes #325
🤖 Generated with Claude Code