Add API.md documenting all JS API endpoints#24
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
The instance API endpoint (/api/1.0/instance/) uses APIAuthentication which references config.api_keys, but this attribute was not defined in the config module, causing an AttributeError crash. JS usage: Not called directly from JavaScript in the project. The endpoint is used by external API consumers with API key auth. Curl test: curl http://127.0.0.1:8000/api/1.0/instance/?format=json&id=<oopsid> Before fix: 500 AttributeError: module 'errortracker.config' has no attribute 'api_keys' After fix: 401 Unauthorized (expected for unauthenticated requests)
…t response The is_valid_source_version() function in launchpad.py called .keys() on the return value of json_request(), which returns an empty string "" when the Launchpad API is unreachable. Calling .keys() on a string causes an AttributeError crash. JS usage: Not called directly from JavaScript. Used by external consumers to find new crash buckets between package versions. Curl test: curl 'http://127.0.0.1:8000/api/1.0/package-version-new-buckets/?format=json&package=pkg&previous_version=1.0&new_version=2.0' Before fix: 500 AttributeError: 'str' object has no attribute 'keys' After fix: 404 NotFound (expected when LP API is unreachable)
…rison The config.lp_use_staging is set to True (boolean) but was compared with "True" (string), which always evaluates to False. This caused all Launchpad API requests to use production URLs instead of staging URLs when staging was configured. This affects multiple API endpoints that query Launchpad: - binary-package-versions (JS: most_common_problems.js calls /api/1.0/binary-package-versions/) - most-common-problems (JS: most_common_problems.js calls /api/1.0/most-common-problems/) - versions (JS: bucket page uses /api/1.0/versions/) - reports-state (JS: most_common_problems.js POSTs to /api/1.0/reports-state/) - package-version-is-most-recent (JS: most_common_problems.js POSTs) - release-package-version-pockets (JS: most_common_problems.js POSTs) - package-rate-of-crashes - package-version-new-buckets - create-bug-report
Copilot
AI
changed the title
Fix broken API endpoints in the errors app
Fix three crashes in errors app API endpoints
May 26, 2026
Copilot
AI
changed the title
Fix three crashes in errors app API endpoints
Add API.md documenting all JS API endpoints
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents every REST API endpoint called from JavaScript (both
.jsfiles and inline<script>blocks in templates), listing the source location, calling function, HTTP method, and parameters.Endpoints covered (15 total)
most_common_problems.js—/api/1.0/most-common-problems/,/api/1.0/create-bug-report/,/api/1.0/package-version-is-most-recent/,/api/1.0/release-package-version-pockets/,/api/1.0/reports-state/,/api/1.0/binary-package-versions/,/api/1.0/system-image-versions/mean_time_between_failures.js—/api/1.0/average-crashes/retracers.js—/api/1.0/retracers-average-processing-time/,/api/1.0/retracers-results/,/api/1.0/instances-count/bucket.html—/api/1.0/average-instances/,/api/1.0/versions,/api/1.0/instances,/api/1.0/create-bug-report/user.html—/api/1.0/reports-for-system