Add support for fetching merge requests via RSS / Atom
What does this MR do?
This MR adds support for retrieving the merge requests of a project via RSS / Atom similar to the existing feed for issues (#29521 (closed)).
Consequently, the implementation is very symmetrical to the implementation for the issues feed, with some refactorings made especially for the views and test code to reduce duplication.
Screenshots or Screencasts (strongly suggested)
This MR adds a "Subscribe to RSS feed" button to the merge requests overview page, as already seen for the issues or some other page (user profile, etc.):
Clicking on the button will output this feed:
Feed, as shown in the screenshot
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
<title>Flight merge requests</title>
<link href="/flightjs/flight/-/merge_requests.atom?feed_token=My6U5g3wcbyipAgKnV22&state=opened" rel="self" type="application/atom+xml"/>
<link href="https://gdk.localhost:3443/flightjs/flight/-/merge_requests" rel="alternate" type="text/html"/>
<id>https://gdk.localhost:3443/flightjs/flight/-/merge_requests</id>
<updated>2020-08-04T10:40:07Z</updated>
<entry>
<id>https://gdk.localhost:3443/flightjs/flight/-/merge_requests/4</id>
<link href="https://gdk.localhost:3443/flightjs/flight/-/merge_requests/4"/>
<title>Reiciendis perferendis nihil recusandae optio quo ducimus consequatur iure.</title>
<updated>2020-08-04T10:40:07Z</updated>
<media:thumbnail width="40" height="40" url="https://secure.gravatar.com/avatar/84b7f093d7ceace4beb347fdb39b95c4?s=80&d=identicon"/>
<author>
<name>Curt Raynor</name>
<email></email>
</author>
<summary>Reiciendis perferendis nihil recusandae optio quo ducimus consequatur iure.</summary>
<description>Provident vel omnis aut neque corrupti saepe necessitatibus. Architecto omnis accusantium expedita quis non dignissimos. Qui accusamus qui minima excepturi.</description>
<content>Provident vel omnis aut neque corrupti saepe necessitatibus. Architecto omnis accusantium expedita quis non dignissimos. Qui accusamus qui minima excepturi.</content>
<milestone>v3.0</milestone>
<labels>
<label>Cafunc</label>
<label>Corolla Wagon</label>
<label>Envoy</label>
<label>Phant</label>
<label>Probe</label>
<label>Sircell</label>
</labels>
<assignees>
<assignee>
<name>Roxanna Leuschke</name>
<email></email>
</assignee>
</assignees>
<assignee>
<name>Roxanna Leuschke</name>
<email></email>
</assignee>
</entry>
<entry>
<id>https://gdk.localhost:3443/flightjs/flight/-/merge_requests/3</id>
<link href="https://gdk.localhost:3443/flightjs/flight/-/merge_requests/3"/>
<title>Doloribus iste aut eos et sed nam necessitatibus harum dolorum.</title>
<updated>2020-08-04T10:40:35Z</updated>
<media:thumbnail width="40" height="40" url="https://secure.gravatar.com/avatar/84b7f093d7ceace4beb347fdb39b95c4?s=80&d=identicon"/>
<author>
<name>Curt Raynor</name>
<email></email>
</author>
<summary>Doloribus iste aut eos et sed nam necessitatibus harum dolorum.</summary>
<description>Nihil consequatur reprehenderit natus autem assumenda cupiditate omnis. Eius quis earum vel non impedit. Non eaque ut aut nisi dolorum.</description>
<content>Nihil consequatur reprehenderit natus autem assumenda cupiditate omnis. Eius quis earum vel non impedit. Non eaque ut aut nisi dolorum.</content>
<milestone>v3.0</milestone>
<labels>
<label>Cafunc</label>
<label>Envoy</label>
<label>Phaph</label>
<label>Probe</label>
<label>Sable</label>
<label>Sircell</label>
</labels>
<assignees>
<assignee>
<name>Fidela Ankunding</name>
<email></email>
</assignee>
</assignees>
<assignee>
<name>Fidela Ankunding</name>
<email></email>
</assignee>
</entry>
<entry>
<id>https://gdk.localhost:3443/flightjs/flight/-/merge_requests/2</id>
<link href="https://gdk.localhost:3443/flightjs/flight/-/merge_requests/2"/>
<title>Vero expedita error numquam aliquid rerum saepe.</title>
<updated>2020-08-04T10:40:35Z</updated>
<media:thumbnail width="40" height="40" url="https://secure.gravatar.com/avatar/84b7f093d7ceace4beb347fdb39b95c4?s=80&d=identicon"/>
<author>
<name>Curt Raynor</name>
<email></email>
</author>
<summary>Vero expedita error numquam aliquid rerum saepe.</summary>
<description>Ut deserunt et at laboriosam. Ut quis doloribus consequatur fuga ut voluptas amet. Sunt reprehenderit ipsam quia atque.</description>
<content>Ut deserunt et at laboriosam. Ut quis doloribus consequatur fuga ut voluptas amet. Sunt reprehenderit ipsam quia atque.</content>
<milestone>v3.0</milestone>
<labels>
<label>Broust</label>
<label>Bruckforge</label>
<label>Corolla Wagon</label>
<label>Phaph</label>
<label>Probe</label>
<label>Sable</label>
</labels>
<assignees>
<assignee>
<name>Administrator</name>
<email></email>
</assignee>
</assignees>
<assignee>
<name>Administrator</name>
<email></email>
</assignee>
</entry>
<entry>
<id>https://gdk.localhost:3443/flightjs/flight/-/merge_requests/1</id>
<link href="https://gdk.localhost:3443/flightjs/flight/-/merge_requests/1"/>
<title>Error dolores vel voluptatem reprehenderit quam rerum sint sed.</title>
<updated>2020-08-04T10:40:35Z</updated>
<media:thumbnail width="40" height="40" url="https://secure.gravatar.com/avatar/84b7f093d7ceace4beb347fdb39b95c4?s=80&d=identicon"/>
<author>
<name>Curt Raynor</name>
<email></email>
</author>
<summary>Error dolores vel voluptatem reprehenderit quam rerum sint sed.</summary>
<description>Et quas debitis suscipit iusto pariatur. Ut amet delectus quis tenetur impedit. Quibusdam sunt asperiores rerum quam suscipit totam.</description>
<content>Et quas debitis suscipit iusto pariatur. Ut amet delectus quis tenetur impedit. Quibusdam sunt asperiores rerum quam suscipit totam.</content>
<milestone>v3.0</milestone>
<labels>
<label>Cafunc</label>
<label>Corolla Wagon</label>
<label>Probe</label>
<label>Sable</label>
<label>Sircell</label>
<label>Sirpod</label>
</labels>
<assignees>
<assignee>
<name>Administrator</name>
<email></email>
</assignee>
</assignees>
<assignee>
<name>Administrator</name>
<email></email>
</assignee>
</entry>
</feed>
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) - [-] I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?)
- [-] I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?)
-
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) - [-] I have tested this MR in all supported browsers, or it's not needed.
- [-] I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
I am not sure here - this MR makes use of the existing feed tokens, which could be seen as "utilizing to any type of authentication, authorization, or session handling mechanism".
Related to #29521 (closed), #202616