Add an option to use `unidiff` format for diff API responses
What does this MR do and why?
Contriubutes to #23284 (closed)
Problem
diff
field doesn't return diff headers compatible with Unified format.
Solution
Use Unified format for diffs when unidiff option is provided. It should keep the backward compatibility with existing API.
Unified format: https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
The current version of diff output is missing two headers:
--- a/test.yml
+++ b/test.yml
Screenshots or screen recordings
http://127.0.0.1:3000/api/v4/projects/1/repository/commits/HEAD/diff
http://127.0.0.1:3000/api/v4/projects/1/repository/commits/HEAD/diff?unidiff=true
How to set up and validate locally
- Request diff for a commit in current diff format: http://127.0.0.1:3000/api/v4/projects/2/repository/commits/HEAD/diff
- Request diff for a commit in unidiff format: http://127.0.0.1:3000/api/v4/projects/2/repository/commits/HEAD/diff?unidiff=true
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
changed milestone to %16.4
added Category:API backend featureaddition groupsource code labels
assigned to @vyaklushin
added typefeature label
added devopscreate sectiondev labels
1 Message This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
-
doc/api/commits.md
(Link to current live version) -
doc/api/merge_requests.md
(Link to current live version) -
doc/api/repositories.md
(Link to current live version)
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Aakriti Gupta (
@aakriti.gupta
) (UTC+5.5, 3.5 hours ahead of@vyaklushin
)Madelein van Niekerk (
@maddievn
) (UTC+2, same timezone as@vyaklushin
)Please check reviewer's status!
Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger-
@vyaklushin Some end-to-end (E2E) tests should run based on the stage label.
Please start the
trigger-omnibus-and-follow-up-e2e
job in theqa
stage and ensure tests in thefollow-up-e2e:package-and-test-ee
pipeline pass before this MR is merged. (E2E tests are computationally intensive and don't run automatically for every push/rebase, so we ask you to run this job manually at least once.)To run all E2E tests, apply the pipeline:run-all-e2e label and run a new pipeline.
E2E test jobs are allowed to fail due to flakiness. See current failures at the latest pipeline triage issue.
Once done, apply the
emoji on this comment.Team members only: for any questions or help, reach out on the internal
#quality
Slack channel.Setting label(s) Category:Source Code Management based on groupsource code.
added Category:Source Code Management label
added 1 commit
- cf40ead6 - Expose `unidiff` field for diff API responses
- A deleted user
added documentation label
added 1 commit
- 037ba82d - Expose `unidiff` field for diff API responses
added 1 commit
- b67b0d80 - Expose `unidiff` field for diff API responses
added 1 commit
- 01d0c8b5 - Add an option to use `unidiff` format for diff API responses
Allure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for a328242eexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Manage | 12 | 0 | 1 | 0 | 13 | ✅ | | Plan | 51 | 0 | 0 | 0 | 51 | ✅ | | Create | 46 | 0 | 1 | 0 | 47 | ✅ | | Govern | 34 | 0 | 0 | 0 | 34 | ✅ | | Verify | 8 | 0 | 0 | 0 | 8 | ✅ | | Data Stores | 20 | 0 | 0 | 1 | 20 | ❗ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 171 | 0 | 2 | 1 | 173 | ❗ | +-------------+--------+--------+---------+-------+-------+--------+
- Resolved by Nikola Milojevic
added 1 commit
- ec4f7209 - Add an option to use `unidiff` format for diff API responses
added 1 commit
- 3ec05cdd - Add an option to use `unidiff` format for diff API responses
changed milestone to %16.5
added 2667 commits
-
3ec05cdd...828b99c3 - 2666 commits from branch
master
- 8ad94a37 - Add an option to use `unidiff` format for diff API responses
-
3ec05cdd...828b99c3 - 2666 commits from branch
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
added 426 commits
-
8ad94a37...69d55831 - 425 commits from branch
master
- b9ba0d59 - Add an option to use `unidiff` format for diff API responses
-
8ad94a37...69d55831 - 425 commits from branch
- Resolved by Nikola Milojevic
Hi @alexbuijs!
Can you please review this change?
requested review from @alexbuijs
- Resolved by Nikola Milojevic
- Resolved by Nikola Milojevic
- Resolved by Nikola Milojevic
requested review from @nmilojevic1 and removed review request for @alexbuijs
@alexbuijs
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
Hi @aqualls!
Can you please review documentation changes?requested review from @aqualls
added 252 commits
-
96ab25bc...05fb587c - 249 commits from branch
master
- 9ddf7aa1 - Add an option to use `unidiff` format for diff API responses
- 3f431587 - Apply code review suggestions
- e3eb2ff5 - Try to fix failing spec
Toggle commit list-
96ab25bc...05fb587c - 249 commits from branch
- Resolved by Vasilii Iakliushin
- Resolved by Vasilii Iakliushin
- Resolved by Vasilii Iakliushin
- Resolved by Vasilii Iakliushin
- Resolved by Vasilii Iakliushin
@vyaklushin I've left you several repeats of the same change
Approving, unassigning myself.
added Technical Writing docsfeature tw-weight3 twfinished labels
removed review request for @aqualls
Hi
@aqualls
,GitLab Bot has added the Technical Writing label because a Technical Writer has approved or merged this MR.
This message was generated automatically. You're welcome to improve it.
added 109 commits
-
1ceb0dec...5233a8b9 - 108 commits from branch
master
- a328242e - Add an option to use `unidiff` format for diff API responses
-
1ceb0dec...5233a8b9 - 108 commits from branch
enabled an automatic merge when the pipeline for c2e5100d succeeds
@nmilojevic1, did you forget to run a pipeline before you merged this work? Based on our code review process, if the latest pipeline was created more than 6 hours ago OR finished more than 2 hours ago, you should:
- Ensure the merge request is not in Draft status.
- Start a pipeline (especially important for Community contribution merge requests).
- Set the merge request to auto-merge.
This is a guideline, not a rule. Please consider replying to this comment for transparency.
This message was generated automatically. You're welcome to improve it.
mentioned in commit a889e8d9
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!2517 (merged)
mentioned in issue #270960 (closed)