Skip to content

Commit f2c6757

Browse files
ci: use local contrib checkout to avoid git CDN SHA propagation failures (open-telemetry#4958)
* ci: use local contrib checkout to avoid git CDN SHA propagation failures Install contrib packages from the already-checked-out local copy instead of a second git+https:// clone for the getting-started and tracecontext tox envs. Eliminates intermittent install failures when a SHA has not yet propagated to all GitHub git CDN nodes. - tox.ini: add CONTRIB_REPO_* per-package env vars in setenv with fallbacks to the existing git+https:// behavior. getting-started and tracecontext deps now reference these vars. - test.yml.j2 / misc.yml.j2: add CONTRIB_REPO_* path vars to the top-level env block; add a contrib repo checkout step (actions/checkout) only for getting-started and tracecontext jobs. - Regenerate test_0.yml, test_1.yml, misc_0.yml. Backward compatible: when CONTRIB_REPO_* vars are unset (local dev), tox falls back to the git+https:// URL behavior. Mirrors the fix applied in the contrib repo: open-telemetry/opentelemetry-python-contrib#4305 Assisted-by: Claude Sonnet 4.6 * docs: add changelog entry for CI contrib SHA propagation fix (open-telemetry#4958) Assisted-by: Claude Sonnet 4.6 * Move longpaths git config before checkout steps on Windows The contrib repo checkout was failing on Windows with "Filename too long" because the longpaths config ran after the checkout. Move it to be the first step so both checkouts benefit from it. Assisted-by: Claude Sonnet 4.6
1 parent fb94553 commit f2c6757

File tree

7 files changed

+467
-482
lines changed

7 files changed

+467
-482
lines changed

.github/workflows/misc_0.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ env:
2929
'main'
3030
) || 'main' }}
3131
PIP_EXISTS_ACTION: w
32+
CONTRIB_REPO_UTIL_HTTP: ${{ github.workspace }}/opentelemetry-python-contrib/util/opentelemetry-util-http
33+
CONTRIB_REPO_INSTRUMENTATION: ${{ github.workspace }}/opentelemetry-python-contrib/opentelemetry-instrumentation
34+
CONTRIB_REPO_INSTRUMENTATION_REQUESTS: ${{ github.workspace }}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests
35+
CONTRIB_REPO_INSTRUMENTATION_WSGI: ${{ github.workspace }}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi
36+
CONTRIB_REPO_INSTRUMENTATION_FLASK: ${{ github.workspace }}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-flask
3237

3338
jobs:
3439

@@ -59,6 +64,13 @@ jobs:
5964
- name: Checkout repo @ SHA - ${{ github.sha }}
6065
uses: actions/checkout@v4
6166

67+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
68+
uses: actions/checkout@v4
69+
with:
70+
repository: open-telemetry/opentelemetry-python-contrib
71+
ref: ${{ env.CONTRIB_REPO_SHA }}
72+
path: opentelemetry-python-contrib
73+
6274
- name: Set up Python 3.11
6375
uses: actions/setup-python@v5
6476
with:

.github/workflows/templates/misc.yml.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ env:
2929
'main'
3030
) || 'main' }}{% endraw %}
3131
PIP_EXISTS_ACTION: w
32+
CONTRIB_REPO_UTIL_HTTP: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/util/opentelemetry-util-http
33+
CONTRIB_REPO_INSTRUMENTATION: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/opentelemetry-instrumentation
34+
CONTRIB_REPO_INSTRUMENTATION_REQUESTS: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests
35+
CONTRIB_REPO_INSTRUMENTATION_WSGI: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi
36+
CONTRIB_REPO_INSTRUMENTATION_FLASK: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-flask
3237

3338
jobs:
3439
{%- for job_data in job_datas %}
@@ -54,6 +59,15 @@ jobs:
5459
steps:
5560
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
5661
uses: actions/checkout@v4
62+
{%- if job_data == "tracecontext" %}
63+
64+
- name: Checkout contrib repo @ ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
65+
uses: actions/checkout@v4
66+
with:
67+
repository: open-telemetry/opentelemetry-python-contrib
68+
ref: ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
69+
path: opentelemetry-python-contrib
70+
{%- endif %}
5771
{%- if job_data == "public-symbols-check" %}
5872
with:
5973
fetch-depth: 0

.github/workflows/templates/test.yml.j2

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ env:
2929
'main'
3030
) || 'main' }}{% endraw %}
3131
PIP_EXISTS_ACTION: w
32+
CONTRIB_REPO_UTIL_HTTP: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/util/opentelemetry-util-http
33+
CONTRIB_REPO_INSTRUMENTATION: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/opentelemetry-instrumentation
34+
CONTRIB_REPO_INSTRUMENTATION_REQUESTS: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests
35+
CONTRIB_REPO_INSTRUMENTATION_WSGI: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi
36+
CONTRIB_REPO_INSTRUMENTATION_FLASK: ${% raw %}{{ github.workspace }}{% endraw %}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-flask
3237

3338
jobs:
3439
{%- for job_data in job_datas %}
@@ -38,8 +43,22 @@ jobs:
3843
runs-on: {{ job_data.os }}
3944
timeout-minutes: 30
4045
steps:
46+
{%- if job_data.os == "windows-latest" %}
47+
- name: Configure git to support long filenames
48+
run: git config --system core.longpaths true
49+
50+
{%- endif %}
4151
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
4252
uses: actions/checkout@v4
53+
{%- if "getting-started" in job_data.tox_env %}
54+
55+
- name: Checkout contrib repo @ ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
56+
uses: actions/checkout@v4
57+
with:
58+
repository: open-telemetry/opentelemetry-python-contrib
59+
ref: ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
60+
path: opentelemetry-python-contrib
61+
{%- endif %}
4362

4463
- name: Set up Python {{ job_data.python_version }}
4564
uses: actions/setup-python@v5
@@ -48,11 +67,6 @@ jobs:
4867

4968
- name: Install tox
5069
run: pip install tox-uv
51-
{%- if job_data.os == "windows-latest" %}
52-
53-
- name: Configure git to support long filenames
54-
run: git config --system core.longpaths true
55-
{%- endif %}
5670

5771
- name: Run tests
5872
run: tox -e {{ job_data.tox_env }} -- -ra

0 commit comments

Comments
 (0)