Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15457102
D13847.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13847.diff
View Options
diff --git a/src/applications/differential/controller/DifferentialChangesetViewController.php b/src/applications/differential/controller/DifferentialChangesetViewController.php
--- a/src/applications/differential/controller/DifferentialChangesetViewController.php
+++ b/src/applications/differential/controller/DifferentialChangesetViewController.php
@@ -203,6 +203,29 @@
$inlines = array();
}
+ if ($left_new || $right_new) {
+ $diff_map = array();
+ if ($left) {
+ $diff_map[] = $left->getDiff();
+ }
+ if ($right) {
+ $diff_map[] = $right->getDiff();
+ }
+ $diff_map = mpull($diff_map, null, 'getPHID');
+
+ $buildables = id(new HarbormasterBuildableQuery())
+ ->setViewer($viewer)
+ ->withBuildablePHIDs(array_keys($diff_map))
+ ->withManualBuildables(false)
+ ->needBuilds(true)
+ ->needTargets(true)
+ ->execute();
+ $buildables = mpull($buildables, null, 'getBuildablePHID');
+ foreach ($diff_map as $diff_phid => $changeset_diff) {
+ $changeset_diff->attachBuildable(idx($buildables, $diff_phid));
+ }
+ }
+
if ($left_new) {
$inlines = array_merge(
$inlines,
@@ -356,30 +379,47 @@
}
private function buildLintInlineComments($changeset) {
- $lint = id(new DifferentialDiffProperty())->loadOneWhere(
- 'diffID = %d AND name = %s',
- $changeset->getDiffID(),
- 'arc:lint');
- if (!$lint) {
+ $diff = $changeset->getDiff();
+
+ $buildable = $diff->getBuildable();
+ if (!$buildable) {
return array();
}
- $lint = $lint->getData();
- $inlines = array();
- foreach ($lint as $msg) {
- if ($msg['path'] != $changeset->getFilename()) {
- continue;
+ $target_phids = array();
+ foreach ($buildable->getBuilds() as $build) {
+ foreach ($build->getBuildTargets() as $target) {
+ $target_phids[] = $target->getPHID();
}
- $inline = new DifferentialInlineComment();
- $inline->setChangesetID($changeset->getID());
- $inline->setIsNewFile(1);
- $inline->setSyntheticAuthor(pht('Lint: %s', $msg['name']));
- $inline->setLineNumber($msg['line']);
- $inline->setLineLength(0);
+ }
+
+ if (!$target_phids) {
+ return array();
+ }
- $inline->setContent('%%%'.$msg['description'].'%%%');
+ $messages = id(new HarbormasterBuildLintMessage())->loadAllWhere(
+ 'buildTargetPHID IN (%Ls) AND path = %s',
+ $target_phids,
+ $changeset->getFilename());
- $inlines[] = $inline;
+ if (!$messages) {
+ return array();
+ }
+
+ $template = id(new DifferentialInlineComment())
+ ->setChangesetID($changeset->getID())
+ ->setIsNewFile(1)
+ ->setLineLength(0);
+
+ $inlines = array();
+ foreach ($messages as $message) {
+ $description = $message->getProperty('description');
+ $description = '%%%'.$description.'%%%';
+
+ $inlines[] = id(clone $template)
+ ->setSyntheticAuthor(pht('Lint: %s', $message->getName()))
+ ->setLineNumber($message->getLine())
+ ->setContent($description);
}
return $inlines;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 31, 2:22 PM (3 d, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7595876
Default Alt Text
D13847.diff (3 KB)
Attached To
Mode
D13847: Read synthetic inline comments from Harbormaster
Attached
Detach File
Event Timeline
Log In to Comment