Skip to content

Commit 7701174

Browse files
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
1 parent d7a3b18 commit 7701174

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.github/workflows/core_contrib_test_0.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ env:
2020
CORE_REPO_SHA: ${{ inputs.CORE_REPO_SHA }}
2121
CONTRIB_REPO_SHA: ${{ inputs.CONTRIB_REPO_SHA }}
2222
PIP_EXISTS_ACTION: w
23+
CORE_REPO_API: ${{ github.workspace }}/opentelemetry-python/opentelemetry-api
24+
CORE_REPO_SDK: ${{ github.workspace }}/opentelemetry-python/opentelemetry-sdk
25+
CORE_REPO_SEMCONV: ${{ github.workspace }}/opentelemetry-python/opentelemetry-semantic-conventions
26+
CORE_REPO_TEST_UTILS: ${{ github.workspace }}/opentelemetry-python/tests/opentelemetry-test-utils
2327

2428
jobs:
2529

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/core_contrib_test.yml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ env:
2020
CORE_REPO_SHA: ${% raw %}{{ inputs.CORE_REPO_SHA }}{% endraw %}
2121
CONTRIB_REPO_SHA: ${% raw %}{{ inputs.CONTRIB_REPO_SHA }}{% endraw %}
2222
PIP_EXISTS_ACTION: w
23+
CORE_REPO_API: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/opentelemetry-api
24+
CORE_REPO_SDK: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/opentelemetry-sdk
25+
CORE_REPO_SEMCONV: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/opentelemetry-semantic-conventions
26+
CORE_REPO_TEST_UTILS: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python/tests/opentelemetry-test-utils
2327

2428
jobs:
2529
{%- for job_data in job_datas %}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
1212
## Unreleased
1313

14+
### Fixed
15+
16+
- 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
17+
([#4305](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4305))
18+
1419
## Version 1.40.0/0.61b0 (2026-03-04)
1520

1621
### Added

tox.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ envlist =
464464

465465
[testenv]
466466
test_deps =
467-
opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
468-
opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
469-
opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
470-
opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
467+
opentelemetry-api@{env:CORE_REPO_API}
468+
opentelemetry-semantic-conventions@{env:CORE_REPO_SEMCONV}
469+
opentelemetry-sdk@{env:CORE_REPO_SDK}
470+
opentelemetry-test-utils@{env:CORE_REPO_TEST_UTILS}
471471
deps =
472472
lint: -r dev-requirements.txt
473473
coverage: pytest
@@ -790,6 +790,10 @@ setenv =
790790
; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
791791
CORE_REPO_SHA={env:CORE_REPO_SHA:main}
792792
CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}
793+
CORE_REPO_API={env:CORE_REPO_API:{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api}
794+
CORE_REPO_SDK={env:CORE_REPO_SDK:{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk}
795+
CORE_REPO_SEMCONV={env:CORE_REPO_SEMCONV:{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions}
796+
CORE_REPO_TEST_UTILS={env:CORE_REPO_TEST_UTILS:{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils}
793797
UV_CONFIG_FILE={toxinidir}/tox-uv.toml
794798
PIP_CONSTRAINTS={toxinidir}/test-constraints.txt
795799
UV_BUILD_CONSTRAINT={toxinidir}/test-constraints.txt

0 commit comments

Comments
 (0)