Upstream 16230 - remove artifacts from list endpoint#248
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the artifacts field from the UnifiedJobListSerializer (and all its subclasses via inheritance) to avoid serving potentially large payload data that is unnecessary at the jobs list endpoint. The artifacts field remains available in the detail view serializers (e.g., JobSerializer/JobDetailSerializer).
Changes:
artifactsis excluded from the list serializer'sMeta.fieldsand theget_field_namesfilter tuple.- The unit test for detail-only fields is updated to include
artifactsin the set of fields allowed to be exclusive to the detail view.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
awx/api/serializers.py |
Adds '-artifacts' to UnifiedJobListSerializer.Meta.fields and 'artifacts' to the exclusion tuple in get_field_names, removing the field from all list endpoints. |
awx/main/tests/unit/api/serializers/test_unified_serializers.py |
Adds 'artifacts' to allowed_detail_fields so the test correctly permits the field being in detail serializers but not list serializers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Just for the next person looking at this, if you used awx.awx.job_list to receive artifacts for jobs; it no longer works after this change. I am guessing the proper way to do it now is |
|
We can add it back in if you think its useful. It is kinda a pain that there is no job_info module. |
|
I think one of the next steps could be an ascender collection and adding a job_info module - I'll help where I can :)
|
Removes the artifacts field from the unifiedjob list endpoint because this field can contain a large amount of data which is not needed in the jobs list.