Skip to content

Conversation

@zsol
Copy link

@zsol zsol commented Nov 24, 2025

This PR extends the installer.subcommand field of the user agent struct, and then logs its value by serializing it using shlex.join() as explained in #233.

Test plan

The functional tests in test_functions.py were changed to expect a subcommand field to be logged, and now the coverage includes:

  • no subcommand field
  • subcommand field with a single value
  • subcommand field with multiple values
  • subcommand field with multiple values, one of them containing spaces (to be escaped by the implementation)
Changes to the downloads fixture
--- downloads-before	2025-11-24 12:09:45
+++ downloads-after	2025-11-24 12:09:34
@@ -1,4 +1,5 @@
 download|Thu, 07 Jan 2021 20:54:54 GMT|US|/packages/f7/12/ec3f2e203afa394a149911729357aa48affc59c20e2c1c8297a60f33f133/threadpoolctl-2.1.0-py3-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|threadpoolctl|2.1.0|bdist_wheel|pip/20.1.1 {"ci":null,"cpu":"x86_64","distro":{"id":"stretch","libc":{"lib":"glibc","version":"2.24"},"name":"Debian GNU/Linux","version":"9"},"implementation":{"name":"CPython","version":"3.7.9"},"installer":{"name":"pip","version":"20.1.1"},"openssl_version":"OpenSSL 1.1.0l  10 Sep 2019","python":"3.7.9","setuptools_version":"47.1.0","system":{"name":"Linux","release":"4.15.0-112-generic"}}
-download|Thu, 07 Jan 2021 20:54:54 GMT|US|/packages/cd/f9/8fad70a3bd011a6be7c5c6067278f006a25341eb39d901fbda307e26804c/django_crum-0.7.9-py2.py3-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|django-crum|0.7.9|bdist_wheel|pip/20.0.2 {"ci":null,"cpu":"x86_64","distro":{"id":"xenial","libc":{"lib":"glibc","version":"2.23"},"name":"Ubuntu","version":"16.04"},"implementation":{"name":"CPython","version":"3.8.5"},"installer":{"name":"pip","version":"20.0.2"},"openssl_version":"OpenSSL 1.0.2g  1 Mar 2016","python":"3.8.5","setuptools_version":"44.1.0","system":{"name":"Linux","release":"4.4.0-1113-aws"}}
+download|Thu, 07 Jan 2021 20:54:54 GMT|US|/packages/cd/f9/8fad70a3bd011a6be7c5c6067278f006a25341eb39d901fbda307e26804c/django_crum-0.7.9-py2.py3-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|django-crum|0.7.9|bdist_wheel|pip/20.0.2 {"ci":null,"cpu":"x86_64","distro":{"id":"xenial","libc":{"lib":"glibc","version":"2.23"},"name":"Ubuntu","version":"16.04"},"implementation":{"name":"CPython","version":"3.8.5"},"installer":{"name":"pip","version":"20.0.2","subcommand":[]},"openssl_version":"OpenSSL 1.0.2g  1 Mar 2016","python":"3.8.5","setuptools_version":"44.1.0","system":{"name":"Linux","release":"4.4.0-1113-aws"}}
 download|Thu, 07 Jan 2021 20:54:56 GMT|US|/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|enum34|1.1.6|bdist_wheel|(null)
-download|Thu, 07 Jan 2021 20:54:54 GMT|US|/packages/cd/f9/8fad70a3bd011a6be7c5c6067278f006a25341eb39d901fbda307e26804c/django_crum-0.7.9-py2.py3-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|django-crum|0.7.9|bdist_wheel|pip/22.0.3 {"ci":true,"cpu":"arm64","distro":{"name":"macOS","version":"12.3"},"implementation":{"name":"CPython","version":"3.9.10"},"installer":{"name":"pip","version":"22.0.3"},"openssl_version":"OpenSSL 1.1.1m  14 Dec 2021","python":"3.9.10","rustc_version":"1.59.0","setuptools_version":"60.9.0","system":{"name":"Darwin","release":"21.4.0"}}
+download|Thu, 07 Jan 2021 20:54:54 GMT|US|/packages/cd/f9/8fad70a3bd011a6be7c5c6067278f006a25341eb39d901fbda307e26804c/django_crum-0.7.9-py2.py3-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|django-crum|0.7.9|bdist_wheel|pip/22.0.3 {"ci":true,"cpu":"arm64","distro":{"name":"macOS","version":"12.3"},"implementation":{"name":"CPython","version":"3.9.10"},"installer":{"name":"pip","version":"22.0.3","subcommand":["install","something with a space"]},"openssl_version":"OpenSSL 1.1.1m  14 Dec 2021","python":"3.9.10","rustc_version":"1.59.0","setuptools_version":"60.9.0","system":{"name":"Darwin","release":"21.4.0"}}
+download|Thu, 07 Jan 2021 20:54:54 GMT|US|/packages/cd/f9/8fad70a3bd011a6be7c5c6067278f006a25341eb39d901fbda307e26804c/django_crum-0.7.9-py2.py3-none-any.whl|TLSv1.2|ECDHE-RSA-AES128-GCM-SHA256|django-crum|0.7.9|bdist_wheel|pip/22.0.3 {"ci":true,"cpu":"arm64","distro":{"name":"macOS","version":"12.3"},"implementation":{"name":"CPython","version":"3.9.10"},"installer":{"name":"uv","version":"0.9.11","subcommand":["pip","install"]},"openssl_version":"OpenSSL 1.1.1m  14 Dec 2021","python":"3.9.10","rustc_version":"1.59.0","setuptools_version":"60.9.0","system":{"name":"Darwin","release":"21.4.0"}}

@zsol zsol marked this pull request as ready for review November 24, 2025 13:14
Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we will need to wait for the schema migration though.

@zsol
Copy link
Author

zsol commented Nov 24, 2025

Will ingestion fail for unknown fields?

@di
Copy link
Member

di commented Nov 25, 2025

Looks like no, actually:

job_config.ignore_unknown_values = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants