chore(ci): retry lstk interception and pin the lstk CLI version - #112
Merged
Conversation
paolosalvatori
approved these changes
Jul 30, 2026
paolosalvatori
left a comment
Contributor
There was a problem hiding this comment.
Makes sense , I noticed the same issue when running lstk az start-interception locally. No need for a Claude Code review. Thanks for the fix!
|
ℹ️ Fix is shipped in lstk v0.20.1. Thanks Idris for raising the lstk PR. Feel free to unpin the lstk version if you prefer! |
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.
Motivation
Every sample job is currently failing at setup, on every branch, with:
This is not caused by any sample. It happens in
run-samples.shbefore a single sample executes, and it hit two unrelated branches within a minute of each other (fix/eventhubs-dashboard-totalsandfeat/eventhubs-eventgrid-sample), both of which were green the day before with no workflow change in between.The emulator is genuinely running when this fires: the image is pulled,
localstack waithas already returned, andrun-samples.shprints "LocalStack is already running." immediately before. Solstkis reporting a live emulator as absent. That is a reproducible class of behaviour rather than a theory — locally, against a running Azure emulator,lstk statusanswersLocalStack AWS Emulator is not running. The flavour-specific detection can produce false negatives.Two things changed upstream on the same day, and both were investigated and eliminated:
localstack/localstack-azure:latestwas re-pushed at 06:54, and@localstack/lstk0.20.0 was published at 11:10. With the freshly pulled image, lstk 0.20.0 and an emptyAZURE_CONFIG_DIR(the state a CI runner is in), interception succeeds locally every time. The failure has not been reproduced outside CI, so this PR makes the step survivable and self-diagnosing rather than claiming a root cause it cannot demonstrate.Two properties of the existing code turn a transient into a total outage:
run-samples.shruns underset -euo pipefail, andlstk az start-interceptionis the only command in that setup block without a failure guard — every neighbouringazcall already has|| true. One bad detection therefore kills the job outright.Changes
run-samples.shretrieslstk az start-interceptionup to five times with increasing backoff, and on the final failure prints the lstk version, the container state, the emulator health endpoint and the tail oflstk.log..github/workflows/run-samples.ymlpins the CLI viaLSTK_VERSION: "0.20.0"instead of installing the floating latest.The step is deliberately still fatal after the last attempt, and
|| truewas rejected: without interception the Azure CLI targets real Azure, so continuing would point the suite'saz group create/az group deletecalls at the cloud. Failing fast is the correct behaviour; the only defect was failing on the first transient.The pin is hygiene, not the fix, and is called out as such: it pins the version that demonstrably works, and brings this install in line with the rest of the workflow, where every action is already SHA-pinned. An unpinned dependency lands in every run simultaneously with no commit to bisect — precisely the position this failure left us in.
Tests
bash -n run-samples.shpasses; the workflow YAML parses.set -euo pipefailwith a stubbed command: a transient failure recovers on attempt 3 and exits 0, and a persistent failure gives up after 5 attempts and exits 1 — confirming it cannot silently fall through to real Azure.run-samples.shand executed against a live emulator and a reallstk, succeeding on the first attempt.run-samples.sh --listis unchanged (36 entries), so sharding is unaffected.Since the CI failure could not be reproduced locally, this cannot be proven to clear it. If the cause is deterministic rather than transient the job will still fail — but the diagnostics will then identify why, which is the information the current failure does not provide.
Related
Unblocks #109 and #110, both of which are red on this failure rather than on their own content.