Skip to content

Conversation

@moijes12
Copy link
Contributor

@moijes12 moijes12 commented Jan 5, 2026

This PR resolves a 500 error encountered when accessing the /docs/ and /api/schema/ endpoints. The issue was caused by incompatibilities between django-filter and djangorestframework's schema generation, as well as missing attributes in specific API views.

  • Add TreeherderFilterBackend to implement missing get_schema_operation_parameters method in DjangoFilterBackend.
  • Update DEFAULT_FILTER_BACKENDS and performance_data.py viewsets to use the new custom backend.
  • Change PerformanceJobViewSet to inherit from ViewSet to avoid serializer_class assertion errors.
  • Fix AttributeError in PerfCompareResults.get_serializer_class when request is None during schema generation.
  • Rename typos in DetailsPanel.jsx and PerformanceJobViewSet for consistency.

@jmaher @gmierz

Fixes Bug 1928549

This fixes the 500 error preventing the API documentation from loading
by doing the below:
* Add `TreeherderFilterBackend` to implement missing `get_schema_operation_parameters` method in `DjangoFilterBackend`.
* Update `DEFAULT_FILTER_BACKENDS` and `performance_data.py` viewsets to use the new custom backend.
* Change `PerformanceJobViewSet` to inherit from ViewSet to avoid `serializer_class` assertion errors.
* Fix `AttributeError` in `PerfCompareResults.get_serializer_class` when request is `None` during schema generation.
* Rename typos in DetailsPanel.jsx and PerformanceJobViewSet for consistency.

Fixes Bug 1998273
@moijes12 moijes12 changed the title Bug 1998273: Fix API schema generation and 500 error on docs page Bug 1928549: Fix API schema generation and 500 error on docs page Jan 5, 2026
@moijes12
Copy link
Contributor Author

moijes12 commented Jan 6, 2026

@bhearsum Please can you review this if you get some time

@bhearsum
Copy link
Collaborator

bhearsum commented Jan 6, 2026

I'm not actually a reviewer for Treeherder.... @Archaeopteryx ?

@moijes12
Copy link
Contributor Author

moijes12 commented Jan 6, 2026

No problem. Thanks @bhearsum

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