@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove "Large Changes" documentation and make some minor behavioral improvements

Summary:
Depends on D19296. Ref T13110.

- Remove the "Large Changesets" documentation since we now degrade very large changesets and I don't have any evidence that anyone has ever tried to follow any of the recommendations in this document.
- Remove references to it.
- When an older revision doesn't have denormalized size information on the Revision object itself, don't render a scale element (instead of rendering a bogus one).
- Try to improve terminology consistency around "Large Change" (100-1000 files) vs "Very Large Change" (1000+ files) vs "Enormous Change" (too large to hold in memory).

Test Plan: Viewed revisions; grepped for documentation.

Maniphest Tasks: T13110

Differential Revision: https://secure.phabricator.com/D19298

+16 -65
+1 -4
src/applications/differential/conduit/DifferentialCreateRawDiffConduitAPIMethod.php
··· 56 56 throw new Exception( 57 57 pht( 58 58 'The raw diff you have submitted is too large to parse (it affects '. 59 - 'more than %s paths and hunks). Differential should only be used '. 60 - 'for changes which are small enough to receive detailed human '. 61 - 'review. See "Differential User Guide: Large Changes" in the '. 62 - 'documentation for more information.', 59 + 'more than %s paths and hunks).', 63 60 new PhutilNumber($raw_limit))); 64 61 } 65 62
+1 -1
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 158 158 if (count($changesets) > $limit && !$large) { 159 159 $count = count($changesets); 160 160 $warning = new PHUIInfoView(); 161 - $warning->setTitle(pht('Very Large Diff')); 161 + $warning->setTitle(pht('Large Diff')); 162 162 $warning->setSeverity(PHUIInfoView::SEVERITY_WARNING); 163 163 $warning->appendChild(hsprintf( 164 164 '%s <strong>%s</strong>',
+6
src/applications/differential/storage/DifferentialRevision.php
··· 742 742 return $this->getProperty(self::PROPERTY_LINES_REMOVED); 743 743 } 744 744 745 + public function hasLineCounts() { 746 + // This data was not populated on older revisions, so it may not be 747 + // present on all revisions. 748 + return isset($this->properties[self::PROPERTY_LINES_ADDED]); 749 + } 750 + 745 751 public function getRevisionScaleGlyphs() { 746 752 $add = $this->getAddedLineCount(); 747 753 $rem = $this->getRemovedLineCount();
+8 -1
src/applications/differential/view/DifferentialRevisionListView.php
··· 109 109 $item->setHeader($revision->getTitle()); 110 110 $item->setHref($revision->getURI()); 111 111 112 - $item->addAttribute($this->renderRevisionSize($revision)); 112 + $size = $this->renderRevisionSize($revision); 113 + if ($size !== null) { 114 + $item->addAttribute($size); 115 + } 113 116 114 117 if ($revision->getHasDraft($viewer)) { 115 118 $draft = id(new PHUIIconView()) ··· 193 196 } 194 197 195 198 private function renderRevisionSize(DifferentialRevision $revision) { 199 + if (!$revision->hasLineCounts()) { 200 + return null; 201 + } 202 + 196 203 $size = array(); 197 204 198 205 $glyphs = $revision->getRevisionScaleGlyphs();
-3
src/docs/flavor/writing_reviewable_code.diviner
··· 74 74 We generally follow these practices in Phabricator. The median change size for 75 75 Phabricator is 35 lines. 76 76 77 - See @{article:Differential User Guide: Large Changes} for information about 78 - reviewing big checkins. 79 - 80 77 = Write Sensible Commit Messages = 81 78 82 79 There are lots of resources for this on the internet. All of them say pretty
-2
src/docs/user/userguide/differential.diviner
··· 66 66 - diving into the details of inline comments in 67 67 @{article:Differential User Guide: Inline Comments}; or 68 68 - reading the FAQ at @{article:Differential User Guide: FAQ}; or 69 - - learning about handling large changesets in 70 - @{article:Differential User Guide: Large Changes}; or 71 69 - learning about test plans in 72 70 @{article:Differential User Guide: Test Plans}; or 73 71 - learning more about Herald in @{article:Herald User Guide}.
-54
src/docs/user/userguide/differential_large_changes.diviner
··· 1 - @title Differential User Guide: Large Changes 2 - @group userguide 3 - 4 - Dealing with huge changesets, and when **not** to use Differential. 5 - 6 - = Overview = 7 - 8 - When you want code review for a given changeset, Differential is not always the 9 - right tool to use. The rule of thumb is that you should only send changes to 10 - Differential if you expect humans to review the actual differences in the source 11 - code from the web interface. This should cover the vast majority of changes but, 12 - for example, you usually should //not// submit changes like these through 13 - Differential: 14 - 15 - - Committing an entire open source project to a private repo somewhere so 16 - you can fork it or link against it. 17 - - Committing an enormous text datafile, like a list of every English word or a 18 - dump of a database. 19 - - Making a trivial (e.g., find/replace or codemod) edit to 10,000 files. 20 - 21 - You can still try submitting these kinds of changes, but you may encounter 22 - problems getting them to work (database or connection timeouts, for example). 23 - Differential is pretty fast and scalable, but at some point either it or the 24 - browser will break down: you simply can't show nine million files on a webpage. 25 - 26 - More importantly, in all these cases, the text of the changes won't be reviewed 27 - by a human. The metadata associated with the change is what needs review (e.g., 28 - what are you checking in, where are you putting it, and why? Does the change 29 - make sense? In the case of automated transformations, what script did you use?). 30 - To get review for these types of changes, one of these strategies will usually 31 - work better than trying to get the entire change into Differential: 32 - 33 - - Send an email/AIM/IRC to your reviewer(s) like "Hey, I'm going to check in 34 - the source for MySQL 9.3.1 to /full/path/to/whatever. The change is staged 35 - in /home/whatever/path/somewhere if you want to take a look. Can I put your 36 - name on the review?". This is best for straightforward changes. The reviewer 37 - is not going to review MySQL's source itself, instead they are reviewing the 38 - change metadata: which version are you checking in, why are you checking it 39 - in, and where are you putting it? You won't be able to use "arc commit" or 40 - "arc amend" to actually push the change. Just use "svn" or "git" and 41 - manually edit the commit message instead. (It is normally sufficient to add 42 - a "Reviewed By: <username>" field.) 43 - - Create a Differential revision with only the metadata, like the script you 44 - used to make automated changes or a text file explaining what you're doing, 45 - and maybe a sample of some of the changes if they were automated. Include a 46 - link to where the changes are staged so reviewers can look at the actual 47 - changeset if they want to. This is best for more complicated changes, since 48 - Differential can still be used for discussion and provide a permanent record 49 - others can refer to. Once the revision is accepted, amend your local commit 50 - (e.g. by `git commit --amend`) with the real change and push as usual. 51 - 52 - These kinds of changes are generally rare and don't have much in common, which 53 - is why there's no explicit support for them in Differential. If you frequently 54 - run into cases which Differential doesn't handle, let us know what they are.