Page MenuHomePhabricator

Cannot use "arc diff" with JIRA integration
Closed, DuplicatePublic

Description

Steps to reproduce:

  1. Phabricator install connected to jira
  2. Create a new branch, with some commits
  3. On this new feature, run arc diff and don't specify a JIRA issue. This works fine for now.
  4. Amend some commits, and run arc diff again. Whether or not, I specify a JIRA issue linked to it, the arc command fails.

I get an error message. The detailed trace of the arcanist functionality is:

(rfenv)โžœ  genprops git:(big_feature) arc diff --trace HEAD~3
libphutil loaded from '/Users/anirudh/opt/libphutil/src'.
arcanist loaded from '/Users/anirudh/opt/arcanist/src'.
Working Copy: Reading .arcconfig from "/Users/anirudh/jsrf/.arcconfig".
Working Copy: Path "/Users/anirudh/jsrf/tools/src/genprops" is part of `git` working copy "/Users/anirudh/jsrf".
Working Copy: Project root is at "/Users/anirudh/jsrf".
>>> [0] <conduit> conduit.connect() <bytes = 473>
>>> [1] <http> http://forge.razorflow.com/api/conduit.connect
<<< [1] <http> 1,897,945 us
<<< [0] <conduit> 1,900,990 us
>>> [2] <exec> $ git diff --no-ext-diff --no-textconv --raw 'HEAD' --
>>> [3] <exec> $ git ls-files --others --exclude-standard
>>> [4] <exec> $ git diff-files --name-only
<<< [4] <exec> 7,826 us
<<< [2] <exec> 10,443 us
<<< [3] <exec> 9,731 us
>>> [5] <event> diff.didCollectChanges <listeners = 0>
<<< [5] <event> 60 us
>>> [6] <exec> $ git merge-base 'HEAD~3' HEAD
<<< [6] <exec> 7,099 us
>>> [7] <exec> $ php '/Users/anirudh/opt/arcanist/src/../scripts/arcanist.php' --recon diff --no-diff '--ansi' 'HEAD~3'
>>> [8] <exec> $ git log --first-parent --format=medium '5eb4c272422d3412dbbcc1251527179496c9a751'..HEAD
<<< [8] <exec> 9,175 us
>>> [9] <conduit> differential.query() <bytes = 274>
>>> [10] <http> http://forge.razorflow.com/api/differential.query
<<< [10] <http> 555,634 us
<<< [9] <conduit> 555,874 us
>>> [11] <exec> $ git rev-parse --git-dir
<<< [11] <exec> 7,578 us
You have a saved revision message in '.git/arc/create-message'.
Message begins:

       improved documentation

You can use this message, or discard it.

    Do you want to use this message? [Y/n] n

>>> [12] <exec> $ git log 'HEAD' --not '5eb4c272422d3412dbbcc1251527179496c9a751

' --format='%H%x01%T%x01%P%x01%at%x01%an%x01%aE%x01%s%x01%s%n%n%b%x02' --
<<< [12] <exec> 9,508 us
>>> [13] <conduit> differential.parsecommitmessage() <bytes = 479>
>>> [14] <http> http://forge.razorflow.com/api/differential.parsecommitmessage
<<< [14] <http> 351,428 us
<<< [13] <conduit> 351,698 us
>>> [15] <conduit> differential.parsecommitmessage() <bytes = 233>
>>> [16] <http> http://forge.razorflow.com/api/differential.parsecommitmessage
<<< [16] <http> 307,815 us
<<< [15] <conduit> 308,165 us
>>> [17] <conduit> differential.parsecommitmessage() <bytes = 225>
>>> [18] <http> http://forge.razorflow.com/api/differential.parsecommitmessage
<<< [18] <http> 304,506 us
<<< [17] <conduit> 304,867 us
>>> [19] <event> diff.willBuildMessage <listeners = 0>
<<< [19] <event> 114 us
>>> [20] <conduit> differential.getcommitmessage() <bytes = 592>
>>> [21] <http> http://forge.razorflow.com/api/differential.getcommitmessage
<<< [21] <http> 307,105 us
<<< [20] <conduit> 307,400 us
>>> [22] <exec> $ git branch --no-color
<<< [22] <exec> 8,368 us
>>> [23] <exec> $ vim  '/var/folders/b2/hxy_bv2x51987m4bjx35bjd40000gn/T/edit.bl0xnvsk1goog8kg/new-commit'
<<< [23] <exec> 11,085,808 us
>>> [24] <conduit> differential.parsecommitmessage() <bytes = 594>
>>> [25] <http> http://forge.razorflow.com/api/differential.parsecommitmessage
<<< [25] <http> 1,800,487 us
<<< [24] <conduit> 1,800,817 us
>>> [26] <conduit> differential.query() <bytes = 178>
>>> [27] <http> http://forge.razorflow.com/api/differential.query
>>> [28] <conduit> user.query() <bytes = 215>
>>> [29] <http> http://forge.razorflow.com/api/user.query
<<< [27] <http> 615,658 us
<<< [26] <conduit> 627,300 us
<<< [29] <http> 1,227,595 us
<<< [28] <conduit> 1,227,904 us
>>> [30] <event> diff.didBuildMessage <listeners = 0>
<<< [30] <event> 54 us
>>> [31] <conduit> differential.getcommitmessage() <bytes = 230>
>>> [32] <http> http://forge.razorflow.com/api/differential.getcommitmessage
<<< [32] <http> 430,164 us
<<< [31] <conduit> 430,414 us
>>> [33] <conduit> differential.parsecommitmessage() <bytes = 630>
>>> [34] <http> http://forge.razorflow.com/api/differential.parsecommitmessage
<<< [34] <http> 2,029,479 us
<<< [33] <conduit> 2,029,716 us
<<< [7] <exec> 20,848,789 us

[2014-03-06 08:02:56] EXCEPTION: (ArcanistDifferentialCommitMessageParserException) Invalid or missing field 'JIRA Issues': Some JIRA issues could not be loaded. They may not exist, or you may not have permission to view them: #, Tip:, Use, "Depends, on, D123", in, your, summary, to, mark, a, dependency, between, #, revisions. at [/Users/anirudh/opt/arcanist/src/differential/ArcanistDifferentialCommitMessage.php:79]
  #0 ArcanistDifferentialCommitMessage::pullDataFromConduit(Object ConduitClient) called at [/Users/anirudh/opt/arcanist/src/workflow/ArcanistDiffWorkflow.php:750]
  #1 ArcanistDiffWorkflow::buildRevisionFromCommitMessage(Object ArcanistDifferentialCommitMessage) called at [/Users/anirudh/opt/arcanist/src/workflow/ArcanistDiffWorkflow.php:465]
  #2 ArcanistDiffWorkflow::run() called at [/Users/anirudh/opt/arcanist/scripts/arcanist.php:321]

Event Timeline

skyronic raised the priority of this task from to Needs Triage.
skyronic updated the task description. (Show Details)
skyronic added projects: Phabricator, Arcanist.
skyronic added a subscriber: skyronic.

Does this still reproduce at HEAD? This stuff pretty much all got rewritten recently. I can't immediately reproduce it.

I dont know it is related directly, but while experimenting with Arcanist, 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.

Please let me know if I discovered (and maybe fixed) some kind of bug, or that I've just misconfigured something?

Sorry, I discovered too late issue T4683 which is exactly my problem - feel free to delete above commets if you think so (i cannot do this somehow)

I'm going to merge this into T4683 and assume it's either fixed or will be resolved by the fix for that.

โœ˜ Merged into T4683.