Repository navigation
Conversation
The build function runs in an if condition, where set -e is off, so a pip failure produced a package with only the handler file and a passing build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The script reports Docker startup failures as pip errors, which can misdirect troubleshooting.
1 open issue
What changed in this PR
This PR makes Python integration-test Lambda builds fail when dependency installation fails, preventing incomplete packages from causing misleading downstream test failures.
Changes:
- Explicitly checks the Docker command’s exit status rather than relying on
set -e. - Reports installation failure and returns a nonzero status to the build loop.
- Documents why the existing package-directory check cannot detect pip failures.
| File | Description |
|---|---|
integration-tests/scripts/build-python.sh |
Adds explicit failure handling around Docker-based dependency installation. |
Review effort: Balanced
Contributor
… message Docker can fail before pip starts, so print the step and its exit status instead of blaming pip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Problem
When
pip installfails for a Python test function, the "build python lambdas" job still passes. The deployed function then has only its handler file and no dependencies, and the failure shows up later as a test that gets no data.This happened on #1461. pip stopped with a dependency conflict:
The job then printed "otlp-python built successfully", with only
lambda_function.pyin the package. Later, theotlpintegration suite failed because the Python function sent no trace.Cause
The script sets
set -e, but the build loop calls the build function inside anifcondition. Bash turns offset -ein that context, so the script continues after pip fails. The check after the install step looks only for a non-emptypackage/directory, and the script copies the.pyfiles into that directory first. So the check always passes.This PR
Checks the exit status of the
docker runstep that runs pip. When that step fails, the function prints the exit status and returns 1. The job then fails and lists the function. The message names thedocker runstep, not pip, because Docker can also fail before pip starts. An example is a Docker daemon that is not running.Testing
Steps
dockeron thePATHwith a stub that exits 1, and ran the script frommainand from this branch.package/and exits 0, and ran this branch again.Result
I did not run the real Docker image. CI runs it.
🤖 Generated with Claude Code