Skip to content

Commit dece189

Browse files
committed
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
1 parent fb94553 commit dece189

File tree

6 files changed

+148
-9
lines changed

6 files changed

+148
-9
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: 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 %}
@@ -40,6 +45,15 @@ jobs:
4045
steps:
4146
- name: Checkout repo @ SHA - ${% raw %}{{ github.sha }}{% endraw %}
4247
uses: actions/checkout@v4
48+
{%- if "getting-started" in job_data.tox_env %}
49+
50+
- name: Checkout contrib repo @ ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
51+
uses: actions/checkout@v4
52+
with:
53+
repository: open-telemetry/opentelemetry-python-contrib
54+
ref: ${% raw %}{{ env.CONTRIB_REPO_SHA }}{% endraw %}
55+
path: opentelemetry-python-contrib
56+
{%- endif %}
4357

4458
- name: Set up Python {{ job_data.python_version }}
4559
uses: actions/setup-python@v5

.github/workflows/test_0.yml

Lines changed: 89 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

@@ -800,6 +805,13 @@ jobs:
800805
- name: Checkout repo @ SHA - ${{ github.sha }}
801806
uses: actions/checkout@v4
802807

808+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
809+
uses: actions/checkout@v4
810+
with:
811+
repository: open-telemetry/opentelemetry-python-contrib
812+
ref: ${{ env.CONTRIB_REPO_SHA }}
813+
path: opentelemetry-python-contrib
814+
803815
- name: Set up Python 3.9
804816
uses: actions/setup-python@v5
805817
with:
@@ -819,6 +831,13 @@ jobs:
819831
- name: Checkout repo @ SHA - ${{ github.sha }}
820832
uses: actions/checkout@v4
821833

834+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
835+
uses: actions/checkout@v4
836+
with:
837+
repository: open-telemetry/opentelemetry-python-contrib
838+
ref: ${{ env.CONTRIB_REPO_SHA }}
839+
path: opentelemetry-python-contrib
840+
822841
- name: Set up Python 3.10
823842
uses: actions/setup-python@v5
824843
with:
@@ -838,6 +857,13 @@ jobs:
838857
- name: Checkout repo @ SHA - ${{ github.sha }}
839858
uses: actions/checkout@v4
840859

860+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
861+
uses: actions/checkout@v4
862+
with:
863+
repository: open-telemetry/opentelemetry-python-contrib
864+
ref: ${{ env.CONTRIB_REPO_SHA }}
865+
path: opentelemetry-python-contrib
866+
841867
- name: Set up Python 3.11
842868
uses: actions/setup-python@v5
843869
with:
@@ -857,6 +883,13 @@ jobs:
857883
- name: Checkout repo @ SHA - ${{ github.sha }}
858884
uses: actions/checkout@v4
859885

886+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
887+
uses: actions/checkout@v4
888+
with:
889+
repository: open-telemetry/opentelemetry-python-contrib
890+
ref: ${{ env.CONTRIB_REPO_SHA }}
891+
path: opentelemetry-python-contrib
892+
860893
- name: Set up Python 3.12
861894
uses: actions/setup-python@v5
862895
with:
@@ -876,6 +909,13 @@ jobs:
876909
- name: Checkout repo @ SHA - ${{ github.sha }}
877910
uses: actions/checkout@v4
878911

912+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
913+
uses: actions/checkout@v4
914+
with:
915+
repository: open-telemetry/opentelemetry-python-contrib
916+
ref: ${{ env.CONTRIB_REPO_SHA }}
917+
path: opentelemetry-python-contrib
918+
879919
- name: Set up Python 3.13
880920
uses: actions/setup-python@v5
881921
with:
@@ -895,6 +935,13 @@ jobs:
895935
- name: Checkout repo @ SHA - ${{ github.sha }}
896936
uses: actions/checkout@v4
897937

938+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
939+
uses: actions/checkout@v4
940+
with:
941+
repository: open-telemetry/opentelemetry-python-contrib
942+
ref: ${{ env.CONTRIB_REPO_SHA }}
943+
path: opentelemetry-python-contrib
944+
898945
- name: Set up Python 3.14
899946
uses: actions/setup-python@v5
900947
with:
@@ -3884,6 +3931,13 @@ jobs:
38843931
- name: Checkout repo @ SHA - ${{ github.sha }}
38853932
uses: actions/checkout@v4
38863933

3934+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
3935+
uses: actions/checkout@v4
3936+
with:
3937+
repository: open-telemetry/opentelemetry-python-contrib
3938+
ref: ${{ env.CONTRIB_REPO_SHA }}
3939+
path: opentelemetry-python-contrib
3940+
38873941
- name: Set up Python 3.9
38883942
uses: actions/setup-python@v5
38893943
with:
@@ -3906,6 +3960,13 @@ jobs:
39063960
- name: Checkout repo @ SHA - ${{ github.sha }}
39073961
uses: actions/checkout@v4
39083962

3963+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
3964+
uses: actions/checkout@v4
3965+
with:
3966+
repository: open-telemetry/opentelemetry-python-contrib
3967+
ref: ${{ env.CONTRIB_REPO_SHA }}
3968+
path: opentelemetry-python-contrib
3969+
39093970
- name: Set up Python 3.10
39103971
uses: actions/setup-python@v5
39113972
with:
@@ -3928,6 +3989,13 @@ jobs:
39283989
- name: Checkout repo @ SHA - ${{ github.sha }}
39293990
uses: actions/checkout@v4
39303991

3992+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
3993+
uses: actions/checkout@v4
3994+
with:
3995+
repository: open-telemetry/opentelemetry-python-contrib
3996+
ref: ${{ env.CONTRIB_REPO_SHA }}
3997+
path: opentelemetry-python-contrib
3998+
39313999
- name: Set up Python 3.11
39324000
uses: actions/setup-python@v5
39334001
with:
@@ -3950,6 +4018,13 @@ jobs:
39504018
- name: Checkout repo @ SHA - ${{ github.sha }}
39514019
uses: actions/checkout@v4
39524020

4021+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
4022+
uses: actions/checkout@v4
4023+
with:
4024+
repository: open-telemetry/opentelemetry-python-contrib
4025+
ref: ${{ env.CONTRIB_REPO_SHA }}
4026+
path: opentelemetry-python-contrib
4027+
39534028
- name: Set up Python 3.12
39544029
uses: actions/setup-python@v5
39554030
with:
@@ -3972,6 +4047,13 @@ jobs:
39724047
- name: Checkout repo @ SHA - ${{ github.sha }}
39734048
uses: actions/checkout@v4
39744049

4050+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
4051+
uses: actions/checkout@v4
4052+
with:
4053+
repository: open-telemetry/opentelemetry-python-contrib
4054+
ref: ${{ env.CONTRIB_REPO_SHA }}
4055+
path: opentelemetry-python-contrib
4056+
39754057
- name: Set up Python 3.13
39764058
uses: actions/setup-python@v5
39774059
with:
@@ -3994,6 +4076,13 @@ jobs:
39944076
- name: Checkout repo @ SHA - ${{ github.sha }}
39954077
uses: actions/checkout@v4
39964078

4079+
- name: Checkout contrib repo @ ${{ env.CONTRIB_REPO_SHA }}
4080+
uses: actions/checkout@v4
4081+
with:
4082+
repository: open-telemetry/opentelemetry-python-contrib
4083+
ref: ${{ env.CONTRIB_REPO_SHA }}
4084+
path: opentelemetry-python-contrib
4085+
39974086
- name: Set up Python 3.14
39984087
uses: actions/setup-python@v5
39994088
with:

.github/workflows/test_1.yml

Lines changed: 5 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

tox.ini

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ deps =
147147

148148

149149
getting-started: -r {toxinidir}/docs/getting_started/tests/requirements.txt
150-
getting-started: {env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http
151-
getting-started: {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation
152-
getting-started: {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests
153-
getting-started: {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi
154-
getting-started: {env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-flask&subdirectory=instrumentation/opentelemetry-instrumentation-flask
150+
getting-started: {env:CONTRIB_REPO_UTIL_HTTP}
151+
getting-started: {env:CONTRIB_REPO_INSTRUMENTATION}
152+
getting-started: {env:CONTRIB_REPO_INSTRUMENTATION_REQUESTS}
153+
getting-started: {env:CONTRIB_REPO_INSTRUMENTATION_WSGI}
154+
getting-started: {env:CONTRIB_REPO_INSTRUMENTATION_FLASK}
155155

156156
allowlist_externals = sh
157157

@@ -160,6 +160,11 @@ setenv =
160160
; i.e: CONTRIB_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
161161
CONTRIB_REPO_SHA={env:CONTRIB_REPO_SHA:main}
162162
CONTRIB_REPO=git+https://github.com/open-telemetry/opentelemetry-python-contrib.git@{env:CONTRIB_REPO_SHA}
163+
CONTRIB_REPO_UTIL_HTTP={env:CONTRIB_REPO_UTIL_HTTP:{env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http}
164+
CONTRIB_REPO_INSTRUMENTATION={env:CONTRIB_REPO_INSTRUMENTATION:{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation}
165+
CONTRIB_REPO_INSTRUMENTATION_REQUESTS={env:CONTRIB_REPO_INSTRUMENTATION_REQUESTS:{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests}
166+
CONTRIB_REPO_INSTRUMENTATION_WSGI={env:CONTRIB_REPO_INSTRUMENTATION_WSGI:{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi}
167+
CONTRIB_REPO_INSTRUMENTATION_FLASK={env:CONTRIB_REPO_INSTRUMENTATION_FLASK:{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-flask&subdirectory=instrumentation/opentelemetry-instrumentation-flask}
163168
UV_CONFIG_FILE={toxinidir}/tox-uv.toml
164169
commands_pre =
165170
; In order to get a healthy coverage report,
@@ -265,10 +270,10 @@ deps =
265270
-e {toxinidir}/opentelemetry-api
266271
-e {toxinidir}/opentelemetry-semantic-conventions
267272
-e {toxinidir}/opentelemetry-sdk
268-
{env:CONTRIB_REPO}\#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http
269-
{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation
270-
{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests
271-
{env:CONTRIB_REPO}\#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi
273+
{env:CONTRIB_REPO_UTIL_HTTP}
274+
{env:CONTRIB_REPO_INSTRUMENTATION}
275+
{env:CONTRIB_REPO_INSTRUMENTATION_REQUESTS}
276+
{env:CONTRIB_REPO_INSTRUMENTATION_WSGI}
272277

273278
allowlist_externals =
274279
{toxinidir}/scripts/tracecontext-integration-test.sh

0 commit comments

Comments
 (0)