Skip to content

Conversation

@jj22ee
Copy link
Contributor

@jj22ee jj22ee commented Oct 22, 2025

Issue #, if available:
Cherry-picks:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…rvability#497)

_decode_tool_use was only used when _tool_json_input_buf was found, but
we were decoding the entire _content_block after adding
_tool_json_input_buf to it. The _content_block overall which could
contain non-JSON elements (e.g. {}), causing failures. To fix this, we
have removed _decode_tool_use helper function and inlined JSON decoding
logic directly into content_block_stop handler in
_process_anthropic_claude_chunk, where we only use it to decode
_tool_json_input_buf before appending to _content_block.

Patch based on
open-telemetry/opentelemetry-python-contrib#3875
with code copied directly from
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/v0.54b1/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/bedrock_utils.py#L289

Repeated testing in
open-telemetry/opentelemetry-python-contrib#3875
to confirm this works

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@jj22ee jj22ee requested a review from a team as a code owner October 22, 2025 17:48
@jj22ee
Copy link
Contributor Author

jj22ee commented Oct 22, 2025

Note to reviewer:

@thpierce
Copy link
Contributor

thpierce commented Oct 22, 2025

PR run: (Line: 106, Col: 13): Job 'all-pr-checks-pass' depends on unknown job 'static-code-checks'.

Solution: cherry-pick this commit: 3f93378

@jj22ee jj22ee enabled auto-merge (squash) October 22, 2025 20:20
Miqueasher and others added 8 commits October 22, 2025 13:45
…lity#475)

Add validation step to require commit SHAs instead of version tags for
third-party GitHub actions in workflow files. Also fix the one we
missed: `aquasecurity/trivy-action` - depending on `master` is pretty
unusual and not trivial to catch, ultimately the Repo config `Require
actions to be pinned to a full-length commit SHA` will protect against
this if we missed any others.

### Testing done
* `Python Instrumentation PR Build / static-code-checks (pull_request)`
passes
* `Check CHANGELOG` fails, causing PR-build to fail, but `Check for
versioned GitHub action` passes:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17924516041/job/50967250100?pr=475
* Added various [`@v` in
code](aws-observability@f2f0523),
only finds uncommented ones:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17925754982/job/50971348934?pr=475
```
Found versioned GitHub actions. Use commit SHAs instead:
.github/actions/lambda_artifacts_build/action.yml:30:    - uses: actions/checkout@v4
.github/actions/lambda_artifacts_build/action.yml:42:    - uses: actions/checkout@v4 #v4
.github/workflows/daily-scan.yml:54:      - uses: actions/checkout@v4 #v4
.github/workflows/daily-scan.yml:106:      - uses: actions/checkout@v4
```

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
Add gate jobs that fail if any workflow job fails OR if any job is
missing from the gate's needs array. Prevents both job failures and
configuration drift when adding new workflow jobs. Callout: I don't
think it's possible to have one gate for both workflows, but it should
not be the case that we add more over time.

### Testing:
* Confirmed if even one subjob in a matrix fails, the job fails:
[PASS](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17930014615/job/50985189015?pr=477)
* lint(lint) passes, but lint (spellcheck) fails, and all-pr-checks-pass
fails.
* Confirmed if a job is missing, the job fails:
[PASS](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/17930365916/job/50986188220?pr=477)


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@jj22ee jj22ee merged commit 1029710 into aws-observability:release/v0.12.x Oct 22, 2025
16 checks passed
jj22ee added a commit that referenced this pull request Oct 24, 2025
*Issue #, if available:*
Address release failure:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/18734463348/job/53438678131

1. hatchling is responsible for generating a metadata file included in
the wheel file.
2. twine will validate this metadata before publishing to PyPI.

According to the release failure, the metadata's `license-expression`
field is malformed. Yet I tried [testing an artifact in a
fork](https://github.com/jj22ee/aws-otel-python-instrumentation/releases/tag/v0.12.2),
but the wheel file's metadata doesn't look suspicious. So the exact root
cause is unknown.

*Description of changes:*
Pins the following for the release:
```
twine==5.1.1
hatchling==1.25.0
```

The latest versions are not compatible with the release process, but
note that
- last twine release was on September 4th, 2025 -
https://pypi.org/project/twine/#history
- last hatchling release was on December 15th, 2024 -
https://pypi.org/project/hatchling/#history
- Our latest ADOT Python release was on September 16th, 2025.

Since there have been no new releases from twine/hatchling recently, it
is suspected (but not confirmed yet in order to get this release out
asap) that before the GitHub `actions/setup-python` upgrade in
#506,
an older `pip` version was installed, which installed older compatible
versions of twine/hatchling. Probably since we upgraded
`actions/setup-python`, `pip` might now install the latest versions of
them, in which our repo is not yet compatible according to the failed
release.

Reasoning why we need both (test publish to TestPyPI):
- failure with only pinning twine:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/18762260003/job/53529721289
- failure with only pinning hatchling:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/18762938622/job/53531893352
- success by pinning both twine and hatchling:
https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/18763023516/job/53532160232


-----------

2nd Issue is related to the PR build failure
(https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/18763622170/job/53533951402?pr=512#step:3:2157):
```
 > [builder 5/6] RUN if [ amd64 = "amd64" ]; then cargo install cargo-audit && cargo audit ; fi:
3.631   Downloaded allocator-api2 v0.2.21
3.635   Downloaded ahash v0.8.12
3.639   Downloaded addr2line v0.25.1
3.696 error: failed to compile `cargo-audit v0.21.2`, intermediate artifacts can be found at `/tmp/cargo-installifwHEz`.
3.696 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
3.696 
3.696 Caused by:
3.696   rustc 1.87.0 is not supported by the following package:
3.696     [email protected] requires rustc 1.89
3.696   Try re-running `cargo install` with `--locked``
```
This is fixed by following the guidance to use `--locked`. Looks like
the `Cargo.lock` file, which pins dependencies, wasn't actually being
used. `cargo-audit` is also [updated to be
pinned](https://crates.io/crates/cargo-audit/versions) for sanity.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
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.

3 participants