The goal of this epic is to gather all the changes that were requested around pull request (PR) comments to make a single, consistent proposal. The original requirements were:
- Being able to reply to comment
- Being able to use markdown in comments
- Being able to go to comments easily from Overview page to Changes
- Being able to search for pull requests
Pull Request is one of the legacy apps written in AngularJS whose official support ended in January 2022. The goal should be to remove AngularJS usage, hence not adding new features on existing AngularJS codebase.
The new developments should be done using Vue3 as decided in the ADR
However, we won't rewrite from scratch the whole app (too big), we will split it. The current app covers:
- The display of pull request for a repository
- The "Overview" page of one PR
- The "Commit" page of one PR
- The "Changes" page of one PR
In order to limit the amount of changes, especially on Changes (the diff) part the solution that was spiked is to transform the management of comments into a WebComponent, independant of the framework that can be used in both AngularJS (for the Change vue) and in Vue3 (for future Overview).
Hence, the top level approach is the following:
- The display of pull request for a repository -> most of the logic change, should be rewritten (Vue3)
- The "Overview" page of one PR -> all the logic change, should be rewritten (Vue3)
- The "Commit" page of one PR -> no change, it's kept as is (AngularJS)
- The "Changes" page of one PR -> most of the logic don't change, it's kept in AngularJS but with usage of a WebComponent for the display of comments.
Reply to comments
- Update PR app routing using a 3rd party component (Navigo) instead of AngularJS router
- The goal is to be able to have some pages in AngularJS and some others in Vue3
- Replace the current management of comments by a WebComponent shared in Overview and Changes view
- Add reply to comments in the WebComponent (no markdown yet).
- Comments: no markdown, no preview, no "resolved", no edit
- Comments that are done on a given file/line are rendered with a link toward the comment in Change view
- A first reply to a top level comment creates a Thread. A new color is associated to the thread (the goal is to help to distinguish one thread from another).
- The color is taken from Tuleap palette
- Color is persisted and the information is added into the PR comments REST payload (so the colors are the same on overview & change)
- At the time of writing, the idea is to let the backend pick-up the color based on the number of threads for a PR (ie. the 3rd thread is created, it picks the 3rd color in the list). Random picking can be an alternative but takes less into account potential conflict or "too near" colors.
- Comments are deployed in Change & Overview pages. Those pages are still in AngularJS at this stage:
- AngularJS fetches raw data
- Processing of the data is done by an external module (ie not angular code)
- Rendering is done with the WebComponent
- Support of Reply in Overview is not mandatory at this stage. The changes on Overview should be done in least effort mode (as the page will be rewritten afterward). The least effort here is to have all comments (ie including threads' responses) visible. Otherwise one might overlook comments that would be only visible in Changes.
Rewrite Overview app (pre requisite of support of markdown)
Design choice. In order to limit the amount of work related to text/markdown management (was really time consuming for introduction of MD in artifacts):
- All existing comments remains in text and won't be editable
- All new comments will be in Markdown only
- The initial description (now rendered as first comment of the PR) was already editable and will be switched to Markdown at first edit
- At this stage there is no change in the data or backend (ie REST routes & payload remains the same)
In order to support markdown, the Overview should be rewritten:
- A vue3 app have been instantiated in anglar component, spike the fact that the full overview page is in vue 3
- Page routing is done via nginx
Changes are still managed by Angular, but the links are instantiated by vue app
- We know that we will have load between the three different tabs (Overview/Commit/Changes) it is expected
- Render everything that is ready only
- The comment empty state block
- The pullrequest read only properties: Author, pullrequest date, changes, last CI status, references
- ⚠️ check that crossref & associated popover are ok (
- Add the hybrid comment for managing comments
- Add the description as first possible comment (⚠️ with tooltips references)
- The description can not be updated
- We can not start a thread on description
- Add reviewers and make them updatable
- Add tags and make them updatable
- Add management of "Merge"
- Add management of "Abandon"
- Add "Checkout" button
- Edit Title (modale)
- Edit of first comment (previously description) in text only without preview
- Add new comment on Overview (reuse of
- Remove feature flag and use new Overview for every one
Add support of markdown
- First comment is rendered in Markdown + Preview (⚠️ no breaking change in REST API related to format: no format = text, only one format supported: Markdown)
- At first edit of an existing PR description that was in text, there is a warning to inform that after save the content will be rendered using markdown.
- Code blocks should be rendered using syntax highlighting
- All comments are rendered in Markdown + Preview
- All existing comments are flagged as text and cannot be edited (forgeupgrade)
- All new comments are in markdown and editable
- This applies on Overview and Changes
Management of "Resolved" threads
- This is a new data (⚠️ REST APIs to be modified)
- Display & interactions (button) are carried by the first comment
- It should be possible to submit a new thread as already Resolved
- a thread can go from Unresolved to Resolved as well as from Resolved to Unresolved
- Permission: anyone who can merge can toggle the "Resolve" button
- Expand / Collapse of comments (except the first one)
- Display “X unresolved” in the file switcher in Changes view
- Add “Show only unresolved” filter on Overview (no user preference is saved, on reload all changes are displayed)
Rewrite of Pull request list
There are functional changes here (eg Branches no longer displayed) the original view should be kept a little while "in case of $REGERESSION".
- Display Open pull requests (title, date, owner, reviewers, tags & nb unresolved)
- Allow to see Closed pull requests
- Sort PRs (Newest, …)
- Related to me
- Search (title, author, labels, dates, branches). It's not a filter, it's a search