]> khamidou — GitHub mirrors - arcanist.git/log
arcanist.git
9 years ago(stable) Promote 2017 Week 1 stable
epriestley [Sat, 7 Jan 2017 01:01:33 +0000 (17:01 -0800)]
(stable) Promote 2017 Week 1

9 years agoFix a bad interaction between "arc diff --reviewers" and "the first line of a message... master
epriestley [Thu, 5 Jan 2017 21:55:34 +0000 (13:55 -0800)]
Fix a bad interaction between "arc diff --reviewers" and "the first line of a message is always a title"

Summary:
Fixes T12069. We implement "arc diff --reviewers" (and "--cc") by parsing a faux message with "Reviewers: ...".

After D17122, the first line of the message is always interpreted as a title, so the text ends up in the message body.

Instead, use a placeholder title so these fields are never initial fields.

Test Plan: Ran `arc diff --reviewers dog`, got only one "Reviewers" field.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12069

Differential Revision: https://secure.phabricator.com/D17147

9 years ago(stable) Promote 2016 Week 53
epriestley [Fri, 30 Dec 2016 22:49:40 +0000 (14:49 -0800)]
(stable) Promote 2016 Week 53

9 years agotighten remote URI error handling with idiosyncratic remote names
Chris Burroughs [Wed, 28 Dec 2016 22:43:18 +0000 (17:43 -0500)]
tighten remote URI error handling with idiosyncratic remote names

Summary:
`git ls-remote` has an unusual way to indicate a URL was not
found: echoing back user input
```
$ git ls-remote --get-url does_not_exist
does_not_exist
$ echo $?
0

```

`getRemoteURI` handles checking for remotes other than 'origin', but
the error handling always matched against the string 'origin'
regardless of remote name.

Test Plan:
With a git config along the lines of:
```
[remote "my_special_name"]
        url = ssh://secure@secure.phabricator.com/diffusion/ARC/arcanist.git
        fetch = +refs/heads/*:refs/remotes/my_special_name/*
[branch "master"]
        remote = github
        merge = refs/heads/master
[remote "github"]
         # url = git@github.com:phacility/arcanist.git
         fetch = +refs/heads/*:refs/remotes/github/*
```

and running in a branch tracking `master` (github).  `arc which` would
(without this diff) show:
```
The remote URI for this working copy is "github".
```
With this diff, `arc which` correctly shows:
```
Unable to determine the remote URI for this repository.
```

When diffing against a tracking branch with a propertly configured
remote (the happy path), `arc which` still correctly identifies the
remote URI:
```
The remote URI for this working copy is
"ssh://secure@secure.phabricator.com/diffusion/ARC/arcanist.git".
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, chad, epriestley

Differential Revision: https://secure.phabricator.com/D17110

10 years ago(stable) Promote 2016 Week 43
epriestley [Fri, 21 Oct 2016 23:10:48 +0000 (16:10 -0700)]
(stable) Promote 2016 Week 43

10 years agoMake "aliases" show up in "arc get-config" help
epriestley [Fri, 21 Oct 2016 21:43:13 +0000 (14:43 -0700)]
Make "aliases" show up in "arc get-config" help

Summary: Fixes T11758. This was one some spooky magic but is more-or-less a normal config setting now.

Test Plan:
  - Ran `arc get-config`, saw help about "aliases".
  - Ran `arc set-config aliases`, saw guidance about using `arc alias`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11758

Differential Revision: https://secure.phabricator.com/D16745

10 years agoFix an DOMDocument error with NoseTestEngine running on PHP 7
Mukunda Modell [Wed, 5 Oct 2016 20:19:15 +0000 (15:19 -0500)]
Fix an DOMDocument error with NoseTestEngine running on PHP 7

Summary:
In php 7, DOMDocument::loadXML emits an error when supplied with
an empty string as input. For example, I got this error:

  ERROR 2: DOMDocument::loadXML(): Empty string supplied as input

This change simply checks for empty and returns an empty array
rather than attempting to parse an empty xml document.

Test Plan: ran `arc diff` on a repo that uses nosetestengine

Reviewers: #blessed_reviewers!

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D16672

10 years ago(stable) Promote 2016 Week 41
epriestley [Sun, 9 Oct 2016 13:30:50 +0000 (06:30 -0700)]
(stable) Promote 2016 Week 41

10 years agoDon't compute intraline diffs if the input fails a coarse check for being huge
epriestley [Fri, 7 Oct 2016 14:27:48 +0000 (07:27 -0700)]
Don't compute intraline diffs if the input fails a coarse check for being huge

Summary:
Fixes T11744. Because intraline diffs are expensive to generate, we already bail out and decline to generate them for very long lines.

However, we currently split the inputs into lists of characters first, then check how long they are and make a decision to bail. For //huge// inputs (e.g., 1MB+), this is too late: just splitting them has a large CPU/RAM cost.

(These inputs are rare in normal source, but can appear in, e.g., JSON files written without newlines.)

Instead, add an extra "are the inputs really huge?" check first, and bail early if they are.

Test Plan:
  - Generated a 1MB "change a file full of Q to a file full of R" diff.
  - Before change: purged changeset cache; took about 7 seconds to load.
  - After change: purged changeset cache; took about 1 second to load.
  - Viewed some normal diffs to make sure intraline edits still displayed correctly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11744

Differential Revision: https://secure.phabricator.com/D16683

10 years ago(stable) Promote 2016 Week 39
epriestley [Sat, 24 Sep 2016 00:20:29 +0000 (17:20 -0700)]
(stable) Promote 2016 Week 39

10 years agoCheck both UNIX- and Windows-style paths from linter output
Alex Vandiver [Tue, 20 Sep 2016 21:48:06 +0000 (14:48 -0700)]
Check both UNIX- and Windows-style paths from linter output

Summary:
Paths are passed into linters using UNIX-style slashes (/), as returned from the version control system; however,
`Filesystem::readablePath` swaps them to Windows-style (\) on
Windows when storing the names of the files with lint messages.  This causes no lint message's path to match the set of
changed files, and thus no lint warnings are ever produced.

If a lint message's file is not found using the provided filename, also try looking up the UNIX-style filename, on Windows when determining if a lint mesage is "relevant."

Fixes T11248.

Test Plan: Ran `arc lint` on Windows.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Maniphest Tasks: T11248

Differential Revision: https://secure.phabricator.com/D16579

10 years ago(stable) Promote 2016 Week 35
epriestley [Sat, 27 Aug 2016 00:30:31 +0000 (17:30 -0700)]
(stable) Promote 2016 Week 35

10 years agoAdded a warning prompt if the user tries to use an API cert instead of a CLI cert
Josh Cox [Thu, 25 Aug 2016 15:30:01 +0000 (11:30 -0400)]
Added a warning prompt if the user tries to use an API cert instead of a CLI cert

Summary: Fixes T9692. Instead of disallowing API tokens entirely, we're going to just warn the user that they might not want to do that. After that, they can proceed if they want to.

Test Plan:
Run arc install-certificate.
Manually go to `Settings → Conduit API Tokens` in the web UI.
Generate an API token explicitly, which should have the form api-******.
Paste that into the prompt on the CLI.
It will give you a warning prompt then ask if you'd like to proceed anyway (defaults to No).

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T9692

Differential Revision: https://secure.phabricator.com/D16448

10 years ago(stable) Promote 2016 Week 34
epriestley [Sat, 20 Aug 2016 23:01:47 +0000 (16:01 -0700)]
(stable) Promote 2016 Week 34

10 years agoUpdate documentation for changed splitGitDiffPaths function
Alex Vandiver [Fri, 19 Aug 2016 21:23:15 +0000 (14:23 -0700)]
Update documentation for changed splitGitDiffPaths function

Summary:
The behavior (and name) of this function was changed in
D16405, but the documentation was not updated to reflect the new
contract.

Test Plan: Untested; pure doc changes.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16425

10 years agoAvoid double [y/N] when updating a not owned revision
Luke081515 [Wed, 17 Aug 2016 17:36:16 +0000 (10:36 -0700)]
Avoid double [y/N] when updating a not owned revision

Summary:
Since 737f5c0df976fe2b3178aac6ab7feb3d3621d99e arcanist shows [y/N] two times, when arcanist asks you, if you want to proceed, if you want to update a not owned revision. Ths patch fixes
that, so that Arcanist shows [y/N] only once, like at other situations, when Arcanist asks you a question.
Ref T11489

Test Plan: Updated a not owned revision.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Tags: #arcanist

Maniphest Tasks: T11489

Differential Revision: https://secure.phabricator.com/D16415

10 years agoFix handling of View Policy in CLI upload workflow for small, unique files
epriestley [Wed, 17 Aug 2016 13:55:48 +0000 (06:55 -0700)]
Fix handling of View Policy in CLI upload workflow for small, unique files

Summary:
Ref T7148. When uploading files from the CLI with a particular view policy, we may not respect it if the file is unique (so the data isn't already known) and small (so it doesn't invoke the chunker).

This is rare (and may never have happened outside of testing) because:

  - production dumps are always larger than the minimum chunk size;
  - only cluster stuff uses `setViewPolicy()`;
  - the default policy is "Administrators" anyway, which is safe.

However, I caught it in local testing, so fix it up.

Test Plan: Used `bin/host upload --file ...` to upload a small, unique file. Verified it uploaded with the correct custom view policy ("No One") rather than the default view policy ("Administrators").

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7148

Differential Revision: https://secure.phabricator.com/D16408

10 years agoParse git renames with inconsistent quoting or custom prefixes
Alex Vandiver [Tue, 16 Aug 2016 20:38:28 +0000 (13:38 -0700)]
Parse git renames with inconsistent quoting or custom prefixes

Summary:
The previous parser failed when only one of the old/new filenames was
quoted, as with a rename of a Unicode filename to a non-Unicode
filename, or vice versa.  It also incorrectly parsed custom prefixes,
even going to far as to encode this logic in the tests: a diff of
"src/file dst/file" which is not a rename should not be recorded as
changing "src/file", but rather "file".

Switch to using the "rename from" / "rename to" as the source of truth
for old and current filenames when complex renames are done.  This
matches the logic that git itself uses to parse patches; the contents
of the `diff --git` line are merely viewed as a simplest-case
prediction, with renames handled later should it not match.

The diff parser already had logic to parse "rename from" / "rename to"
lines and extract their information.  As such, this diff consists
primarily of removing logic from the `splitGitDiffPaths` method, and
allowing it to quietly fail.

This resolves two ambiguity mentioned in comments and tests: in
renaming "old file old" to "file", as well as the renaming of
"old file with spaces" to "new file with spaces" when neither are
quoted.

Test Plan:
`arc unit`.  Many of the existing test cases no longer
applied to the `splitGitDiffPaths` method; they were moved into a new
test method which also supplies values for "rename from" and "rename
to" lines.

As noted in the summary, this alters one of the expected values of an
existing test.  Specifically, the following diff is a file addition of
`file` with custom prefixes, and not the addition of "dst/file":

```
diff --git src/file dst/file
new file mode 100644
index 0000000..1269488
--- /dev/null
+++ dst/file
@@ -0,0 +1 @@
+data
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D16405

10 years agoCorrectly parse file renames and copies from `git diff --raw`
Alex Vandiver [Wed, 10 Aug 2016 21:32:37 +0000 (14:32 -0700)]
Correctly parse file renames and copies from `git diff --raw`

Summary:
`parseGitRawDiff` dealt with the `A`, `M`, and `D` status flags from
`git diff --raw`, for file additions, modifications, and deletions
respectively.  However, it failed to cope with `C` and `R` flags, for
copies and renames.  Git version 2.9 and above default to resolving
renames, even in `git diff --raw` output, making this lack of support
only salient now (though users with Git's `diff.rename` set
encountered it previously).

Those two flags differ from the other three in that they offer both the
source and destination filename, separated by a tab.  As
`parseGitRawDiff` was not aware of this property, it returned a
"filename" of `"oldfile\tnewfile"`.  This is surfaced in several
places, including as passed to linters as a filename to check.
Needless to say, this file is nearly guaranteed to never exist on
disk.

Detect both the `C` and `R` flag types, and generate either a file
addition, or a pair of addition/deletion entries.

Test Plan:
Renamed a file, with a linter that printed each file it was
called with.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: jboning, Korvin

Differential Revision: https://secure.phabricator.com/D16387

10 years ago(stable) Promote 2016 Week 32
epriestley [Sat, 6 Aug 2016 21:39:50 +0000 (14:39 -0700)]
(stable) Promote 2016 Week 32

10 years agoUse --no-ext-diff in `arc land` call to `git diff`
epriestley [Sat, 6 Aug 2016 13:37:23 +0000 (06:37 -0700)]
Use --no-ext-diff in `arc land` call to `git diff`

Summary:
Fixes T11435. This isn't a perfect solution since there's a little code duplication, but a perfect solution is probably a bit more involved.

See T11435 for some discussion. In particular, most `git diff` commands already get this flag via `ArcanistGitAPI->getDiffBaseOptions()`.

Test Plan: Will land this change.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11435

Differential Revision: https://secure.phabricator.com/D16375

10 years agoSet "history.immutable" to "false" explicitly in .arcconfig in Arcanist
epriestley [Wed, 3 Aug 2016 15:06:09 +0000 (08:06 -0700)]
Set "history.immutable" to "false" explicitly in .arcconfig in Arcanist

Summary: Depends on D16364. See that revision for discussion.

Test Plan: Ran `arc get-config history.immutable` in `arcanist/`, saw setting.

Reviewers: chad, fooishbar

Reviewed By: fooishbar

Differential Revision: https://secure.phabricator.com/D16365

10 years agoAdd a lint error about use of PHP short array syntax ('[...]')
epriestley [Mon, 1 Aug 2016 11:24:13 +0000 (04:24 -0700)]
Add a lint error about use of PHP short array syntax ('[...]')

Summary: Ref T11409. Add lint to detect using `[...]` to define arrays. This doesn't work in PHP 5.2/5.3, which some of our users run.

Test Plan:
  - Ran `arc unit`.
  - Ran `arc lint src/applications/harbormaster/conduit/HarbormasterQueryBuildsConduitAPIMethod.php` to detect the issue in T11409.

Reviewers: yelirekim, chad

Reviewed By: chad

Maniphest Tasks: T11409

Differential Revision: https://secure.phabricator.com/D16357

10 years ago(stable) Promote 2016 Week 31
epriestley [Sat, 30 Jul 2016 12:34:53 +0000 (05:34 -0700)]
(stable) Promote 2016 Week 31

10 years agoRemove command spelling correction from Arcanist
epriestley [Wed, 27 Jul 2016 12:39:39 +0000 (05:39 -0700)]
Remove command spelling correction from Arcanist

Summary: Fixes T7489. Depends on D16332, which moved this code to libphutil.

Test Plan:
```
$ arc banch --bystatus
(Assuming 'banch' is the British spelling of 'branch'.)
(Assuming '--bystatus' is the British spelling of '--by-status'.)
...
```

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7489

Differential Revision: https://secure.phabricator.com/D16333

10 years agoFixes help message for stop command
Rabah Meradi [Wed, 27 Jul 2016 12:42:07 +0000 (05:42 -0700)]
Fixes help message for stop command

Test Plan: arc help stop will display 'Stop tracking work...'

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: avivey, chad, epriestley

Differential Revision: https://secure.phabricator.com/D16310

10 years agoUse phutil functions to copy/move files
Alex Vandiver [Mon, 11 Jul 2016 20:39:57 +0000 (13:39 -0700)]
Use phutil functions to copy/move files

Summary:
The `cp` and `mv` commands, when run from a Windows
environment, error out.  Use library functions from `Filesystem`
for cross-platform compatibility.

Test Plan:
Ran `arc lint` with auto-fix lint errors on both Linux and
Windows.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Spies: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D16273

10 years ago(stable) Promote 2016 Week 27
epriestley [Fri, 1 Jul 2016 23:22:36 +0000 (16:22 -0700)]
(stable) Promote 2016 Week 27

10 years agoValidate Arcanist install-certificate URIs more carefully
epriestley [Tue, 28 Jun 2016 21:43:41 +0000 (14:43 -0700)]
Validate Arcanist install-certificate URIs more carefully

Summary: Fixes T11222. This was lazy-future-proofed for Conduit SSH support, but users are boundlessly creative. Check protocols explicitly.

Test Plan:
```
$ arc install-certificate a.b:1/
Usage Exception: Server URI "a.b:1/" must include the "http" or "https" protocol. It should be in the form "https://phabricator.example.com/".
```

  - Also went through a successful workflow with a URI in the form provided in the example.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11222

Differential Revision: https://secure.phabricator.com/D16188

10 years ago(stable) Promote 2016 Week 25
epriestley [Sat, 18 Jun 2016 16:23:54 +0000 (09:23 -0700)]
(stable) Promote 2016 Week 25

10 years agoRemove the "you have not specified reviewers" prompt from the `arc` client
epriestley [Fri, 17 Jun 2016 14:49:07 +0000 (07:49 -0700)]
Remove the "you have not specified reviewers" prompt from the `arc` client

Summary:
Ref T4631. Ref T10939. I don't have any good solutions here; this is perhaps the least-bad one.

  - This prompt is misleading/confusing in the presence of Herald/Owners.
  - This prompt is likely of very little value for experienced reviewers.
  - When it works, this prompt may be of some value for new reviewers, but getting it wrong is probably more confusing than getting it right is helpful, and there is a more accurate version of the warning in the web UI that new users are likely to see.
  - In the long run, this code should not live in the client.

Test Plan: Created this revision without specifying reviewers, probably didn't get prompted.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4631, T10939

Differential Revision: https://secure.phabricator.com/D16139

10 years ago(stable) Promote 2016 Week 24
epriestley [Sat, 11 Jun 2016 11:44:54 +0000 (04:44 -0700)]
(stable) Promote 2016 Week 24

10 years ago(stable) Promote 2016 Week 23
epriestley [Sat, 11 Jun 2016 11:29:00 +0000 (04:29 -0700)]
(stable) Promote 2016 Week 23

10 years agoUse an HTTPEngineExtension to implement "https.blindly-trust-domains" in Arcanist
epriestley [Thu, 9 Jun 2016 17:48:32 +0000 (10:48 -0700)]
Use an HTTPEngineExtension to implement "https.blindly-trust-domains" in Arcanist

Summary: Ref T10227. This converts weird hard-codey magic to the new HTTPEngineExtension.

Test Plan: See D16090.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10227

Differential Revision: https://secure.phabricator.com/D16091

10 years agoUse "internal" smoothing for code diffs in Arcanist
epriestley [Tue, 7 Jun 2016 20:44:45 +0000 (13:44 -0700)]
Use "internal" smoothing for code diffs in Arcanist

Summary: Ref T7643. This moves the prefix/suffix smoothing behavior back to the old one, which seems better for code diffs.

Test Plan: `arc unit --everything`

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16074

10 years agoUse EditDistanceMatrix diff smoothing in Arcanist
epriestley [Tue, 7 Jun 2016 15:22:03 +0000 (08:22 -0700)]
Use EditDistanceMatrix diff smoothing in Arcanist

Summary:
Ref T7643. We've done the smoothing from D16068 for a long time, it just wasn't part of EditDistanceMatrix.

Since it now is, call it instead of keeping a copy of the logic around.

Previously, the unit tests were testing un-smoothed diffs. Just have them test smoothed diffs instead, since nothing actually uses unsmoothed diffs.

Test Plan: Pasted a raw diff into the web UI, got a sensible inline diff for it.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16069

10 years agoDon't specify size 0 for deleted files
Aviv Eyal [Mon, 6 Jun 2016 20:51:16 +0000 (20:51 +0000)]
Don't specify size 0 for deleted files

Summary: See D15828 - arc is reporting file size as `0` for unexisting files - make it stop.

Test Plan: `arc diff` with empty, deleted, added files - see size reported as `null` when appropriate.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: chad, Korvin

Differential Revision: https://secure.phabricator.com/D16059

10 years agoRead arc aliases from all available configuration files
epriestley [Mon, 6 Jun 2016 19:34:02 +0000 (12:34 -0700)]
Read arc aliases from all available configuration files

Summary: Fixes T10431. Updates the getAliases() method to read every `arc` configuration file.

Test Plan:
Added an `arc duck` alias to `/etc/arcconfig`, ran `arc duck`, saw "quack".

Added an `arc pig` alias to `~/.arcrc` via `arc alias`, ran `arc pig`, saw "oink oink".

Reviewers: nevogd, chad, #blessed_reviewers

Reviewed By: chad, #blessed_reviewers

Subscribers: eadler, epriestley

Tags: #twitter

Maniphest Tasks: T10431

Differential Revision: https://secure.phabricator.com/D15342

10 years agoSVN buildSyntheticAdditionDiff: exit sooner if path is a directory
Allan Jude [Sun, 5 Jun 2016 22:12:46 +0000 (15:12 -0700)]
SVN buildSyntheticAdditionDiff: exit sooner if path is a directory

Summary:
When doing svn copy, or svn mv, a SynthenticAdditionDiff is generated.

If the path is a directory, an error will occur when checking the
mime-type of the directory. Immediately after the properties check,
the function returns null if the path is a directory. Move this
check to before the properties check to avoid exiting with an error.

```
Command failed with error #1!
COMMAND
svn propget 'svn:mime-type' '/home/trasz/svn/ports/cad/py-pycam'@

STDOUT
(empty)

STDERR
svn: warning: W200017: Property 'svn:mime-type' not found on '/home/trasz/svn/ports/cad/py-pycam@'
svn: E200000: A problem occurred; see other errors for details

(Run with `--trace` for a full exception trace.)
```

Test Plan: Created differentials of changes with `svn copy` and `svn mv`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Tags: #subversion

Differential Revision: https://secure.phabricator.com/D15985

10 years ago(stable) Promote 2016 Week 21
epriestley [Fri, 20 May 2016 23:24:48 +0000 (16:24 -0700)]
(stable) Promote 2016 Week 21

10 years agoFix `arc which` for svn repos
epriestley [Mon, 16 May 2016 12:54:37 +0000 (12:54 +0000)]
Fix `arc which` for svn repos

Summary:
`arc which` is currently broken for svn repos.

Fixes T6635

(I think I independently wrote an identical change to yours)

Test Plan: `∴../../p/arcanist/bin/arc which` on a svn repo.

Reviewers: aik099, epriestley, #blessed_reviewers

Reviewed By: aik099, epriestley, #blessed_reviewers

Subscribers: aik099, Korvin

Maniphest Tasks: T6635

Differential Revision: https://secure.phabricator.com/D15922

10 years ago(stable) Promote 2016 Week 18
epriestley [Sat, 30 Apr 2016 12:01:28 +0000 (05:01 -0700)]
(stable) Promote 2016 Week 18

10 years agoPrefer pip to easy_install
Eitan Adler [Fri, 29 Apr 2016 15:45:11 +0000 (15:45 +0000)]
Prefer pip to easy_install

Summary:
Prefer pip to easy_install
also fixes incorrect install instructions for closure linters

Fixes T10892
Ref T10038

Test Plan: inspection

Reviewers: avivey, #blessed_reviewers, epriestley, tjstum

Reviewed By: avivey, #blessed_reviewers, epriestley, tjstum

Subscribers: avivey, Korvin

Maniphest Tasks: T10038, T10892

Differential Revision: https://secure.phabricator.com/D15818

10 years agoWhen running XHPAST unit tests, include the "syntax error" lint rule
epriestley [Fri, 29 Apr 2016 12:59:24 +0000 (05:59 -0700)]
When running XHPAST unit tests, include the "syntax error" lint rule

Summary:
See rARC3ffed59bd7. Currently, when a unit test includes a syntax error, it is raised in an unclear way ("error at line 10, char 1: XHP1 Unknown lint message!").

This is because each test case only activates rules it wants to test, so we lose the ID/name for the syntax message. However, we always want to test this and the lint engine can always raise it.

To get a better error message, include it unconditionally. So a test for rule `X` really tests two rules: syntax, and `X`.

Test Plan:
Ran `arc unit` at HEAD, got a better test failure:

```
   FAIL  ArcanistCallTimePassByReferenceXHPASTLinterRuleTestCase::testLinter
In 'call-time-pass-by-reference.lint-test', expected lint to raise error on line 10 at char 8, but no error was raised. Actually raised:
  error at line 10, char 1: XHP1 PHP Syntax Error!
```

NOTE: This doesn't pass tests yet, it just makes the test failure easier to understand. I'll see about fixing the test in the next change.

Reviewers: chad, richardvanvelzen

Reviewed By: richardvanvelzen

Differential Revision: https://secure.phabricator.com/D15819

10 years agoUpdate xhpast linter rules for new function AST format
Richard van Velzen [Thu, 28 Apr 2016 14:59:50 +0000 (16:59 +0200)]
Update xhpast linter rules for new function AST format

Summary: See D15678. A node containing a return type hint is added right before the statement body node. This updates all relevant linter rules to now retrieve the body from the correct index.

Test Plan: Ran `arc unit --everything`, inspected every single message to make sure all xhpast test cases succeeded. Also grepped for `getChildByIndex(5` and `getChildOfType(5`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15814

10 years agoFix incorrect variable for linter standards
Joshua Spence [Fri, 29 Apr 2016 08:00:07 +0000 (08:00 +0000)]
Fix incorrect variable for linter standards

Summary: It is currently not possible to apply multiple linter standards because `$value` was used instead of `$standard`.

Test Plan: Was able to apply multiple linter standards.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: eadler, thaiphv, Korvin

Differential Revision: https://secure.phabricator.com/D15212

10 years agoRecognize error codes from Flake8 extensions
Jon Parise [Wed, 27 Apr 2016 20:48:46 +0000 (13:48 -0700)]
Recognize error codes from Flake8 extensions

Summary:
Flake8 extensions are allowed to use their own letter-prefixed codes. For
example, the flake8-debugger extension emits 'T002'-tagged messages.

This change relaxes getLintCodeFromLinterConfigurationKey() to also recognize
extension codes. Otherwise, attempting to configure message severities for
e.g. 'T002' would result in an exception.

Messages from extensions continue to default to ERROR severity, as they did
before this change.

Test Plan:
Successfully reduced the severity of 'T002' to a warning via .arclint:

    "severity": {
        "T002": "warning"
    }

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15810

10 years ago(stable) Promote 2016 Week 17
epriestley [Sat, 23 Apr 2016 00:09:59 +0000 (17:09 -0700)]
(stable) Promote 2016 Week 17

10 years agoImprove performance of `arc branch` in Git with many branches
epriestley [Sat, 16 Apr 2016 16:38:17 +0000 (09:38 -0700)]
Improve performance of `arc branch` in Git with many branches

Summary:
This is mostly just a personal quality-of-life fix. I run this command fairly often and having it return a little faster is nice.

This replaces a `git show` for each individual branch with a big `git for-each-ref` which we were already running anyway. This is quite a bit faster.

This command also occasionally hangs or segfaults for me while executing the huge pile of subprocesses. This is unreliable to reproduce, probably some bug in some PHP extension I have, and likely hard to narrow down, and this approach is better in every way anyway.

Test Plan:
  - Ran `arc branch` in Git, observed faster output (in my `phabricator/`, about 2000ms -> 1200ms).
  - Ran `arc feature` in Mercurial.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15735

10 years ago(stable) Promote 2016 Week 16
epriestley [Fri, 15 Apr 2016 23:42:29 +0000 (16:42 -0700)]
(stable) Promote 2016 Week 16

10 years agoAllow amending revisions without commandeering first
Mukunda Modell [Sat, 9 Apr 2016 16:47:09 +0000 (11:47 -0500)]
Allow amending revisions without commandeering first

Summary:
It is common practice in Wikimedia's projects to amend a contributor's
change without taking over authorship of the change. We found that
the only enforcement of commandeering before amending is in arcanist,
not validated server-side. While it would be fairly straightforward to
maintain this as a patch to arcanist, I thought I would see if upstream
is willing to support making this optional.

With this change, amending without commandeering is enabled by a flag in
`.arcconfig` and it defaults to the old behavior.

For background see [wmf T121751](https://phabricator.wikimedia.org/T121751)

Test Plan:
* ran `arc patch D146` to locally apply a revision that I did not author,
* made a trivial change and amended the commit.
* ran `arc diff --update D146 HEAD^` to send the update to differential
* Saw that https://phabricator.wikimedia.org/D146 updated as it should.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: greggrossmeier, aklapper, Luke081515.2, Korvin, dereckson

Maniphest Tasks: T10584

Differential Revision: https://secure.phabricator.com/D15468

10 years ago(stable) Promote 2016 Week 15
epriestley [Fri, 8 Apr 2016 23:36:15 +0000 (16:36 -0700)]
(stable) Promote 2016 Week 15

10 years agoStrip tips out of commit messages from `arc backout`
epriestley [Sat, 2 Apr 2016 13:28:11 +0000 (06:28 -0700)]
Strip tips out of commit messages from `arc backout`

Summary:
Fixes T10707. Currently, `arc backout` creates a commit message which includes questionably-helpful "tips" in the message itself.

Strip these out.

Test Plan:
Used `arc backout` to revert any commit, then `git show` to see the generated message.

  - Before patch: included tips.
  - After patch: no tips.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10707

Differential Revision: https://secure.phabricator.com/D15573

10 years ago(stable) Promote 2016 Week 12
epriestley [Sat, 19 Mar 2016 12:33:44 +0000 (05:33 -0700)]
(stable) Promote 2016 Week 12

10 years agoMake callsigns optional in arcanist
Aviv Eyal [Tue, 15 Mar 2016 03:58:46 +0000 (03:58 +0000)]
Make callsigns optional in arcanist

Summary:
Remove couple of references to callsigns:
- `arc which` now prints repository name
- `getShouldAmend()` can now use new format of commit name

a quick git-grep looks like the remaining references are all about `repository.callsign` config.

Ref T4245

Test Plan:
- `arc which` on a repository with no callsign
- trigger `requireCleanWorkingCopy()`, see both "Do you want to amend this change" and "Do you want to create a new commit" prompts.
- fire this diff with new code.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T4245

Differential Revision: https://secure.phabricator.com/D15472

10 years ago(stable) Promote 2016 Week 11
epriestley [Sat, 12 Mar 2016 19:29:47 +0000 (11:29 -0800)]
(stable) Promote 2016 Week 11

10 years agoWhen `arc` pushes to the staging area, tell Phabricator what we did
epriestley [Mon, 7 Mar 2016 15:13:11 +0000 (07:13 -0800)]
When `arc` pushes to the staging area, tell Phabricator what we did

Summary:
Ref T10093. Right now, Phabricator kind of guesses that `arc` probably pushed stuff to the staging area.

This can cause confusing/misleading errors later, if it didn't actually push.

Instead, tell Phabricator that we pushed, so we can raise more tailored messages in the web UI (e.g., make "Land Revision" say "this wasn't pushed to the staging area" instead of "whoops, error!!~").

Test Plan:
Ran `arc diff` a few times, then looked in the database for properties.

{F1161655}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10093

Differential Revision: https://secure.phabricator.com/D15426

10 years agoWhen pushing changes to staging, also push the base commit
epriestley [Mon, 7 Mar 2016 14:17:43 +0000 (06:17 -0800)]
When pushing changes to staging, also push the base commit

Summary:
Fixes T10509. Pushing changes to staging can be inefficient. What happens, roughly, is:

  - Master is at commit "W" -- "W" is the most recent published commit in the main repository.
  - The local working copy has one change on top of that, "X", so its history is commits "A, B, C, D, E, F, ..., U, V, W, X".
  - The remote has some other previous changes that I or other users have made, maybe like "A, B, C, ..., S, T, U, Y" and "A, B, C, ..., T, U, V, Z", from previous pushes to staging areas.
  - "X", "Y" and "Z" will never actually make it to master, because they'll be squash-merged/amended by `arc land`.

So the local says "I want to push 'X'", and the remote says "I know about 'Y' and 'Z', are those in the history of 'W'? You only need to send me new stuff if they are".

But they aren't, so the local says "nope, so here's the whole history for you". This is slow and sends a ton of data that the remote already has over the network.

In theory, Git could use a slightly different algorithm to tell the local about more commits, but this is hard, rarely useful, and not the kind of thing I'd be excited about changing if I was the Git upstream.

Instead, when pushing "X", also push "W", to trick Git into telling future clients about it.

Now, the remote should say "I know about 'W', 'Y' and 'Z'", and the local will say "oh, great, 'W' is in history, here's just the changes since then".

Also, fail `arc diff` if the push to staging fails, and tell users to use `--skip-staging`. This code has been in production for a while and doesn't seem to have any issues, and a failed push to staging prevents builds, lands, etc.

Test Plan:
  - Ran `arc diff`, saw two changes push.
  - Ran `arc diff --base arc:empty`, saw only one change push.
  - Ran `arc diff` with an intentionally broken staging area, saw an error.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10509

Differential Revision: https://secure.phabricator.com/D15424

10 years agoUse python2 instead of python in `arc anoid` shebang`
Eitan Adler [Sat, 5 Mar 2016 22:29:46 +0000 (14:29 -0800)]
Use python2 instead of python in `arc anoid` shebang`

Summary:
With the old shebang of `#!/usr/bin/env python` on machines with python 3 as the default python it would fail.
Prefer an explicit python2 like PEP 394 suggests.

Test Plan: ran ./arc anoid and played a game

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15408

10 years ago(stable) Promote 2016 Week 10
epriestley [Sat, 5 Mar 2016 01:25:08 +0000 (17:25 -0800)]
(stable) Promote 2016 Week 10

10 years agoProperly URL encode branches in `arc browse --branch ...`
epriestley [Fri, 4 Mar 2016 23:49:35 +0000 (15:49 -0800)]
Properly URL encode branches in `arc browse --branch ...`

Summary: Fixes T10511. If you `arc browse --branch x/y/z`, we do not encode the URI properly.

Test Plan:
Ran `arc browse --branch x/y/z/ something.c`.

Before, got an error about "x" does not exist. This is wrong; the error should be about "x/y/z".

After, got the proper error:

{F1141096}

Reviewers: chad, avivey

Reviewed By: avivey

Maniphest Tasks: T10511

Differential Revision: https://secure.phabricator.com/D15397

10 years agoReport unit test details from Arcanist to Harbormaster
epriestley [Mon, 29 Feb 2016 16:02:37 +0000 (08:02 -0800)]
Report unit test details from Arcanist to Harbormaster

Summary: Ref T10457. Provides information for D15363.

Test Plan: See D15363.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9951, T10457

Differential Revision: https://secure.phabricator.com/D15364

10 years ago(stable) Promote 2016 Week 9
epriestley [Sat, 27 Feb 2016 12:18:18 +0000 (04:18 -0800)]
(stable) Promote 2016 Week 9

10 years agoFilter out some Clover coverage to prevent false positives
Eric Stern [Wed, 24 Feb 2016 20:48:37 +0000 (12:48 -0800)]
Filter out some Clover coverage to prevent false positives

Summary: Clover reports generated from PHPUnit sometimes give false positives of lines that were not covered by a test that should have actually been not coverable, apparently due to inaccurate static analysis of files that weren't actually executed. This filters coverage reports of files that show no coverage which avoids these false positives. Fixes T10420.

Test Plan:
Looked at coverage reports of files before and after the change

Before: {F1124115}

After: {F1124113}

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, aurelijus

Maniphest Tasks: T10420

Differential Revision: https://secure.phabricator.com/D15343

10 years ago(stable) Promote 2016 Week 7
epriestley [Sat, 13 Feb 2016 00:22:29 +0000 (16:22 -0800)]
(stable) Promote 2016 Week 7

10 years agoAdd --quiet to `git fetch` on `arc land`
epriestley [Wed, 10 Feb 2016 21:08:46 +0000 (13:08 -0800)]
Add --quiet to `git fetch` on `arc land`

Summary: This makes it a bit quieter.

Test Plan: shh

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15236

10 years agoUse passthru to run `git fetch` in `arc land` so password prompts work
epriestley [Wed, 10 Feb 2016 14:23:01 +0000 (06:23 -0800)]
Use passthru to run `git fetch` in `arc land` so password prompts work

Summary:
Fixes T10314. In `arc land`, we currently run `git fetch` as a subprocess.

However, this can prevent password prompts (when fetching over HTTP with basic authentication) from working properly.

Instead, use passthru to redirect stdin/stdout to the subprocess so the user can type their password.

This adds a little extra clutter to the `arc land` output but I think that's OK.

Test Plan: See T10314, @maxie confirmed this fixes the issue.

Reviewers: chad

Reviewed By: chad

Subscribers: maxie

Maniphest Tasks: T10314

Differential Revision: https://secure.phabricator.com/D15233

10 years ago(stable) Promote 2016 Week 5
epriestley [Sat, 30 Jan 2016 00:43:24 +0000 (16:43 -0800)]
(stable) Promote 2016 Week 5

10 years agoMake `arc unit` NoseTestEngine work in a sub-dir arcpatch-D14363
Mukunda Modell [Mon, 25 Jan 2016 10:15:28 +0000 (04:15 -0600)]
Make `arc unit` NoseTestEngine work in a sub-dir

Summary:
D14362 didn't actually work in a subdirectory.

This globs the tests/ directory to find test_*.py, now you get
more than just a coverage report when running `arc unit --everything`
whether it's run from the project root or a subdirectory.

Test Plan:
ran `arc unit --everything` from project root and also ran it from
a sub-directory.

```
$ arc unit --everything
   PASS    1ms★  test_log.FilterTest.test_filter_can_invert_behavior
   PASS    1ms★  test_log.FilterTest.test_filter_filters_matching
   PASS   <1ms★  test_log.FilterTest.test_filter_filters_matching_lambda
   PASS    1ms★  test_log.FilterTest.test_filter_filters_matching_regex
   PASS    3ms★  test_log.FilterTest.test_filter_loads
   PASS    2ms★  test_log.FilterTest.test_filter_loads_filters_correctly
   PASS   <1ms★  test_log.FilterTest.test_filter_loads_supports_numeric_comparisons
   PASS    1ms★  test_log.FilterTest.test_filter_parse
   PASS    1ms★  test_log.JSONFormatterTest.test_format_includes_all_serializable_logrecord_fields
   PASS    1ms★  test_log.JSONFormatterTest.test_format_includes_exceptions_as_text
   PASS   <1ms★  test_log.JSONFormatterTest.test_format_includes_extra_fields
   PASS    1ms★  test_log.JSONFormatterTest.test_make_record
   PASS    1ms★  test_nrpe.NRPETest.test_load
   PASS   <1ms★  test_nrpe.NRPETest.test_registered_check
   PASS   <1ms★  test_nrpe.NRPETest.test_unregistered_check
   PASS   <1ms★  test_ssh.JSONOutputHandlerTest.test_accept_ignores_bad_json
   PASS   <1ms★  test_ssh.JSONOutputHandlerTest.test_accept_parses_and_logs_json_messages
   PASS   <1ms★  test_ssh.JSONOutputHandlerTest.test_lines_buffers_partial_lines
   PASS    4ms★  test_checks.ChecksConfigTest.test_custom_type
   PASS    2ms★  test_checks.ChecksConfigTest.test_load_bad_type
   PASS    5ms★  test_checks.ChecksConfigTest.test_load_valid_config
   PASS   19ms★  test_checks.ChecksExecuteTest.test_execute
   PASS  222ms   test_checks.ChecksExecuteTest.test_execute_concurrency
   PASS   18ms★  test_checks.ChecksExecuteTest.test_execute_failure
   PASS   15ms★  test_checks.ChecksExecuteTest.test_execute_timeout
   PASS   <1ms★  test_utils.UtilsTest.test_check_php_opening_tag
   PASS    3ms★  test_utils.UtilsTest.test_check_target_hosts
   PASS    1ms★  test_utils.UtilsTest.test_check_valid_json_file
   PASS   <1ms★  test_utils.UtilsTest.test_get_env_specific_filename
```

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14363

10 years agoMerge branch 'NoseTestEverything'
Mukunda Modell [Mon, 25 Jan 2016 10:13:51 +0000 (04:13 -0600)]
Merge branch 'NoseTestEverything'

10 years agoAdd support for '--everything' in NoseTestEngine
Mukunda Modell [Mon, 25 Jan 2016 10:07:43 +0000 (04:07 -0600)]
Add support for '--everything' in NoseTestEngine

Summary: Adds support for running all unit tests with NoseTestEngine.

Test Plan:
`ran arc unit --everything` and got unit test results

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: joshuaspence, Korvin

Differential Revision: https://secure.phabricator.com/D14362

10 years ago(stable) Promote 2016 Week 3
epriestley [Fri, 15 Jan 2016 17:10:00 +0000 (09:10 -0800)]
(stable) Promote 2016 Week 3

10 years agoCleans up some minor issues in cpplint
Michael Akinde [Fri, 15 Jan 2016 16:19:23 +0000 (08:19 -0800)]
Cleans up some minor issues in cpplint

Summary:
- Corrected typo in install instructions
- Sets the default binary to cpplint.py

Test Plan:
- Running the unit tests.

You may need to check your test environment is set up with the latest
cpplint.py available, since the default binary is being changed.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T10157

Differential Revision: https://secure.phabricator.com/D15030

10 years agoMinor fixes to arcanist cpplint
Michael Akinde [Thu, 14 Jan 2016 14:59:10 +0000 (06:59 -0800)]
Minor fixes to arcanist cpplint

Summary:
This fixes the regex in "getLintCode..." so that it accepts lint
codes such as `build/c++11` which have become valid lint codes
in later versions of cpplint.

It also corrects the install instructions for the linter (Google's
style guide is no longer available on SVN and has been migrated to
Github).

Test Plan:
For the Regex:
- Create an .arclint in a project such as:
```
{
  "linters": {
    "cpplint": {
      "type": "cpplint",
      "severity": {
        "build/c++11": "advice"
      }
    }
  }
}
```
- Run `arc lint` with the existing linter. This should fail. Patch the linter, and this should now be accepted.

For the Instructions
- Verify the download location `wget https://raw.github.com/google/styleguide/gh-pages/cpplint/cpplint.py`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T10118

Differential Revision: https://secure.phabricator.com/D15019

10 years agoIf the Script-and-Regex linter captures no "line" text, treat the message as affectin...
epriestley [Tue, 12 Jan 2016 01:18:58 +0000 (17:18 -0800)]
If the Script-and-Regex linter captures no "line" text, treat the message as affecting the entire file

Summary: Fixes T10124.

Test Plan:
Added this "linter" to `.arclint`:

```
    "thing": {
      "type": "script-and-regex",
      "script-and-regex.script": "echo every file is very bad #",
      "script-and-regex.regex": "/^(?P<message>.*)/"
    }
```

...to produce this diff. Also made a variant of it which matches lines to make sure that still works.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10124

Differential Revision: https://secure.phabricator.com/D15000

10 years ago(stable) Promote 2016 Week 2
epriestley [Sat, 9 Jan 2016 00:38:50 +0000 (16:38 -0800)]
(stable) Promote 2016 Week 2

10 years agoFix cpplint message regex
John Allen [Wed, 6 Jan 2016 21:15:09 +0000 (13:15 -0800)]
Fix cpplint message regex

Summary:
ref T8404

The issue is caused, not by the non-zero return code, but by the fact that
$messages is coming back empty due to the incorrect regex. tyhoff pointed out
that the regex matched correctly when we used STDIN, but now it is failing.

https://secure.phabricator.com/diffusion/ARC/browse/master/src/lint/linter/ArcanistExternalLinter.php;8c589f1f759f0913135b8cc6959a6c1589e14ae4$357

Test Plan:
arc lint cpp file containing lint error. run cpplint on the
file directly to confirm that there are errors and that the return code
is non-zero

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T8404

Differential Revision: https://secure.phabricator.com/D14960

10 years ago(stable) Fix `arc diff --raw` with "onto" target properties
epriestley [Tue, 5 Jan 2016 18:10:06 +0000 (10:10 -0800)]
(stable) Fix `arc diff --raw` with "onto" target properties

Summary:
Currently, `git show | arc diff --raw` and similar doesn't work because we try to figure out what the "Branch: feature (branched from whatever)" value is, which doesn't make sense.

```
$ git show | arc diff --raw --trace
 ARGV  '/Users/epriestley/dev/core/lib/arcanist/bin/../scripts/arcanist.php' 'diff' '--raw' '--trace'
 LOAD  Loaded "phutil" from "/Users/epriestley/dev/core/lib/libphutil/src".
 LOAD  Loaded "arcanist" from "/Users/epriestley/dev/core/lib/arcanist/src".
Config: Reading user configuration file "/Users/epriestley/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Users/epriestley/dev/core/lib/arcanist/.arcconfig".
Working Copy: Path "/Users/epriestley/dev/core/lib/arcanist" is part of `git` working copy "/Users/epriestley/dev/core/lib/arcanist".
Working Copy: Project root is at "/Users/epriestley/dev/core/lib/arcanist".
Config: Reading local configuration file "/Users/epriestley/dev/core/lib/arcanist/.git/arc/config"...
Loading phutil library from '/Users/epriestley/dev/core/lib/arcanist/src'...
>>> [0] <conduit> conduit.connect() <bytes = 489>
>>> [1] <http> https://secure.phabricator.com/api/conduit.connect
<<< [1] <http> 211,217 us
<<< [0] <conduit> 212,001 us
>>> [2] <event> diff.didCollectChanges <listeners = 0>
<<< [2] <event> 140 us
>>> [3] <event> diff.didBuildMessage <listeners = 0>
<<< [3] <event> 46 us
Reading diff from stdin...
>>> [4] <conduit> differential.creatediff() <bytes = 10,542>
>>> [5] <http> https://secure.phabricator.com/api/differential.creatediff
<<< [5] <http> 120,215 us
<<< [4] <conduit> 120,411 us
>>> [6] <event> diff.wasCreated <listeners = 0>
<<< [6] <event> 41 us
 SKIP STAGING  Raw changes can not be pushed to a staging area.
>>> [7] <conduit> harbormaster.queryautotargets() <bytes = 290>
>>> [8] <http> https://secure.phabricator.com/api/harbormaster.queryautotargets
<<< [8] <http> 217,717 us
<<< [7] <conduit> 217,944 us
>>> [9] <conduit> harbormaster.sendmessage() <bytes = 274>
>>> [10] <http> https://secure.phabricator.com/api/harbormaster.sendmessage
>>> [11] <conduit> harbormaster.sendmessage() <bytes = 274>
>>> [12] <http> https://secure.phabricator.com/api/harbormaster.sendmessage
<<< [10] <http> 123,821 us
<<< [9] <conduit> 134,329 us
<<< [12] <http> 227,580 us
<<< [11] <conduit> 227,787 us

[2016-01-05 10:08:58] EXCEPTION: (Exception) This workflow ('ArcanistDiffWorkflow') requires a Repository API, override requiresRepositoryAPI() to return true. at [<arcanist>/src/workflow/ArcanistWorkflow.php:804]
arcanist(head=master, ref.master=b3e68c9f1793), phutil(head=stable, ref.master=adb8a9c074ba, ref.stable=7b8d38cd2d4e)
  #0 ArcanistWorkflow::getRepositoryAPI() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2421]
  #1 ArcanistDiffWorkflow::getDiffOntoTargets() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2411]
  #2 ArcanistDiffWorkflow::updateOntoDiffProperty() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:534]
  #3 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:392]
```

Test Plan: Ran `arc diff --raw` in `phabricator/`.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14946

10 years agoFix `arc diff --raw` with "onto" target properties
epriestley [Tue, 5 Jan 2016 18:10:06 +0000 (10:10 -0800)]
Fix `arc diff --raw` with "onto" target properties

Summary:
Currently, `git show | arc diff --raw` and similar doesn't work because we try to figure out what the "Branch: feature (branched from whatever)" value is, which doesn't make sense.

```
$ git show | arc diff --raw --trace
 ARGV  '/Users/epriestley/dev/core/lib/arcanist/bin/../scripts/arcanist.php' 'diff' '--raw' '--trace'
 LOAD  Loaded "phutil" from "/Users/epriestley/dev/core/lib/libphutil/src".
 LOAD  Loaded "arcanist" from "/Users/epriestley/dev/core/lib/arcanist/src".
Config: Reading user configuration file "/Users/epriestley/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Users/epriestley/dev/core/lib/arcanist/.arcconfig".
Working Copy: Path "/Users/epriestley/dev/core/lib/arcanist" is part of `git` working copy "/Users/epriestley/dev/core/lib/arcanist".
Working Copy: Project root is at "/Users/epriestley/dev/core/lib/arcanist".
Config: Reading local configuration file "/Users/epriestley/dev/core/lib/arcanist/.git/arc/config"...
Loading phutil library from '/Users/epriestley/dev/core/lib/arcanist/src'...
>>> [0] <conduit> conduit.connect() <bytes = 489>
>>> [1] <http> https://secure.phabricator.com/api/conduit.connect
<<< [1] <http> 211,217 us
<<< [0] <conduit> 212,001 us
>>> [2] <event> diff.didCollectChanges <listeners = 0>
<<< [2] <event> 140 us
>>> [3] <event> diff.didBuildMessage <listeners = 0>
<<< [3] <event> 46 us
Reading diff from stdin...
>>> [4] <conduit> differential.creatediff() <bytes = 10,542>
>>> [5] <http> https://secure.phabricator.com/api/differential.creatediff
<<< [5] <http> 120,215 us
<<< [4] <conduit> 120,411 us
>>> [6] <event> diff.wasCreated <listeners = 0>
<<< [6] <event> 41 us
 SKIP STAGING  Raw changes can not be pushed to a staging area.
>>> [7] <conduit> harbormaster.queryautotargets() <bytes = 290>
>>> [8] <http> https://secure.phabricator.com/api/harbormaster.queryautotargets
<<< [8] <http> 217,717 us
<<< [7] <conduit> 217,944 us
>>> [9] <conduit> harbormaster.sendmessage() <bytes = 274>
>>> [10] <http> https://secure.phabricator.com/api/harbormaster.sendmessage
>>> [11] <conduit> harbormaster.sendmessage() <bytes = 274>
>>> [12] <http> https://secure.phabricator.com/api/harbormaster.sendmessage
<<< [10] <http> 123,821 us
<<< [9] <conduit> 134,329 us
<<< [12] <http> 227,580 us
<<< [11] <conduit> 227,787 us

[2016-01-05 10:08:58] EXCEPTION: (Exception) This workflow ('ArcanistDiffWorkflow') requires a Repository API, override requiresRepositoryAPI() to return true. at [<arcanist>/src/workflow/ArcanistWorkflow.php:804]
arcanist(head=master, ref.master=b3e68c9f1793), phutil(head=stable, ref.master=adb8a9c074ba, ref.stable=7b8d38cd2d4e)
  #0 ArcanistWorkflow::getRepositoryAPI() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2421]
  #1 ArcanistDiffWorkflow::getDiffOntoTargets() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2411]
  #2 ArcanistDiffWorkflow::updateOntoDiffProperty() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:534]
  #3 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:392]
```

Test Plan: Ran `arc diff --raw` in `phabricator/`.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D14946

10 years ago(stable) Promote 2015 Week 52
epriestley [Sat, 26 Dec 2015 11:19:54 +0000 (03:19 -0800)]
(stable) Promote 2015 Week 52

10 years agoAdd a linter rule for use of `is_a`
Joshua Spence [Tue, 22 Dec 2015 21:42:00 +0000 (08:42 +1100)]
Add a linter rule for use of `is_a`

Summary: `instanceof` should be used instead of `is_a`. I need to do a bit more research here to see if there are any edge cases.

Test Plan: Added unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14573

10 years agoImprove the "self member reference" linter rule
Joshua Spence [Tue, 22 Dec 2015 21:39:44 +0000 (08:39 +1100)]
Improve the "self member reference" linter rule

Summary:
Extends `ArcanistSelfMemberReferenceXHPASTLinterRule` to warn about the use of a hardcoded class name instead of `self` when instantiating a class. Arguably, we should maybe rename the linter rule from `ArcanistSelfMemberReferenceXHPASTLinterRule` to `ArcanistSelfUsageXHPASTLinterRule`, or even maybe split this rule into three separate rules:

  - `ArcanistSelfMemberReferenceXHPASTLinterRule`
  - `ArcanistSelfSpacingXHPASTLinterRule`
  - `ArcanistSelfClassReferenceXHPASTLinterRule`.

Test Plan: Added to existing test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D13935

10 years agoUse "--whitespace nowarn" in `arc patch` to respect trailing whitespace
epriestley [Fri, 18 Dec 2015 00:16:05 +0000 (16:16 -0800)]
Use "--whitespace nowarn" in `arc patch` to respect trailing whitespace

Summary: Fixes T10008. Git tries to fix some issues by default (apparently? empirically; not consistent with documentation, I think?), but patches from `arc patch` are "always" accurate (disregarding other bugs we might have -- basically, they haven't been emailed or copy/pasted or anything like that) so we can just tell it to apply the patch exactly as-is.

Test Plan: {F1029182}

Reviewers: chad, joshuaspence

Reviewed By: chad, joshuaspence

Maniphest Tasks: T10008

Differential Revision: https://secure.phabricator.com/D14816

10 years agoWhen `arc` is run with `--trace`, print out argv explicitly
epriestley [Wed, 16 Dec 2015 14:00:50 +0000 (06:00 -0800)]
When `arc` is run with `--trace`, print out argv explicitly

Summary:
Ref T9993. Users may have shell aliases or wrapper scripts that they forget about.

Print out the arguments we received to make it obvious that something went through an indirection layer.

Test Plan: Ran `arc version --help`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9993

Differential Revision: https://secure.phabricator.com/D14797

10 years agoExplain how to move forward or backward from `arc land --hold`
epriestley [Sun, 13 Dec 2015 11:08:06 +0000 (03:08 -0800)]
Explain how to move forward or backward from `arc land --hold`

Summary: Fixes T9973. When users run `arc land --hold`, give them the commands to move forward (push) or backward (checkout the branch/tag/commit they were on) and be explicit that branches have not changed.

Test Plan: Ran `arc land --hold`, got lots of explanatory text.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9973

Differential Revision: https://secure.phabricator.com/D14762

10 years agoSimplify diff exit code handling.
Dimitry Andric [Sun, 13 Dec 2015 10:35:07 +0000 (02:35 -0800)]
Simplify diff exit code handling.

Summary:
This fixes T9970 in an alternate manner, with the same effect: the
binary_safe_diff.sh script returns 0 if the diff succeeds, 1 in all
other cases.

Test Plan:
Tested locally with a fixed binary_safe_diff.sh, resulting in this
correct review:

https://reviews.freebsd.org/D4542

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: eadler, Korvin, stevenh

Maniphest Tasks: T9970

Differential Revision: https://secure.phabricator.com/D14759

10 years agoPreserve the exit code of the diff command in binary_safe_diff.sh
Dimitry Andric [Sun, 13 Dec 2015 10:21:43 +0000 (02:21 -0800)]
Preserve the exit code of the diff command in binary_safe_diff.sh

Summary:
Some versions of Subversion (1.9 in any case, maybe others) will
duplicate diff headers, if the diff command run through --diff-cmd
returns 0.

This lead to T9970, where the addition of a new file with properties
only shows the properties themselves in the review, not the content of
the new file.

Test Plan: This is a trivial change, is a test needed at all?

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: stevenh, Korvin, eadler

Differential Revision: https://secure.phabricator.com/D14755

10 years agoClarify that "arc land" means it is merging changes, not branch refences
epriestley [Sat, 12 Dec 2015 17:38:32 +0000 (09:38 -0800)]
Clarify that "arc land" means it is merging changes, not branch refences

Summary: Ref T9973. Make this language unambiguously clear about the underlying operations.

Test Plan: Ran `arc help land`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9973

Differential Revision: https://secure.phabricator.com/D14754

10 years agoIn `arc diff`, try to guess where a change should land
epriestley [Thu, 10 Dec 2015 22:33:33 +0000 (14:33 -0800)]
In `arc diff`, try to guess where a change should land

Summary:
Ref T9952. Ref T3462. My primary goal is to improve prefilling of the "Onto Branch:" field in the "Land Revision" dialog.

When uploading a diff with `arc diff`, add a property with some information about which branch to target. In particular:

  - If the local branch tracks an upstream branch (or tracks something which tracks something which tracks the upstream), target that.
  - If not, but "arc.land.onto.default" is set, target that.

This doesn't try to guess in other cases, since they're more involved. I'll add some context about this in T3462.

I don't //love// using "diff properties" for this, but it doesn't make cleaning them up any harder since we already use it for other stuff which isn't going away (lint/unit excuses).

Test Plan:
  - Added some `var_dump()` and used `arc diff --only` to generate diffs.
  - Saw upstream tracking and config-based rules generate reasonable values and submit them.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T3462, T9952

Differential Revision: https://secure.phabricator.com/D14736

10 years agoDon't use "-c" flag in "git:branch-unique()" revision range rule
epriestley [Thu, 10 Dec 2015 22:10:02 +0000 (14:10 -0800)]
Don't use "-c" flag in "git:branch-unique()" revision range rule

Summary:
Fixes T9953.

  - "-c" was introduced in 1.7.2.
  - "--no-color" has existed forever as far as I can tell.
  - "--no-column" was introducd in 1.7.11, but there was nothing that needed to be disabled before that (hopefully).

Test Plan:
  - Ran `arc which --trace` and observed a reasonable `git branch` command with correct output.
  - Ran `arc which --trace` with a faked older Git version, observed command omit `--no-column`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9953

Differential Revision: https://secure.phabricator.com/D14735

10 years agoFix handling of empty array index
Joshua Spence [Tue, 8 Dec 2015 21:09:02 +0000 (08:09 +1100)]
Fix handling of empty array index

Fix handling of empty array index by `ArcanistCurlyBraceArrayIndexXHPASTLinterRule`.

Auditors: epriestley

10 years agoAdd a linter rule for curly brace array indexes
Joshua Spence [Tue, 8 Dec 2015 19:56:48 +0000 (06:56 +1100)]
Add a linter rule for curly brace array indexes

Summary: In PHP, both `$x['key']` and `$x{'key'}` can be used to access an array (see  http://stackoverflow.com/questions/8092248/php-curly-braces-in-array-notation), but the former should be preferred.

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14603

10 years agoImprove brace formatting linter rule
Joshua Spence [Mon, 7 Dec 2015 20:20:57 +0000 (20:20 +0000)]
Improve brace formatting linter rule

Summary: Allow the brace formatting linter rule to complain about `class X{}`.

Test Plan: Updated unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14690

10 years agoLinter fixes
Joshua Spence [Mon, 7 Dec 2015 10:35:34 +0000 (21:35 +1100)]
Linter fixes

Summary: Minor linter fixes

Test Plan: N/A

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14633

10 years ago(stable) Promote 2015 Week 49
epriestley [Sat, 5 Dec 2015 00:15:32 +0000 (16:15 -0800)]
(stable) Promote 2015 Week 49

10 years agoTailor CLI feedback about "arc alias" to describe shell command aliases
epriestley [Thu, 3 Dec 2015 14:02:05 +0000 (06:02 -0800)]
Tailor CLI feedback about "arc alias" to describe shell command aliases

Summary:
Fixes T9873. Instead of printing something like this:

> Aliased "arc ls" to "arc !ls".

...print this:

> Aliased "arc ls" to shell command "ls".

Test Plan:
  - Added shell commands and internal aliases.
  - Removed aliases.
  - Listed aliases.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9873

Differential Revision: https://secure.phabricator.com/D14651

10 years agoAdd a linter rule for public properties
Joshua Spence [Wed, 2 Dec 2015 22:48:35 +0000 (09:48 +1100)]
Add a linter rule for public properties

Summary: Add a linter rule which advises against public class properties.

Test Plan: Added unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14641

10 years agoAdd a "binary integer casing" linter rule
Joshua Spence [Wed, 2 Dec 2015 22:47:27 +0000 (09:47 +1100)]
Add a "binary integer casing" linter rule

Summary: Adds a linter rule which ensures that binary integers are written in lowercase (i.e. `0b1` instead of `0B1`).

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14644

10 years agoAdd binary integers to `ArcanistPHPCompatibilityXHPASTLinterRule`
Joshua Spence [Wed, 2 Dec 2015 21:30:29 +0000 (08:30 +1100)]
Add binary integers to `ArcanistPHPCompatibilityXHPASTLinterRule`

Summary: Binary integers (such as `0b1`) were added to PHP 5.4 and cannot be used in earlier versions.

Test Plan: Added a test case.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14643

10 years agoAdd a linter rule for invalid octals
Joshua Spence [Wed, 2 Dec 2015 21:11:22 +0000 (08:11 +1100)]
Add a linter rule for invalid octals

Summary: PHP doesn't handle octals very well. Basically, it seems that any numeric scalar matching `/^0\d+$/` will be treated as an octal, whereas this should be `/^0[0-7]+$/`. As a result, `08` and `09` are both treated as `0` (because they are invalid octals. This diff adds a linter rule to detect this abnormality.

Test Plan: Added unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D14604