fix(ci): eliminate SHA propagation flakiness in Core Contrib Test (#4305)

* fix(ci): eliminate SHA propagation flakiness in Core Contrib Test

Each Core Contrib Test job was doing two separate git operations for
the core repo: actions/checkout (uses GitHub internal API, always
works) and then tox installing packages via git+https:// (hits public
CDN, fails when SHA hasn't propagated yet).

Fix by setting per-package env vars (CORE_REPO_API, CORE_REPO_SDK,
CORE_REPO_SEMCONV, CORE_REPO_TEST_UTILS) in the CI workflow to point
at the already-checked-out local copy, eliminating the second network
clone entirely.

Backward compatible: when the new vars are unset (local dev), they
fall back to the existing git URL + subdirectory behavior.

Fixes #4304

Assisted-by: Claude Sonnet 4.6

* fix: restore version header dropped during rebase

Assisted-by: Claude Sonnet 4.6

* move CORE_REPO_* vars to top-level env block

Use github.workspace context instead of a shell step to set the
per-package local path env vars, as suggested in code review.

Assisted-by: Claude Sonnet 4.6
This commit is contained in:
Mike Goldsmith
2026-03-06 20:14:30 +00:00
committed by GitHub
parent d7a3b18760
commit 7701174242
4 changed files with 21 additions and 4 deletions

View File

@@ -20,6 +20,10 @@ env:
CORE_REPO_SHA: ${{ inputs.CORE_REPO_SHA }}
CONTRIB_REPO_SHA: ${{ inputs.CONTRIB_REPO_SHA }}
PIP_EXISTS_ACTION: w
CORE_REPO_API: ${{ github.workspace }}/opentelemetry-python/opentelemetry-api
CORE_REPO_SDK: ${{ github.workspace }}/opentelemetry-python/opentelemetry-sdk
CORE_REPO_SEMCONV: ${{ github.workspace }}/opentelemetry-python/opentelemetry-semantic-conventions
CORE_REPO_TEST_UTILS: ${{ github.workspace }}/opentelemetry-python/tests/opentelemetry-test-utils
jobs:

View File

@@ -20,6 +20,10 @@ env:
CORE_REPO_SHA: ${% raw %}{{ inputs.CORE_REPO_SHA }}{% endraw %}
CONTRIB_REPO_SHA: ${% raw %}{{ inputs.CONTRIB_REPO_SHA }}{% endraw %}
PIP_EXISTS_ACTION: w
CORE_REPO_API: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/opentelemetry-api
CORE_REPO_SDK: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/opentelemetry-sdk
CORE_REPO_SEMCONV: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/opentelemetry-semantic-conventions
CORE_REPO_TEST_UTILS: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/tests/opentelemetry-test-utils
jobs:
{%- for job_data in job_datas %}

View File

@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixed
- Fix intermittent `Core Contrib Test` CI failures caused by GitHub git CDN SHA propagation lag by installing core packages from the already-checked-out local copy instead of a second git clone
([#4305](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4305))
## Version 1.40.0/0.61b0 (2026-03-04)
### Added

12
tox.ini
View File

@@ -464,10 +464,10 @@ envlist =
[testenv]
test_deps =
opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
opentelemetry-api@{env:CORE_REPO_API}
opentelemetry-semantic-conventions@{env:CORE_REPO_SEMCONV}
opentelemetry-sdk@{env:CORE_REPO_SDK}
opentelemetry-test-utils@{env:CORE_REPO_TEST_UTILS}
deps =
lint: -r dev-requirements.txt
coverage: pytest
@@ -790,6 +790,10 @@ setenv =
; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
CORE_REPO_SHA={env:CORE_REPO_SHA:main}
CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}
CORE_REPO_API={env:CORE_REPO_API:{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api}
CORE_REPO_SDK={env:CORE_REPO_SDK:{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk}
CORE_REPO_SEMCONV={env:CORE_REPO_SEMCONV:{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions}
CORE_REPO_TEST_UTILS={env:CORE_REPO_TEST_UTILS:{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils}
UV_CONFIG_FILE={toxinidir}/tox-uv.toml
PIP_CONSTRAINTS={toxinidir}/test-constraints.txt
UV_BUILD_CONSTRAINT={toxinidir}/test-constraints.txt