From 7701174242ebca38e7ba04169af2c770d0aa6849 Mon Sep 17 00:00:00 2001 From: Mike Goldsmith Date: Fri, 6 Mar 2026 20:14:30 +0000 Subject: [PATCH] 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 --- .github/workflows/core_contrib_test_0.yml | 4 ++++ .../generate_workflows_lib/core_contrib_test.yml.j2 | 4 ++++ CHANGELOG.md | 5 +++++ tox.ini | 12 ++++++++---- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/core_contrib_test_0.yml b/.github/workflows/core_contrib_test_0.yml index d6950358a..6cc751461 100644 --- a/.github/workflows/core_contrib_test_0.yml +++ b/.github/workflows/core_contrib_test_0.yml @@ -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: diff --git a/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/core_contrib_test.yml.j2 b/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/core_contrib_test.yml.j2 index c8d2af59d..5fce8e1cf 100644 --- a/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/core_contrib_test.yml.j2 +++ b/.github/workflows/generate_workflows_lib/src/generate_workflows_lib/core_contrib_test.yml.j2 @@ -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 %} diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e482702..3e68eb2cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/tox.ini b/tox.ini index 2bf938d44..0ce7d20b7 100644 --- a/tox.ini +++ b/tox.ini @@ -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 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