uplift: add API endpoint to link revisions to assessments (Bug 2029072)#1064
Closed
cgsheeh wants to merge 7 commits intomozilla-conduit:mainfrom
Closed
uplift: add API endpoint to link revisions to assessments (Bug 2029072)#1064cgsheeh wants to merge 7 commits intomozilla-conduit:mainfrom
cgsheeh wants to merge 7 commits intomozilla-conduit:mainfrom
Conversation
Introduce a new Ninja API at POST /api/uplift/assessments/link that allows moz-phab to associate a Phabricator revision with an existing uplift assessment after a developer submits their revision. The endpoint creates or updates an `UpliftRevision` record and triggers a Celery task to push the uplift request form back to Phabricator. Authentication uses a new reusable `PhabricatorTokenAuth` class for Django Ninja, which delegates to the existing `PhabricatorTokenAuthenticationMiddleware` rather than re-implementing token verification. The `X-Phabricator-API-Key` header name is extracted into a shared constant in `lando.utils.phabricator` and adopted by the existing `phabricator_api_key_required` decorator in `api/views.py`.
|
View this pull request in Lando to land it once approved. |
shtrom
approved these changes
Apr 8, 2026
zzzeid
approved these changes
Apr 8, 2026
| details: str | ||
|
|
||
|
|
||
| class PhabricatorTokenAuth(APIKeyHeader): |
Contributor
There was a problem hiding this comment.
bug 2021423 may be relevant to this as well, out of scope for this PR though.
Member
Author
There was a problem hiding this comment.
This is what I pictured when I read "adapters" in that bug. Does this match your expectation as well? :)
|
Pull request closed by commit a75881f |
lando-worker bot
pushed a commit
that referenced
this pull request
Apr 8, 2026
…2) r=shtrom,zeid Introduce a new Ninja API at POST /api/uplift/assessments/link that allows moz-phab to associate a Phabricator revision with an existing uplift assessment after a developer submits their revision. The endpoint creates or updates an `UpliftRevision` record and triggers a Celery task to push the uplift request form back to Phabricator. Authentication uses a new reusable `PhabricatorTokenAuth` class for Django Ninja, which delegates to the existing `PhabricatorTokenAuthenticationMiddleware` rather than re-implementing token verification. The `X-Phabricator-API-Key` header name is extracted into a shared constant in `lando.utils.phabricator` and adopted by the existing `phabricator_api_key_required` decorator in `api/views.py`. Pull request: #1064
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.
Introduce a new Ninja API at POST /api/uplift/assessments/link that
allows moz-phab to associate a Phabricator revision with an existing
uplift assessment after a developer submits their revision. The endpoint
creates or updates an
UpliftRevisionrecord and triggers a Celery taskto push the uplift request form back to Phabricator.
Authentication uses a new reusable
PhabricatorTokenAuthclass forDjango Ninja, which delegates to the existing
PhabricatorTokenAuthenticationMiddlewarerather than re-implementingtoken verification. The
X-Phabricator-API-Keyheader name is extractedinto a shared constant in
lando.utils.phabricatorand adopted by theexisting
phabricator_api_key_requireddecorator inapi/views.py.