Phabricator/FAQ: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(tip on how to preserve commit author info)
(Link to the doc)
Line 2: Line 2:


This FAQ is a collection of questions from users that have come up in IRC, Slack, and elsewhere.  Please feel free to add more if you hear other questions coming up frequently.  Note that you can always ask questions of both the development team and other users in #phabricator and #lando on IRC and Slack.
This FAQ is a collection of questions from users that have come up in IRC, Slack, and elsewhere.  Please feel free to add more if you hear other questions coming up frequently.  Note that you can always ask questions of both the development team and other users in #phabricator and #lando on IRC and Slack.
The documentation is available on how to use it is available on the readthedocs Mozilla instance:
https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html


== Phabricator ==
== Phabricator ==

Revision as of 15:24, 3 January 2019

Phabricator and Lando FAQs

This FAQ is a collection of questions from users that have come up in IRC, Slack, and elsewhere. Please feel free to add more if you hear other questions coming up frequently. Note that you can always ask questions of both the development team and other users in #phabricator and #lando on IRC and Slack.

The documentation is available on how to use it is available on the readthedocs Mozilla instance: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html

Phabricator

Can I use Phabricator for patches to security bugs?

Yes. Only people who are CC'd on the Bugzilla bug will be able to see your revision.

Note there may be a short delay after submission before the revision is visible to other users.

Reviews are connected with the BMO security groups. All revisions on Phabricator are initially non-public; when Bugzilla sees a new revision it checks the visibility of the bug and will update the revision to match: revisions referencing public bugs will be made public, and non-public bugs result in the BMO security group and CC list being mapped to the revision's policies. These are kept in sync as the bug changes.

When I clicking the Phabricator “Log In or Register” button, why is a new tab is opened with the exception ‘Unhandled Exception(“AphrontMalformedRequestException”) Your browser did not submit a “phcid” cookie with client state information in the request’

This can happen to users who are using containers for Bugzilla. Instead of clicking on the “Log In or Register” button, copy Phabricator the login page URL into the same container as Bugzilla. You may want to consider adding Phabricator and/or Lando to the same container as Bugzilla.

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 Arcanist. To set a reviewer as blocking in the UI, edit the revision and use the reviewer autocomplete; each result will have a normal and a "blocking" entry.

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 "arc amend" to update the commit message with the current state. We are currently working on a custom client that may omit the project tags from the commit message altogether.

Can I close multiple revisions with one commit message? (by including multiple “Differential Revision:” lines?)

No. Each commit is associated with a single revision.

Why do I get the following error during patch submission: "Error parsing field "Reviewers": The objects you have listed include objects which do not exist (name)."?

The specified name either does not have a Phabricator account, or is using a different nick on Phabricator than the one you specified.

How do I reopen an existing revision to submit more updates for review (e.g. following a backout)?

Use the action drop down, just above the comment box at the bottom of the page.

Closed revision actions

Note that you will need to run "arc diff" 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.


How do I keep the original commit author when commandeering someone else's revision?

Use hg commit --amend --user "Other Person <person@mozilla.com>" or git commit --amend --author="Other Person <person@mozilla.com>" when amending the original commit.

How do I download the patch or a file from Phabricator and apply it locally?

  • Use the arc patch command to download and apply a diff:

Arc Patch

  • Manually download just the diff from the menu on the right side of the page:

Download Raw Diff

To download an individual file from within the page, use the "Show Raw File" options under "View Options":

View Options Menu

How do I hide inline comments?

Controls for this will appear when scrolling over a diff. You'll get a bar that sticks to the top of the viewport and lets you hide/show in a number of ways.

Full Hide Comments Menu

TIP: Like most actions there's a keyboard shortcut for this - "Shift + A". Pro tip: pressing "?" will show all the keyboard shortcuts.

Why don't we mirror review flags to Bugzilla?

Keeping flags mirrored between two distributed systems that have different data models is hard and can be misleading. There are no direct equivalents between Differential's review actions and state and Bugzilla's flags. Furthermore, the full state of a review is not exposed by Phabricator's Conduit API. See this dev.platform post for more information.

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?

Unfortunately, BMO's system to block review requests isn't suitable for Phabricator because communication with BMO after a revision is created is asynchronous to make the system faster and more robust. We are, however, currently looking into ways we can implement this functionality within Phabricator itself. See bug 1475915.

Can I filter Phabricator mails in gmail?

Yes, if you enable stamps in e-mail bodies. There's some examples in the upstream documentation.

Why does logging into Phabricator require 2FA/MFA?

Anyone using Phabricator is authoring patches, reviewing patches, and/or accessing confidential patches. We feel MFA is a reasonable burden for these people given the importance of maintaining secure processes in the development of Firefox and other Mozilla apps. Given that Bugzilla is coupled to Phabricator, and a lot of important discussion around bugs and solutions also happens in Bugzilla, including confidential discussions, anyone involved in the above activities on Phabricator should also have equal protections when accessing Bugzilla.

Command-line tools: moz-phab and arc

How do I get “arc diff” to stop listing and asking about all my untracked build artifacts?

Use the “--allow-untracked” option to arc diff.

How do I fetch and apply changes to a local repository?

Provided all dependent revisions have been submitted to Phabricator and not 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, "arc patch --revision D<NNNNN>" should apply the series to the appropriate base revision.

The process is more complicated for retrieving any diffs from revisions that now have more recent diffs in the related revision chain:

  1. 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.
  2. 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).
  3. 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.
  4. "arc patch --diff <NNNNN>" may be used to create a commit for the first diff in the series.
  5. For each subsequent diff use "arc patch --skip-dependencies --diff <NNNNN>". "--skip-dependencies" 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 (Tracked in bug 1485849)

How do I get "arc patch" to apply changes to local tip instead of branching an earlier commit?

Use "arc patch --nobranch [rest of command]". The changes will be applied to the appropriate earlier commit, if known, and rebased.

The official docs on installing Arcanist on Windows are ... not great. Are there better ones somewhere?

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 "arc --trace [rest of command]". You will get a lot of diagnostic information.

If you've found a bug you can file it under the Phabricator component in BMO.

"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 Arcanist User Guide: Windows for instructions on how to set this correctly.

What does the "contains arc fields" error mean?

The "contains arc fields" error means that revision was previously pushed to Phabricator with arc directly.

moz-phab doesn't support all the fields that arc itself does, including the "test plan" field. If moz-phab were to rewrite the commit description that information would be lost. Currently moz-phab takes a conservative approach and will stop with the "contains arc fields" error message.

You can work around that by rewriting the commit description yourself to only include the description and the 'Differential Revision:' line.

There are plans to both support the "test plan" field and parse an arc formatted commit description with moz-phab.

Lando

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 have Level 3 and are still getting this error, try:

  • logging out of auth0 and logging in again
  • ssh to hg.mozilla.org and verify that scm_level_3 is reported there
  • log into https://prod.testrp.security.allizom.org/ and check that active_scm_level_3 is listed under HTTP_OIDC_CLAIM_USER_PROFILE_HTTPS://SSO_MOZILLA_COM/CLAIM/GROUPS

If you used to be a volunteer and are now an employee, you likely have two LDAP accounts, and you may not have your commit access associated with the account you used to log into Lando. See the next FAQ entry.

Otherwise, contact Service Desk, as it indicates a misconfiguration with your account.

My SCM level is bound to a different LDAP account from my Mozilla one. How do I log into Lando to land changes?

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 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.

Lando says "This diff does not have the proper author information uploaded to Phabricator", but I see an author on Phabricator. What's wrong?

There are a few reasons this could happen:

  • The revision was created via the Phabricator Web UI or via an unsupported client.
  • 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 .hgrc file (or git config). Set your author email in your .hgrc to your username, Firstname Lastname <yourldapemail@mozilla.com>. Update your commit so it contains the new author data. Re-run arc diff so that the new commit+data is uploaded to Phabricator.
  • You are attempting to re-land a revision but Bug 1489126 happens
    • 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.