Problem/Motivation
As we are implementing the new contribution system, we are trying to retrieve information from the MRs related to an issue, whether this issue is from gitlab or from d.o. For gitlab issues, we can use the API provided for it, and for d.o we are leveraging the api-d7 endpoint.
The current implementation lacks the ability to bring MRs linked to the issue, and it shouldn't be too complex to add.
Steps to reproduce
Visit https://www.drupal.org/api-d7/node/3332546.json and see that there is no way to retrieve the MR for the issue.
Proposed resolution
When adding a get parameter to the request, like this: "?related_mrs=1", the related MRs are returned as part of the request.
Remaining tasks
Create MR.
User interface changes
None.
API changes
New parameter available when querying issues via the api-d7 endpoint.
Data model changes
None.
Issue fork drupalorg-3360762
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedReady to review: https://fjgarlin-drupal.dev.devdrupal.org/api-d7/node/3308679.json?relat...
MR: https://git.drupalcode.org/project/drupalorg/-/merge_requests/165
Comment #6
drummMerged!
Comment #7
dpiCurious why this wouldnt be provided in the response by default?
Isnt it a bit odd this feature is hidden behind a flag?
Comment #8
dpiAdded docs to https://www.drupal.org/drupalorg/docs/apis/rest-and-other-apis
Comment #9
fjgarlin CreditAttribution: fjgarlin as a volunteer and at Drupal Association commentedMostly for performance reasons. This feature is only used, as far as we know, by one of our subsystems, so we didn't want to add the extra performance hit of bringing that data if it isn't really needed.
Comment #10
drummAnd as we migrate Drupal.org past Drupal 7, and issues to GitLab, this API will become unavailable in the future, potentially abruptly. No new features are being added, except for when needed to help migration, which is this issue does. People using this API should not depend on it for anything critical.