Skip to content

Commit b8bae35

Browse files
iliakurdd-agent-integrations-bot[bot]claude
authored
Skip writing lockfiles for targets with no wheels (#23385)
* Skip writing lockfiles for targets with no wheels Targets whose upload produced no non-empty lockfile entries no longer produce a lockfile file. Previously an empty target wrote a lockfile containing only a blank line, which could be committed to .deps/resolved and leave the Agent pointing at an empty index. AI-6182 Signed-off-by: iliakur <ilia.kurenkov@datadoghq.com> * Update dependency resolution Signed-off-by: iliakur <ilia.kurenkov@datadoghq.com> * Remove stale lockfile when skipping empty target Addresses codex review: publish job runs `git add .deps/` after generating lockfiles, so a previously committed lockfile for a target that now produces no wheels would remain checked in. Unlink it before skipping so the stale pins are removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update dependency resolution --------- Signed-off-by: iliakur <ilia.kurenkov@datadoghq.com> Co-authored-by: dd-agent-integrations-bot[bot] <dd-agent-integrations-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 470b435 commit b8bae35

7 files changed

Lines changed: 103 additions & 73 deletions

File tree

.builders/tests/test_upload.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,32 @@ def test_lockfile_generation(tmp_path, setup_targets_dir, frozen_timestamp):
477477
assert len(lock_files) == 2
478478

479479

480+
def test_generate_lockfiles_skips_targets_with_no_wheels(tmp_path):
481+
"""An empty target (no wheels uploaded) should not produce a lockfile, and any existing stale lockfile should be removed."""
482+
lockfile = {
483+
'linux-x86_64': ['dep @ https://example.com/dep.whl#sha256=abc', ''],
484+
'windows-x86_64': [''],
485+
'macos-aarch64': [],
486+
}
487+
488+
fake_deps_dir = tmp_path / ".deps"
489+
fake_resolved_dir = fake_deps_dir / "resolved"
490+
fake_deps_dir.mkdir()
491+
fake_resolved_dir.mkdir()
492+
(tmp_path / "targets").mkdir()
493+
494+
stale_lockfile = fake_resolved_dir / f"windows-x86_64_{upload.CURRENT_PYTHON_VERSION}.txt"
495+
stale_lockfile.write_text("stale @ https://example.com/stale.whl#sha256=old\n", encoding="utf-8")
496+
497+
with mock.patch.object(upload, "RESOLUTION_DIR", fake_deps_dir), \
498+
mock.patch.object(upload, "LOCK_FILE_DIR", fake_resolved_dir):
499+
upload.generate_lockfiles(str(tmp_path / "targets"), lockfile)
500+
501+
lock_files = {f.name for f in fake_resolved_dir.glob("*.txt")}
502+
assert lock_files == {f"linux-x86_64_{upload.CURRENT_PYTHON_VERSION}.txt"}
503+
assert not stale_lockfile.exists()
504+
505+
480506
def test_generate_lockfiles_accepts_string_path(tmp_path):
481507

482508
lockfile = {'linux-x86_64': ['dep @ https://example.com/dep.whl#sha256=abc', '']}

.builders/upload.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ def generate_lockfiles(targets_dir, lockfiles):
293293
# The lockfiles contain the major.minor Python version
294294
# so that the Agent can transition safely
295295
lock_file = LOCK_FILE_DIR / f'{target_name}_{CURRENT_PYTHON_VERSION}.txt'
296+
if not any(line.strip() for line in lockfile_lines):
297+
print(f'Skipping lockfile for {target_name}: no wheels were uploaded.')
298+
lock_file.unlink(missing_ok=True)
299+
continue
296300
lock_file.write_text('\n'.join(lockfile_lines), encoding='utf-8')
297301

298302
# The `image_digest` and `inputs_sha256` files are written by the

.deps/resolved/linux-aarch64_3.13.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
aerospike @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/aerospike/aerospike-7.1.1-20260418125217-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=a1de7c7019b1dd5363cdd1a838ba92185418a114be9b59f902e8aef66326c4ea
2-
botocore @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/botocore/botocore-1.42.72-20260420123342-py3-none-any.whl#sha256=f1933a8ca6c1108ed23f7b01f82577327fc254e330025887fdd4ba17db03e8e2
2+
botocore @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/botocore/botocore-1.42.72-20260421082705-py3-none-any.whl#sha256=f1933a8ca6c1108ed23f7b01f82577327fc254e330025887fdd4ba17db03e8e2
33
cm-client @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/cm-client/cm_client-45.0.4-20260326173357-py3-none-manylinux2014_aarch64.whl#sha256=0bbcf2766028850c26a917deef3704a096cc9ba0c25220d45ff424334d25dcd7
4-
confluent-kafka @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/confluent-kafka/confluent_kafka-2.13.2-20260420124718-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=1d68f453308b86d7234cb8bd9c46942e63f7a456dc8c392e98ebcf43ce2e2cbb
5-
cryptography @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/cryptography/cryptography-46.0.6-20260420124721-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=32260110ead1ea0dadf90f9b76c6756d1060c67385fff3e8f0c607ee28e0d3ba
4+
confluent-kafka @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/confluent-kafka/confluent_kafka-2.13.2-20260421095908-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=65e0d489118fa94ca54abea65610fa3f5d116c67fd84bc5561f741adade2b40a
5+
cryptography @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/cryptography/cryptography-46.0.6-20260421095911-cp313-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=e3b8dc89254638fe20fda837433092b2b4f89e1a683710f9d05a4419dfbf39f7
66
ddtrace @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/ddtrace/ddtrace-3.19.5-20260417115249-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl#sha256=a4f8d07adccdd43908156ab2c143dbb6261ed9a3c43ba58a3bb6bd1b6ef94734
77
foundationdb @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/foundationdb/foundationdb-6.3.25-20260326173358-py3-none-manylinux2014_aarch64.whl#sha256=d34180500220db4458e57505c774de0363456d4129f0e3fe98c9e99e8eef77c2
88
gssapi @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/gssapi/gssapi-1.11.1-20260420112228-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=95e5e8521bb191907748a7360ffd025398aa861cb47014c551384380d52be412
9-
keystoneauth1 @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/keystoneauth1/keystoneauth1-5.13.1-20260420123239-py3-none-any.whl#sha256=a15092187950de965ff6096e203d31e461c61cfd47ec1f5249a0e2955187cba2
9+
keystoneauth1 @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/keystoneauth1/keystoneauth1-5.13.1-20260421083930-py3-none-any.whl#sha256=a15092187950de965ff6096e203d31e461c61cfd47ec1f5249a0e2955187cba2
1010
krb5 @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/krb5/krb5-0.9.0-20260420112240-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=9700f818130cf996f844203d60c9e41b95700a90916c9ef39b008166ba6c9f71
11-
openstacksdk @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/openstacksdk/openstacksdk-4.10.0-20260420123407-py3-none-any.whl#sha256=88abe8f44e3b8c5c25b1093de735c700aa727a7ac408e273aa855d6db6ba38bf
12-
os-service-types @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/os-service-types/os_service_types-1.8.2-20260420123254-py3-none-any.whl#sha256=758ccaa020eea0edd84bcf4123746ddd060d1dbaeef63d04d76bd2e0ae6f91d8
13-
pbr @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pbr/pbr-7.0.3-20260420123308-py2.py3-none-any.whl#sha256=1544652b80307f0b4c491bd66f58f969cb0656994e632365f90e8e044c223b4e
11+
openstacksdk @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/openstacksdk/openstacksdk-4.10.0-20260421083943-py3-none-any.whl#sha256=88abe8f44e3b8c5c25b1093de735c700aa727a7ac408e273aa855d6db6ba38bf
12+
os-service-types @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/os-service-types/os_service_types-1.8.2-20260421083957-py3-none-any.whl#sha256=758ccaa020eea0edd84bcf4123746ddd060d1dbaeef63d04d76bd2e0ae6f91d8
13+
pbr @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pbr/pbr-7.0.3-20260421084012-py2.py3-none-any.whl#sha256=1544652b80307f0b4c491bd66f58f969cb0656994e632365f90e8e044c223b4e
1414
psutil @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/psutil/psutil-6.0.0-20260326173401-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=22e075e3cbc57b5da0d93f72f691746c5198ce88c5aea6fdb54186b3e8c46832
1515
psycopg-c @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/psycopg-c/psycopg_c-3.3.3-20260418125308-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=e9a6db500356a67b07cf971b394b92445797d608578961cd2c931ec1d61567b9
1616
pymongo @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pymongo/pymongo-4.8.0-20260415154515-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=30d8af4ef8fda85d1a865bdb254e6b2e3988f26b723eb39a4843c766371ff517
1717
pyodbc @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pyodbc/pyodbc-5.3.0-20260415154516-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=91a4191cf30930755d82e8edd6ac861443dfb6fbbf7915753b73209038ad5ad2
18-
pysnmp-mibs @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pysnmp-mibs/pysnmp_mibs-0.1.6-20260420123322-py2.py3-none-any.whl#sha256=0cc4610711208cdc64361464a23d1f2dce88ec5990a12b4bdce4f13b6a169810
18+
pysnmp-mibs @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pysnmp-mibs/pysnmp_mibs-0.1.6-20260421084027-py2.py3-none-any.whl#sha256=0cc4610711208cdc64361464a23d1f2dce88ec5990a12b4bdce4f13b6a169810
1919
pyvmomi @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/pyvmomi/pyvmomi-8.0.3.0.1-20260326173403-py2.py3-none-manylinux2014_aarch64.whl#sha256=dd71476b7308286ed4219373ca9523e4f06bfed3f5932f60e5c67d8d5a673e1e
20-
requests-unixsocket2 @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/requests-unixsocket2/requests_unixsocket2-1.0.1-20260420123336-py3-none-any.whl#sha256=aae3f1743ab60955ea91e9a095d54997ea56b956bab652bf194379ef4dc6fa7f
21-
securesystemslib @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/securesystemslib/securesystemslib-0.28.0-20260420123349-py3-none-any.whl#sha256=861ab6f8c1930e0c05915f32a34f1c4ae1d76ee542ad2b424121e3e26a9fb1dd
22-
setuptools @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/setuptools/setuptools-82.0.1-20260420123403-py3-none-any.whl#sha256=b020c62c9ea6c1c3e7a29a8e385967909ceb85a77398f7fbe3c63e2abab52e87
20+
requests-unixsocket2 @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/requests-unixsocket2/requests_unixsocket2-1.0.1-20260421084042-py3-none-any.whl#sha256=aae3f1743ab60955ea91e9a095d54997ea56b956bab652bf194379ef4dc6fa7f
21+
securesystemslib @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/securesystemslib/securesystemslib-0.28.0-20260421084056-py3-none-any.whl#sha256=861ab6f8c1930e0c05915f32a34f1c4ae1d76ee542ad2b424121e3e26a9fb1dd
22+
setuptools @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/setuptools/setuptools-82.0.1-20260421084111-py3-none-any.whl#sha256=b020c62c9ea6c1c3e7a29a8e385967909ceb85a77398f7fbe3c63e2abab52e87
2323
simplejson @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/simplejson/simplejson-3.20.2-20260326173404-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=cb739020a718c2e32041a0fa0a3f79398f45c067347fe8f286c8222fa777bc5d
24-
stevedore @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/stevedore/stevedore-5.7.0-20260420123417-py3-none-any.whl#sha256=0cf2a7cb9c915eddc77a591df48e8ab78f93167e8ac77d0efb04eb375f91d8b2
25-
supervisor @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/supervisor/supervisor-4.3.0-20260420123430-py2.py3-none-any.whl#sha256=81d63e968a5133203a334102b8e6e72b1f5ecfc9673c1af7680f9f7e0db8d4fd
26-
vertica-python @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/vertica-python/vertica_python-1.4.0-20260420123444-py3-none-any.whl#sha256=df8d667b7bd070532a72c25f37e7259d3673c1908ae726fdfb3087d777caa9da
27-
websocket-client @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/websocket-client/websocket_client-1.9.0-20260420123458-py3-none-any.whl#sha256=b628876a9b1eed1d49f1a230bf4b1c21fa3cd9163594f9f9628c8a8b22f97e10
24+
stevedore @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/stevedore/stevedore-5.7.0-20260421084126-py3-none-any.whl#sha256=0cf2a7cb9c915eddc77a591df48e8ab78f93167e8ac77d0efb04eb375f91d8b2
25+
supervisor @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/supervisor/supervisor-4.3.0-20260421084140-py2.py3-none-any.whl#sha256=81d63e968a5133203a334102b8e6e72b1f5ecfc9673c1af7680f9f7e0db8d4fd
26+
vertica-python @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/vertica-python/vertica_python-1.4.0-20260421084155-py3-none-any.whl#sha256=df8d667b7bd070532a72c25f37e7259d3673c1908ae726fdfb3087d777caa9da
27+
websocket-client @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/built/websocket-client/websocket_client-1.9.0-20260421084209-py3-none-any.whl#sha256=b628876a9b1eed1d49f1a230bf4b1c21fa3cd9163594f9f9628c8a8b22f97e10
2828
annotated-types @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/external/annotated-types/annotated_types-0.7.0-py3-none-any.whl#sha256=1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53
2929
attrs @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/external/attrs/attrs-26.1.0-py3-none-any.whl#sha256=c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309
3030
aws-msk-iam-sasl-signer-python @ https://agent-int-packages.datadoghq.com/${INTEGRATIONS_WHEELS_STORAGE}/external/aws-msk-iam-sasl-signer-python/aws_msk_iam_sasl_signer_python-1.0.2-py2.py3-none-any.whl#sha256=310eb2db9ca0ff55ed06a24212739b87533e7f1cf6f34e43aabbd97a3b21290e

0 commit comments

Comments
 (0)