Phabricator/FAQ: Difference between revisions

Add a note about how to request a new review group. Bug 1821064
m (removed ticks)
(Add a note about how to request a new review group. Bug 1821064)
 
(12 intermediate revisions by 5 users not shown)
Line 28: Line 28:
=== How do I '''require''' a review from all reviewers before landing? ===
=== How do I '''require''' a review from all reviewers before landing? ===


Add all reviewers as "blocking" reviewers, either from the UI or by appending a “!” to their name when specifying them in MozPhab or Arcanist:
Add all reviewers as "blocking" reviewers, either from the UI or by appending a “!” to their name when specifying them in MozPhab:
<code>Bug 123456 - Example commit description; r=someone!</code>
<code>Bug 123456 - Example commit description; r=someone!</code>


Line 37: Line 37:


[[File:blocking_reviewers.png|640px|Selecting blocking vs nonblocking reviewers]]
[[File:blocking_reviewers.png|640px|Selecting blocking vs nonblocking reviewers]]
=== Can I remove "Tags: #secure-revision" from my changeset’s commit message? ===
"#secure-revision" is a project tag attached to the revision at the time the commit message is auto-generated. The tag is removed slightly later once Bugzilla has had a chance to update the revisions security policies.  After Bugzilla has done this update, you can use <code>arc amend</code> to update the commit message with the current state.
Note using <code>moz-phab</code> instead of <code>arc</code> to submit changesets to Phabricator will avoid this issue.


=== Can I close multiple revisions with one commit message? (by including multiple “Differential Revision:” lines?) ===
=== Can I close multiple revisions with one commit message? (by including multiple “Differential Revision:” lines?) ===
Line 58: Line 52:
[[File:Closed revision actions.png|320px|Closed revision actions]]
[[File:Closed revision actions.png|320px|Closed revision actions]]


Note that you will need to run <code>arc diff</code> again to update the patch even if you don't need to change it (e.g. the bustage was in an earlier commit).  This is because Phabricator updates the revision after it lands but does not provide the necessary metadata that Lando needs.  See {{bug|1489126}}.
Note that you will need to run <code>moz-phab submit</code> again to update the patch even if you don't need to change it (e.g. the bustage was in an earlier commit).  This is because Phabricator updates the revision after it lands but does not provide the necessary metadata that Lando needs.  See {{bug|1489126}}.


See also https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#other-revision-actions for descriptions of other non-review-related actions you might want to take on a revision.
See also https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#other-revision-actions for descriptions of other non-review-related actions you might want to take on a revision.
Line 69: Line 63:


* Use the <code>moz-phab patch</code> command to download an apply a diff (recommended)
* Use the <code>moz-phab patch</code> command to download an apply a diff (recommended)
* Use the <code>arc patch</code> command to download and apply a diff


* Manually download just the diff from the menu on the right side of the page:
* Manually download just the diff from the menu on the right side of the page:
Line 93: Line 85:
We will be including some revision metadata in associated bugs at some point; see {{bug|1489706}}.
We will be including some revision metadata in associated bugs at some point; see {{bug|1489706}}.


=== Can I block review requests in Phabricator like I can in BMO? ===
=== How do I mark myself 'Out Of Office' to stop review requests? ===


You can use [https://phabricator.services.mozilla.com/calendar/ Phabricator's calendar feature] to set your availability.  This will result in a warning at submission time.
You can use [https://phabricator.services.mozilla.com/calendar/ Phabricator's calendar feature] to set your availability.  This will result in a warning at submission time.
Line 108: Line 100:


Users who use GitHub to log into Bugzilla will need to switch their login method to username+password by logging out, then following the "Forgot Password" workflow.
Users who use GitHub to log into Bugzilla will need to switch their login method to username+password by logging out, then following the "Forgot Password" workflow.
If you don't have access to a smartphone or hardware security token, there are desktop TOTP applications available.  While we do not generally recommend these [https://superuser.com/q/462478 this SuperUser answer] lists various clients across different operating systems.


=== My patch is too large for Phabricator; what are my options? ===
=== My patch is too large for Phabricator; what are my options? ===
Line 115: Line 109:
If your patch makes small changes to multiple files, try submitting with the <code>--less-context</code> switch.  Phabricator works by submitting the complete contents of each file modified; when touching many files it can be easy to exceed the 32MB limit.  Note <code>--less-context</code> disables the ability to show more context when viewing a patch on Phabricator.
If your patch makes small changes to multiple files, try submitting with the <code>--less-context</code> switch.  Phabricator works by submitting the complete contents of each file modified; when touching many files it can be easy to exceed the 32MB limit.  Note <code>--less-context</code> disables the ability to show more context when viewing a patch on Phabricator.


== Command-line tools: moz-phab and arc ==
=== How do I change my Phabricator email address? ===
 
=== How do I get “arc diff” to stop listing and asking about all my untracked build artifacts? ===
 
Use the <code>--allow-untracked</code> option to arc diff.


=== How do I fetch and apply changes to a local repository? ===
Instructions are [https://mana.mozilla.org/wiki/pages/viewpage.action?spaceKey=EW&title=Phabricator+-+Changing+your+email+address here].


==== Using moz-phab (recommended) ====
=== Why am I getting <code>You do not have permission to edit this object.</code> when trying to review a revision? ===


Use <code>moz-phab patch ''D<NNNNN>''</code> command to download and apply stacks of Phabricator revisions.
This likely means your Bugzilla account does not have <code>editbugs</code> rights.


Execute <code>moz-phab patch --help</code> for information on how to change patch's behaviour.
You can request editbugs [https://bugzilla.mozilla.org/page.cgi?id=get_permissions.html by following the directions on how to upgrade permissions].


==== Using arc ====
=== How do I request a new reviewers group in Phabricator? ===


Provided all dependent revisions have been submitted to Phabricator and not
Requests for new review groups are handled via Bugzilla. Please [https://bugzilla.mozilla.org/enter_bug.cgi?product=Conduit&component=Administration file a bug under `Conduit :: Administration`] outlining the name of the group and the Phabricator usernames of the initial group members.
replaced with updated diffs, the "Related Revisions" have been set up
correctly, and the first revision in the related revision chain has a parent
commit hash corresponding to a base revision existing in the local mercurial
repository, <code>arc patch --revision ''D<NNNNN>''</code> should apply the series to the
appropriate base revision.


The process is more complicated for retrieving any diffs from revisions that
See [https://bugzilla.mozilla.org/show_bug.cgi?id=1812153 bug 1812153] as an example.
now have more recent diffs in the related revision chain:


# The "History" tab for a revision has a list of diff IDs.  Identify the diff ID for the diff that is wanted.  The creation date may be useful.
== Command-line tool: moz-phab ==
# Look through the history of the revision to find changes to the parent revision and guess which was the parent revision at the time the diff was generated from a commit.  Changes to parent revisions are manual and so may happen before or after the commit was pushed (if they were accurate at any stage).
# Repeat the process to find a diff ID in the parent revision, and continue until there are no parent revisions.  When viewing a particular diff ID, the "Commits" tab will have a commit hash and parent commit hash, if the diff was submitted from moz-phab at least.  These may be useful in identifying parent revisions and diffs.
# <code>arc patch --diff ''<NNNNN>''</code> may be used to create a commit for the first diff in the series.
# For each subsequent diff use <code>arc patch --skip-dependencies --diff ''<NNNNN>''</code>. <code>--skip-dependencies</code> prevents more recent diffs for parent revisions or diffs for wrong parent revisions being fetched and prevents attempts to apply the specified diff on these incorrect diffs ([https://bugzilla.mozilla.org/show_bug.cgi?id=1485849 Tracked in bug 1485849])


=== How do I get "arc patch" to apply changes to local tip instead of branching an earlier commit? ===
=== How do I fetch and apply changes to a local repository? ===


Use <code>arc patch --nobranch [rest of command]</code>.  The changes will be applied to the appropriate earlier commit, if known, and rebased.
Use <code>moz-phab patch ''D<NNNNN>''</code> command to download and apply stacks of Phabricator revisions.


=== The official docs on installing Arcanist on Windows are ... not great. Are there better ones somewhere? ===
Execute <code>moz-phab patch --help</code> for information on how to change patch's behaviour.
 
Yes!  We recently published our own step-by-step guide that should be clearer than the official ones: https://moz-conduit.readthedocs.io/en/latest/arcanist-windows.html
 
=== arc dies when I do [X]!  How do I get debug information out of arc? ===
 
Run <code>arc --trace [rest of command]</code>.  You will get a lot of diagnostic information.
 
If you've found a bug you can file it under the [https://bugzilla.mozilla.org/enter_bug.cgi?product=Conduit&component=Phabricator Phabricator component] in BMO.
 
=== moz-phab fails on Windows: WindowsError: [Error 193] %1 is not a valid Win32 application ===
 
This can happen if you copy your moz-phab configuration from another platform.
 
Edit your ~/moz-phab config file and change "arc_command" to "arc.bat".
 
=== "arc diff" fails on Windows: Failed to passthru proc_open(): proc_open(): CreateProcess failed, error code - 2 ===
 
  arc diff --trace
  ...
  EXCEPTION: (Exception) Failed to passthru proc_open(): proc_open(): CreateProcess failed, error code - 2 at [<phutil>\src\future\exec\PhutilExecPassthru.php:103]
  arcanist(head=master, ref.master=875d01836037), phutil(head=master, ref.master=1613e68f4740)
    #0 PhutilExecPassthru::execute() called at [<phutil>\src\future\exec\execx.php:50]
    #1 phutil_passthru(string, PhutilCommandString) called at [<phutil>\src\console\PhutilInteractiveEditor.php:122]
    #2 PhutilInteractiveEditor::invokeEditor(string, string, integer) called at [<phutil>\src\console\PhutilInteractiveEditor.php:77]
    #3 PhutilInteractiveEditor::editInteractively() called at [<arcanist>\src\workflow\ArcanistDiffWorkflow.php:1889]
    #4 ArcanistDiffWorkflow::getUpdateMessage(array, string) called at [<arcanist>\src\workflow\ArcanistDiffWorkflow.php:773]
    #5 ArcanistDiffWorkflow::buildRevisionFromCommitMessage(ArcanistDifferentialCommitMessage) called at [<arcanist>\src\workflow\ArcanistDiffWorkflow.php:478]
    #6 ArcanistDiffWorkflow::run() called at [<arcanist>\scripts\arcanist.php:394]
 
arc needs to be configured with the full path to your editor (it doesn't check your PATH).
 
See [https://secure.phabricator.com/book/phabricator/article/arcanist_windows/ Arcanist User Guide: Windows] for instructions on how to set this correctly.


=== What does the "contains arc fields" error mean? ===
=== What does the "contains arc fields" error mean? ===
Line 195: Line 143:
There are plans to both support the "test plan" field and parse an arc formatted commit description with moz-phab.
There are plans to both support the "test plan" field and parse an arc formatted commit description with moz-phab.


=== Does <code>arc</code> or <code>moz-phab</code> work with <code>mq</code> (Mercurial Queues) ===
=== Does <code>moz-phab</code> work with <code>mq</code> (Mercurial Queues) ===


No.  mq was deprecated 5+ years ago; please use '''evolve''' instead.
No.  mq was deprecated 5+ years ago; please use '''evolve''' instead.
Line 211: Line 159:
Some shells cache called executables location. The last Python2 release removes itself after a successful installation of the package from PyPI. Since the original file has been removed a non-existing location might be called.
Some shells cache called executables location. The last Python2 release removes itself after a successful installation of the package from PyPI. Since the original file has been removed a non-existing location might be called.
In <code>bash</code> one rebuilds the cache by calling <code>hash -r</code>.
In <code>bash</code> one rebuilds the cache by calling <code>hash -r</code>.
It might also happen that <code>moz-phab</code> script was installed into a directory which is not mentioned in `PATH` variable. To check the directory run <code>pip3 show MozPhab -f</code>
=== How do I update a patch opened with moz-phab? ===
When you push a patch with <code>moz-phab</code>, it will append an identifying string to the commit that looks something like Differential Revision: https://phabricator.services.mozilla.com/D79722.  As long as this string is not modified, executing <code>moz-phab</code> again will ask if you want to push to that patch.


== Lando ==
== Lando ==
Line 216: Line 170:
=== Lando says "You have insufficient permissions to land. Level 3 Commit Access is required." What do I do? ===
=== Lando says "You have insufficient permissions to land. Level 3 Commit Access is required." What do I do? ===


If you don't have Level 3, follow the guidelines for the repository you're trying to land code in. For mozilla-central, add the "checkin-needed" keyword to the associated bug.
If you don't have Level 3, follow the guidelines for the repository you're trying to land code in.


If you have Level 3 and are still getting this error, try:
If you have Level 3 and are still getting this error, try:
Line 231: Line 185:
You will need to log into the account that is associated with your SCM permissions.  If you have only ever accessed that account by ssh key, that is, to push up commits, you will likely need to request a password change to be able to use Auth0.
You will need to log into the account that is associated with your SCM permissions.  If you have only ever accessed that account by ssh key, that is, to push up commits, you will likely need to request a password change to be able to use Auth0.


To request a password [https://bugzilla.mozilla.org/enter_bug.cgi?product=Infrastructure%20%26%20Operations&component=MOC%3A%20Service%20Requests file a bug requesting a password reset] '''while logged in to your account with SCM permissions'''.
To request a password [https://bugzilla.mozilla.org/enter_bug.cgi?product=Infrastructure+%26+Operations&component=Infrastructure%3A+LDAP file a bug requesting a password reset] '''while logged in to your account with SCM permissions'''.


Note the SSO login system only allows you to be logged into one account at a time; when you log in with your community account any existing Mozilla Corporation sessions will be invalidated.  You can work around this by pinning Lando to a different Firefox container, use a private browsing window, using a different Firefox profile, or using a different browser.
Note the SSO login system only allows you to be logged into one account at a time; when you log in with your community account any existing Mozilla Corporation sessions will be invalidated.  You can work around this by pinning Lando to a different Firefox container, use a private browsing window, using a different Firefox profile, or using a different browser.
Line 240: Line 194:


* '''The revision was created via the Phabricator Web UI or via an unsupported client.'''
* '''The revision was created via the Phabricator Web UI or via an unsupported client.'''
** Use arcanist or moz-phab to submit the patch instead; see the [https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html Mozilla Phabricator User Guide] for help.
** Use moz-phab to submit the patch instead; see the [https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html Mozilla Phabricator User Guide] for help.
 
* '''The revision was created via arcanist or moz-phab, but the error still appears.'''
** This can happen if you have not set an author email in your <code>.hgrc</code> file (or [https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup git config]).  Set your author email in your <code>.hgrc</code> to your username, <code>Firstname Lastname <yourldapemail@mozilla.com></code>. Update your commit so it contains the new author data. Re-run <code>moz-phab submit</code> or <code>arc diff</code> so that the new commit+data is uploaded to Phabricator.


* '''You are attempting to re-land a revision but [https://bugzilla.mozilla.org/show_bug.cgi?id=1489126 Bug 1489126] happens'''
* '''The revision was created via moz-phab, but the error still appears.'''
** This is an unfortunate bug that will be fixed in time, but for now you can get around this by reopening the revision on Phabricator and then resubmitting the revisions on your client. Follow the bug to see status updates.
** This can happen if you have not set an author email in your <code>.hgrc</code> file (or [https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup git config]).  Set your author email in your <code>.hgrc</code> to your username, <code>Firstname Lastname <yourldapemail@mozilla.com></code>. Update your commit so it contains the new author data. Re-run <code>moz-phab submit</code> so that the new commit+data is uploaded to Phabricator.


=== What are these red dots to the left of my commits? ===
=== What are these red dots to the left of my commits? ===
47

edits