-
Notifications
You must be signed in to change notification settings - Fork 0
Work Flow Instructions (Phabricator & Arcanist)
The following is a set of instructions to be followed when working with arcanist. The symbol '$' suggests for terminal. Anything after the '$' are commands that you should run on your terminal. The '>' symbol represents expected output after command is entered. Branch name used in this example should be changed to reflect your work.
- Only one branch will be kept in git
-
Verify that you are currently on master
$ git branch
master
-
Get the latest changes
$ git pull
-
Create a new branch that will contain your changes In this example: let’s pretend Araceli is adding styling to our code. :) Create a branch that will start with initials followed by a description of what the code will contain separated by underscores.
$ git checkout -b ag_adding_styling_with_css
-
After this you will be in the newly created branch. If you want to be sure you could do so by running
$ git branch
ag_adding_styling_with_css
-
Once inside the newly created branch, start adding your changes
-
Once done and ready to make a revision on Phabricator,
$ git add .
Commit your code with a descriptive message $ git commit -m “Adding styling to webapp with css”
In order to send to Phabricator, $ arc diff
At this point you will face a text editor with some content as:
--------------------------------------------------------------------
<<Replace this line with your revision title>
Summary:
Test Plan:
Reviewers:
Subscribers:
# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
# $ arc diff --update <revision>
--------------------------------------------------------------------
- Add a summary that describes your changes.
- Add a test plan -A test plan is a step by step guidance that the reviewer would follow in order to determine that your code works properly.
###NOTE FOR REVIEWER: - Always try to test code deeply - Try to find something that might not work - Request changes if necessary - Comment on code
- Add Reviewers
- Just for practice add everybody in the team :)
- Only most knowledgeable person should accept though
- Subscribers
- Subscribers are people that should be notified of a change
- For now let’s leave it blank
- Here’s an example of how Araceli’s changes could look in this case:
-
FYI: In test plan I mentioned Patch. Patching pretty much copies the code on phabricator to your local machine for test purpose locally. Every diff will have a D#. For example Gabriel’s diff https://imagengine.phacility.com/D3 has a D3. If I wanted to patch Gabriel’s code I would run: $ arc patch D3
-
Notice that patching code will create a new branch that begins with arcpatch… After you are done patching you can delete this branch. To delete patch branch:
$ git checkout master $ git branch -D branchName
-
Diff Example:
--------------------------------------------------------------------
<<Replace this line with your revision title>
Summary:
Adding styling to ImagEngine web app
Test Plan:
Patch to ImagEngine
Npm start
Upload an image
Verify that the image size stays within the square boundary
etc..
Reviewers:
benfallas
Subscribers:
# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
# $ arc diff --update <revision>
--------------------------------------------------------------------
Once this diff is ready to go, save and close the text editor. Arcanist will continue and post your review to phabricator. A link will be provided. If you open the browser to the link, You will see your review. Reviewers will be notified via email associated with Phabricator account.
Verify that you are in the same branch
$ git branch
> ag_adding_styling_with_css
Add changes requested by the reviewer After all the changes are met:
-
Save changes $ git add .
-
Ammend changes to same commit since these changes are related to previous commit message
$ git commit --amend
-
Update revision
$ arc diff
Notice that this will open a text editor (most likely nano) with all the fields already filled from last diff.
- Close the text editor
- Arcanist will continue and update revision on phabricator.
You can land your changes. Landing means merging your local branch to the local master branch and pushing to master. You may get merge conflict. :)
-
In order to land run:
$ arc land
At this point, arcanist will try to merge your code with your local master. If no merge conflicts occur, it will go ahead and try to merge with server’s master.
NOTE
- Two merge conflicts are possible. :)
- I would recommend pulling from master while on master branch before landing to avoid possible conflict two times.