Page MenuHomePhabricator

JIRA/arc diff integration appears to have broken
Closed, ResolvedPublic

Description

Some time in the last few weeks, the JIRA Issues: field when performing arc diff seems to have stopped functioning; it's simply stripped from the commit message entirely after the diff is performed as far as I can tell. Editing the revision and manually linking the ticket continues to work fine, so I assume it's something in the differential text parser.

Revisions and Commits

Restricted Differential Revision

Event Timeline

Firehed raised the priority of this task from to Low.
Firehed updated the task description. (Show Details)
Firehed added a subscriber: Firehed.

I think that I discovered nature of this bug. Description below:

I've noticed that if I specify in commit message text "Jira issues: XX-1234", then ticket numbers are ignored complety and in message template all that remains is just "Jira issues:" (field is recognized, but values are lost). After poke-debugging I've discovered "patch" which requires to add in DifferentialJIRAIssuesField two simple methods:

public function getRequiredHandlePHIDsForCommitMessage() {
    return $this->getValue();
}

public function readValueFromCommitMessage($value) {
    $this->setValue($value);
}

This may be not fully-featured implementation (e.g. validation is missing), but It's sufficient for whole scenario to work.

This is because default implementation of those methods are hitting generic proxy pattern in DifferentialCustomField

if ($this->getProxy()) {
    $this->getProxy()->someMethod($value);
    return $this;
  }
  return $this;

and there is no proxy, so those methods do nothing. Then, in ConduitAPI_differential_getcommitmessage_Method when call $custom_field->readValueFromCommitMessage($value); is made, then value from request is lost.

Please let me know what you think of this fix?

Closed by commit rP3aabfc7f4dea.