1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-24 09:38:50 +02:00
Commit graph

113 commits

Author SHA1 Message Date
epriestley
79da3a6ff9 Remove client-side commit message validation from Arcanist
Summary:
Commit templates are fully configurable on the server now, so we should be doing
validation there, since an install can add or remove fields and change
validation rules. Remove these outdated client validations, as per comment.

Also update the API call to use the 'errors' field, which allows us to show the
user all the parse errors at once. See:

https://secure.phabricator.com/diffusion/P/browse/origin:master/src/applications/conduit/method/differential/parsecommitmessage/ConduitAPI_differential_parsecommitmessage_Method.php;cfaab709df37739b$75

Test Plan:
Ran "arc diff" on a change with multiple errors:

```$ arc diff --conduit-uri=http://local.aphront.com/
Usage Exception: Commit message is not properly formatted:

Error parsing field 'Reviewers': Commit message references nonexistent users:
jjjderp.
Error parsing field 'CC': Commit message references nonexistent users and
mailing lists: jjjderp.

You should use the standard git commit template to provide a commit message. If
you only want to create a diff (not a revision), use --preview to ignore commit
messages.```

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran, btrahan

Differential Revision: 1154
2011-12-02 07:29:31 -08:00
Bob Trahan
d81d97f9c6 make arc patch issue a warning if applying a patch against a different project
Summary: adds a little bit of sanity checking to the arc patch workflow.  in
short, if the working copy project is not the same as the patch project, don't
apply the patch

Test Plan:
ran

arc patch DX
arc patch DX --force

in the top line directory for project A and proejct B.   DX is for project A.

verified for project A that the patch was applied and for project B i was issued
warnings as expected.  also verified in project B case that saying Y or N to the
warning had the desired effect.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, btrahan, epriestley

Differential Revision: 1140
2011-12-01 09:44:55 -08:00
David Reuss
1f69ab5fdb Added local encoding parameter for arc diff workflow
Summary:
If any hunks is detected as non-utf8, and you've never submitted diffs
for a certain project before, you would get a ERR-BAD-ARCANIST-PROJECT
exception. This makes it possible to submit the patch properly, so you
can set the encoding in the interface afterwards. Further this fixes
cases where you don't supply a diff but will result in hunks getting
treated as binary, but that still beats the exception behaviour.

Test Plan:
Ran `arc diff` with and without the new --encoding param and
got the expected results. Also ensured the diff (with non utf-8 hunks)
would be properly created even when no encoding is specified.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: 1135
2011-12-01 08:56:03 -08:00
Jakub Vrana
647c047b3c Document paths parameter in arc unit
Summary:
arc unit supports paths parameter
It is not documented in arc help

Test Plan:
arc help
Search for unit

Reviewers: slawekbiel, aran

Reviewed By: aran

CC: aran, vrana

Differential Revision: 1143
2011-11-30 15:23:09 -08:00
epriestley
c3c4f6ed4c Improve git behavior in the zero- and one- commit case
Summary:
Git works completely differently for commits zero and one than for 2..N so add
more special casing to handle them. See:

  - {T206}
  - {T596}

The getCommitRange() block is also fatal land, although I wasn't able to reach
it. I'll follow up with @s on T596.

Test Plan:
  - Created a new, empty repository ("mkdir x; cd x; git init").
  - Ran "arc lint", "arc unit", "arc diff" against it with no commits (the first
two work, the third fails helpfully).
  - Made an initial commit.
  - Ran "arc lint", "arc unit", "arc diff" against it (all work correctly).

Reviewers: btrahan, jungejason, aran

Reviewed By: aran

CC: s, aran

Differential Revision: 1142
2011-11-30 11:17:37 -08:00
Marek Sapota
4ea0541aeb Allow modification of the svn commit message via an event listener
Test Plan:
Wrote an event listener modifying the commit message and the message was
successfully changed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, jungejason, epriestley

Differential Revision: 1103
2011-11-16 16:40:19 -08:00
Bob Trahan
16caf63d98 make arc issue a warning if file upload fails during diff creation
Summary:
just a little try / catch action in ArcanistDiffWorkflow.

"Ideally, it would be good to flag these changes somehow so that "arc patch" can
issue the inverse warning (e.g., "This patch could not be completely applied
because some binary data was not uploaded.") but that hasn't come up in a real
use case yet."

I think a change w/ filetype of FILE_IMAGE || FILE_BINARY *and* no phid means
that the upload failed so there's no additional flag needed.  (True?)  however,
it would be easy enough to store metadata that explicilty stated whether or not
the file upload succeeded.

(also / related - i looked through the arc patch workflow a bit and i don't
understand how the svn codepath loads up the actual binary files...  for git,
toGitPatch => buildBinaryChange => getBlob is the right path )

Test Plan:
 - set 'storage.mysql-engine.max-size' to 0 in my conf, uploaded diffs with
files
 - noted in differential that it correctly detected images versus binary despite
file upload failing
 - noted in differential that images had some empty UI
 - reverted conf change, uploaded diffs with files
 - noted in differential file showed up
 - ran arc patch with DX, where DX had broken files
 - noted "Downloading binary data...

Exception:
ERR-BAD-PHID: No such file exists."

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: 1100
2011-11-12 09:57:22 -08:00
Nick Harper
28eae60821 Check that rev is accepted in arc mark-committed --finalize
Summary:
If arc amend is run on a rev that isn't accepted, it runs arc mark-committed
--finalize. The rev shouldn't be marked as committed if it hasn't been accepted,
so this diff adds in that check.

Test Plan:
Ran arc amend on a rev that hasn't been accepted, checked that it didn't get
marked as completed.

Reviewers: jungejason, epriestley

Reviewed By: epriestley

CC: aran, epriestley, nh

Differential Revision: 1104
2011-11-10 16:18:17 -08:00
epriestley
5150252f91 Add very hacky encoding transformation support for arc
Summary:
Adds a secret, undoucmented "encoding" key to ".arcconfig" which makes a very
half-hearted effort to convert encodings. This is probably good enough that
Differential can be used for code review, but there will be issues with 'arc
patch', 'arc export', paste, maybe conduit stuff, Diffusion, and whatever else I
haven't thought of.

This also doesn't store the original encoding so anything converted like this
won't reasonably be able to be made to work with all that stuff in the future.

See T452 for a broader discussion of the issues involved.

Test Plan:
Short circuited the UTF-8 detection to always fail, had my files "converted"
from ISO-8859-1 to UTF-8.

@davidreuss: you can test this by applying this patch to arcanist/, adding
'"encoding" : "ISO-8859-1"' to your .arcconfig, touching some non-ASCII file,
and then running "arc diff".

Reviewers: davidreuss, jungejason, tuomaspelkonen, aran

Reviewed By: davidreuss

CC: aran, davidreuss, epriestley, nshamg123

Differential Revision: 812
2011-11-04 14:07:12 -07:00
Marek Sapota
08ce2a2e2c Save committed revision id in workflow.
Summary:
Save commited revision id in workflow, so it can be used in Arcanist
didRunWorkflow hook.

Test Plan:
Running getRevisionID on the workflow should return id of the committed
revision.

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, epriestley, mareksapota

Differential Revision: 1078
2011-11-04 12:13:03 -07:00
epriestley
d57ea379c6 Fix "arc lint" exploding on new directories
Summary:
D1061 introduced a 'text file' check, but it fails under SVN for new
directories.

  - Revert D1061 (This reverts commit b2cd18252701be2093b52652fb3d1d94c5df571e.)
  - Make getChangedLines() return null to indicate that the operation doesn't
make sense. I think this was the intent of the code in the lint engine.
  - Fix a bug where running "arc lint" on a change in an SVN working copy from a
subdirectory would fail.
  - Fix a bug where warnings with no line information were incorrectly
discarded.

Test Plan:
  - Ran "arc lint" in an SVN working copy with a new directory (no failure).
  - Forced FilenameLinter to always raise a warning. Added a binary file and ran
"arc lint". The warning was reported for the new binary file, a new text file,
and a new directory.

Reviewers: jungejason, andrewjcg, nh, tuomaspelkonen, aran

Reviewed By: andrewjcg

CC: aran, andrewjcg, epriestley

Differential Revision: 1076
2011-11-03 14:28:04 -07:00
Marek Sapota
9070a123d3 Allow running arc patch without authentication.
Summary:
Allow `arc patch` without authentication if Phabricator instance has
'differential.anonymous-access' set to true.

Test Plan:
Set 'differential.anonymous-access' in Phabricator to true and run `arc patch`
without installing a certificate.  `arc patch` should work as expected.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: 1069
2011-11-01 15:31:04 -07:00
Andrew Gallagher
b2cd182527 Show lint warnings for non-"line-able" files
Summary:
Currently, lint messages are only included if they are errors or
if they affect lines which the diff changed.  The implementation
of this caused issues for non-text files (e.g. binaries), as line
change information is not available, and the corresponding lint
messages were dropped (for non-errors).

In this diff, only lint messages concerning text files are dropped
based on this line filtering.

Test Plan: arc lint with binary file

Reviewers: jungejason, epriestley

Reviewed By: epriestley

CC: aran, aravindn, andrewjcg, liat, epriestley

Differential Revision: 1061
2011-10-28 13:49:58 -07:00
Marek Sapota
bb05ddfb5a Allow anyone to run arc commit on an accepted revision
Test Plan:
Using SVN make some changes to the repo, run `arc diff`.  As other user accept
the revision, add the changes to your repo using `arc patch` and then run `arc
commit --revision revisionID` to commit them.  Arcanist should ask if you are
sure that you want to commit this revision and if you answer `Y` it should
commit to SNV repo.

Reviewers: epriestley, jungejason

Reviewed By: epriestley

CC: aran, mareksapota, epriestley

Differential Revision: 1055
2011-10-28 09:18:32 -07:00
Marek Sapota
6db055222a Allow anyone to mark Differential revisions as commited.
Test Plan:
Run `arc mark-committed` on a revision that you don't own, you should see a
prompt asking you if you really want to do that and if you answer `Y` it should
mark the revision as committed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley, mareksapota

Differential Revision: 1052
2011-10-25 17:24:57 -07:00
epriestley
df8c0e5e25 Don't do working copy checks for "arc amend --show"
Summary: See T587. Reduce the strictness of working copy checks when using
"--show", since there's a reasonable workflow where you 'arc patch' and then
'arc amend --revision X --show | git commit -a -F -' that currently won't work.
There are other ways to accomplish the same thing but this increases flexibility
overall.

Test Plan: Ran 'arc amend --show' with a dirty working copy, didn't get yelled
at.

Reviewers: jungejason, nh, tuomaspelkonen, aran

Reviewed By: nh

CC: aran, nh

Differential Revision: 1033
2011-10-24 23:37:47 -07:00
Jason Ge
ab50afe583 Fix breaking because of D935
Summary:
D935 missed one place of parseGitRelativeCommit() in
ArcanistExportWorkflow.

Test Plan: ran arc export and verify that it worked.

Reviewers: epriestley, tuomaspelkonen, aran

Reviewed By: aran

CC: aran

Differential Revision: 1015
2011-10-17 19:32:38 -07:00
epriestley
2fd37a1728 Automatically detect when to mark revisions committed
Summary:
See D945. We have this kludgy "remote_hooks_installed" mess right now, but we
have enough information on the server nowadays to figure this out without it.

Also reduce code duplication by sharing the "mark-committed" workflow.

This causes "arc merge" to effect commit marks.

Test Plan:
In Git, Mercurial and SVN working copies ran like a million
amend/merge/commit/mark-committed commands with and without --finalize in
various states of revision completion.

This change is really hard to exhaustively test because of the number of
combinations of VCS, revision state, command, command flags, repository state
and tracking state. All the reasonable tests I could come up with worked
correctly, though.

Reviewers: Makinde, jungejason, nh, tuomaspelkonen, aran

Reviewed By: jungejason

CC: aran, jungejason

Differential Revision: 967
2011-09-27 11:06:02 -07:00
epriestley
c84d6255b4 Support "immutable_history" doctrine in arc
Summary: When a project uses a conservative history mutability doctrine, never
try to amend history.

Test Plan: Ran "arc amend" in an "immutable_history" working copy.

Reviewers: fratrik, Makinde, aran, jungejason, tuomaspelkonen

Reviewed By: Makinde

CC: aran, Makinde, epriestley

Differential Revision: 862
2011-09-15 07:44:29 -07:00
epriestley
44959afd4b Add an "arc merge" workflow
Summary:
This should support conservative rewrite policies in git fairly well, under an
assumed workflow of:

  - Develop in local branches, never rewrite history.
  - Commit with "-m" or by typing a brief, non-template commit message
describing the checkpoint.
  - Provide rich information in the web console (reviewers, etc.)
  - Finalize with "git checkout master && arc merge branch && git push" or some
flavor thereof.

This supports Mercurial somewhat. The major problem is that "hg merge" fails if
the local is a fastforward of the remote, at which point there's nowhere we can
throw the commit message. Oh well. Just push it and we'll do our best to link
them up based on local commit info.

I am increasingly forming an opinion that Mercurial is "saftey-scissors git".
But also maybe I have no clue what I'm doing. I just don't understand why anyone
would think it's a good idea to have a trunk consisting of ~50% known-broken
revisions, random checkpoint parts, whitespace changes, typo fixes, etc. If you
use git with branching you can avoid this by making a trunk out of merges or
with rebase/amend, but there seems to be no way to have "one commit = one idea"
in any real sense in Mercurial.

Test Plan: Execute "arc merge" in git and mercurial.

Reviewers: fratrik, Makinde, aran, jungejason, tuomaspelkonen

Reviewed By: Makinde

CC: aran, epriestley, Makinde

Differential Revision: 860
2011-09-15 07:42:45 -07:00
epriestley
31ec011922 Move some VCS-specific logic into VCS APIs
Summary:
We have some git-specific logic on main pathways which should be in the API
class, move it around so "arc lint" with an engine works under Mercurial. This
resovles the error @makinde reported:

> PHP Catchable fatal error:  Argument 1 passed to
ArcanistBaseWorkflow::parseGitRelativeCommit() must be an instance of
ArcanistGitAPI, instance of ArcanistMercurialAPI given, called in
/home/makinde/.arc_install/arcanist/src/workflow/lint/ArcanistLintWorkflow.php
on line 131 and defined in
/home/makinde/.arc_install/arcanist/src/workflow/base/ArcanistBaseWorkflow.php
on line 830

Test Plan: Ran "arc diff" in git and hg working copies, plus "arc lint" with a
configured "lint_engine".

Reviewers: Makinde, aran, jungejason, nh, tuomaspelkonen

Reviewed By: Makinde

CC: aran, Makinde

Differential Revision: 935
2011-09-15 07:39:34 -07:00
mgummelt
e9b7f8e3ca Merge branch 'master' of github.com:facebook/arcanist into get_engine 2011-09-08 18:26:07 -07:00
mgummelt
3250cbb4d3 two small changes for "arc unit" post hook
Summary:
1) unit engine getter method in the unit workflow

   we store some information (unit test results) in the engine that we
   need to access in the "arc unit" post hook

2) make requireCleanWorkingCopy() public

   "arc unit" doesn't need to be clean in general, but we'd like the
   option to upgrade the workflow to require it if necessary.  We use
   this for ensuring a repo is clean before updating unit test
   results.

Test Plan: Used both features in a custom post hook in arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: dpepper, aran, epriestley

Differential Revision: 917
2011-09-08 18:25:54 -07:00
epriestley
aa138a80d2 Attach local commit information to DVCS revisions
Summary: When a revision is created, attach relevant information about the local
commits which it came from if applicable. This supports T473, for DCVSes and
DCVS workflows with immutable history where we can't just amend commit messages.
It will also allow us to enrich the web interface.

Test Plan: Will verify this info shows up for this very diff.

Reviewers: fratrik, aran, jungejason, tuomaspelkonen

Reviewed By: fratrik

CC: aran, epriestley, fratrik

Differential Revision: 857
2011-08-25 18:13:53 -07:00
epriestley
58c09ab36d Improve Arcanist Mercurial support
Summary:
  - Build the manifest of file changes so unit and lint workflows work.
  - Default to creating a diff between the parent of the first outgoing change
and the tip.

Test Plan:
  - Ran "arc diff" in a dirty mercurial repo, got warned about
untracked/uncommitted changes.
  - Ran "arc diff" in a clean mercurial repo, got a diff of everything I'd done
locally.

Reviewed By: aran
Reviewers: Makinde, aran, jungejason, tuomaspelkonen
CC: aran, epriestley
Differential Revision: 796
2011-08-09 19:16:36 -07:00
epriestley
268de6428c Basic Mercurial support for Arcanist
Summary:
There's a lot of ground left to cover but this makes "arc diff" work (on one
trivial diff) in my sandbox, at least, and supports parsing of Mercurial native
diffs (which are unified + a custom header). Piles of missing features, still.
Some of this is blocked by me not understanding the mercurial model well yet.

This is also a really good opportunity for cleanup (especially, reducing the
level of "instanceof" in the diff workflow), I'll try to do a bunch of that in
followup diffs.

Test Plan: Ran "arc diff" in a mercurial repository, got a diff out of it.
Reviewed By: aran
Reviewers: Makinde, jungejason, tuomaspelkonen, aran, codeblock
CC: aran, epriestley, codeblock, fratrik
Differential Revision: 792
2011-08-09 18:22:58 -07:00
epriestley
40b445b387 Fix a variable usage
Summary: This stopped being available in scope when I refactored this
recentlyish.
Test Plan: Got error, saw useful message.
Reviewed By: jungejason
Reviewers: mgummelt, jungejason, tuomaspelkonen, aran
CC: aran, epriestley, jungejason
Differential Revision: 787
2011-08-07 16:04:20 -07:00
Edward Speyer
344fbb8d35 Fix documentation: stop __init__ rendering in bold
Summary:
Requires
https://secure.phabricator.com/rPHU0acf708b9b0fdbf59e4399f14dd8295b6a96972c
from libphutil, which allows a backslash prefix to control escape
sequences such as bold, underline, and invert.

Test Plan: "arc help liberate"
Reviewed By: epriestley
Reviewers: epriestley
CC: aran, epriestley
Differential Revision: 767
2011-08-04 14:09:13 +01:00
epriestley
57ff80e6c4 Provide "arc upload --json"
Summary:
  - Provide a "--json" flag for "arc upload"
  - Unify some of the stderr stuff across upload/download/paste.

Test Plan:
  - Ran "arc upload" and "arc upload --json", piped stderr away with 2>/dev/null
to verify only JSON got emitted to stdout
  - Ran "arc paste"

Reviewed By: codeblock
Reviewers: codeblock, jungejason, tuomaspelkonen, aran
CC: aran, codeblock
Differential Revision: 749
2011-08-01 17:44:43 -07:00
epriestley
0e4f7774fb Add an "arc paste" workflow
Summary: Read and write in the same workflow! Dogs and cats living together!
Test Plan:   - Performed a bunch of paste reads and writes and they looked ok?
Reviewed By: aran
Reviewers: codeblock, jungejason, tuomaspelkonen, aran
CC: aran
Differential Revision: 748
2011-07-29 20:11:41 -07:00
epriestley
bd9769ba92 Add 'arc upload' and 'arc download'
Summary: Mechanisms for interacting with Files via Arcanist.
Test Plan:
  - Ran 'arc upload x', 'arc upload x y z'
  - Ran 'arc download' with --as and --show.

Reviewed By: codeblock
Reviewers: codeblock, jungejason, tuomaspelkonen, aran
CC: aran, codeblock, epriestley
Differential Revision: 742
2011-07-29 13:38:24 -07:00
Jason Ge
1bb2409d47 Remove the size limit on arc side
Summary:
remove the size check. The conduit call will fail later if the
size is too large, and we will get better error message.

Test Plan:
run arc diff with files smaller and larger than the size
limit.

Reviewed By: epriestley
Reviewers: epriestley
CC: aran, epriestley
Differential Revision: 729
2011-07-25 16:27:34 -07:00
epriestley
8150fdf044 Deprecate ArcanistBaseWorkflow::getUserGUID in favor of "PHID"
Summary: One day all "GUID" references will be gone, maybe.
Test Plan: grep, ran workflow before changing and got a warning about
deprecation
Reviewed By: aran
Reviewers: mgummelt, tuomaspelkonen, aran, jungejason
CC: aran
Differential Revision: 671
2011-07-15 12:52:17 -07:00
epriestley
41b23519e6 Move Conduit management into Workflow
Summary:
The primary goal of this is to allow pre/post workflow hooks to upgrade a
workflow which doesn't require conduit into one which does, or one which doesn't
require authentication into one which does. They do this by calling
$workflow->establishConduit() or $workflow->authenticateConduit() respectively.

It also removes a bunch of dead code and a bunch of now-unnecessary public
interfaces.

Test Plan:
Broke my certificate and ran "arc list", "arc unit", "arc help", "arc
call-conduit".
Restored my certificate and re-ran the commands.

Reviewed By: mgummelt
Reviewers: mgummelt, jungejason, tuomaspelkonen, aran
CC: aran, epriestley, mgummelt
Differential Revision: 664
2011-07-15 12:38:45 -07:00
epriestley
2aa853f85c From Arcanist, send 'host' to server for validation on setup workflows
Summary: This allows us to detect and complain about mismatched client and
server host identities. It causes some subtle and not-so-subtle problems if the
client and server don't agree on the install's primary URI.
Test Plan: Ran "arc install-certificate" and "arc list" against my local host
with intentionally bogus configs and was warned. Ran with normal configs and
everything worked.
Reviewed By: tuomaspelkonen
Reviewers: jungejason, llorca, tuomaspelkonen, aran
CC: aran, tuomaspelkonen
Differential Revision: 591
2011-07-05 10:10:28 -07:00
James Ide
2892c6ef1a Have Arcanist record how much of my life was spent running each unit test
Summary:
Keeping unit tests speedy keeps them useful since people actually won't mind
running them. This diff records the time taken by each test and displays it nice
and colorized. Really, I just want to discourage non-unit tests from making
their way into ##__tests__##.

Some thoughts:

 - The "acceptableness" times are subjective but if dependencies are properly
mocked the times seem to be ok. Integration tests that make network requests to
third-party endpoints and pull in megabytes of data will not survive. This is a
good thing.
 - Fast tests get a gold star, encouraging small tests. I am sorry that the star
does not sparkle.
 - There is no way for a programmer to admit that their test is going to be slow
in some cases. They will be shamed with red text for the life of their test.
 - It might be confusing that fast but failing tests get green text and maybe a
gold star.

Test Plan: Ran some of the unit tests within Arcanist and libphutil. See
https://secure.phabricator.com/file/view/PHID-FILE-cdd3c94c219e0fd7470b/ for
sample output.
Reviewed By: epriestley
Reviewers: epriestley
CC: aran, epriestley
Differential Revision: 588
2011-07-03 23:32:27 -07:00
epriestley
304a2c73aa Prohibit creation of command-line revisions with yourself as the reviewer
Summary:
We do this check on the web interface but not from the CLI.

Also clean up some GUID/PHID stuff (eventually all GUID references should be
replaced with PHID, although they mean the same thing).

Test Plan: Tried to create a revision with myself on the reviewer line, got
called out.
Reviewed By: jungejason
Reviewers: moskov, jungejason, tuomaspelkonen, aran
CC: aran, jungejason
Differential Revision: 564
2011-07-03 11:50:54 -07:00
epriestley
4a8e247e66 Fix "arc branch" to work if you are on "(no branch)" add revision IDs
Summary:
If you checkout some commit you end up on "(no branch)" which currently breaks
the parser. Ignore that, and add revision IDs to the output. They aren't very
big and I hate flags so I didn't add a flag for this. You can add a flag to turn
them off if you really want.

Test Plan:
Ran "arc branch" and "arc branch --by-status" from a "(no branch)" working copy.

Reviewed By: slawekbiel
Reviewers: slawekbiel, ahupp, jungejason, tuomaspelkonen, aran, schrockn
CC: aran, slawekbiel
Differential Revision: 555
2011-06-29 13:30:44 -07:00
Adam Hupp
cc283a63a5 Add by-status option to 'arc branch'
Summary:
This diff adds a '--by-status' argument to arc branch that sorts the
output by status.  Example output:

    Accepted
      my-branch                         Amazing change
    Needs Revision
      nah-nah                           Not so good change
    Needs Review
      in-progress-change                I have no idea
    No Revision
      etc                               etc

Blame Rev:

Task ID:  #

Reviewers: epriestley, slawekbiel

Test Plan:
Ran it with and without --by-status, saw expected output in both cases.

DiffCamp Revision:

Revert Plan:

Database Impact:

Memcache Impact:

Other Notes:

EImportant:

- begin *PUBLIC* platform impact section -
Bugzilla: #
- end platform impact -

Differential Revision: 512
2011-06-28 20:35:23 -07:00
Andrew Gallagher
3715266209 arc lint: include lint errors in unresolved messages
Summary:
Currently, when arc-lint processes lint warnings and errors, it
accumulates the warnings into an "unresolvedMessages" array.  As
soon as it sees an errors, it breaks out of the loop that does the
collection and returns, causing individual lint errors messages to
not show up in differential.

This diff collects all lint warning and error messages into the
unresolved array.

Test Plan:
arc-diff on patch that had lint errors.  Verified that,
after this change, linte errors messages showed in differential.

Reviewed By: epriestley
Reviewers: jungejason, epriestley
Commenters: jungejason
CC: aran, epriestley, jungejason
Differential Revision: 543
2011-06-27 14:17:17 -07:00
epriestley
182e260472 Verify that ~/.arcrc is 600 before reading from it
Summary:
Since this has auth information in it now, we should prevent other users on the
system from reading it. Detect readable files and prompt the user to fix them.

Test Plan:
Did "o+r" on my ~/.arcrc, ran "arc list", got prompted, hit "Y", verified it set
perms to 600, ran "arc list" again and wasn't prompted.

Reviewed By: jungejason
Reviewers: fratrik, jungejason, aran, tuomaspelkonen
CC: aran, jungejason, epriestley
Differential Revision: 532
2011-06-26 11:55:31 -07:00
epriestley
051ef2c695 Provide a "--json" flag to 'arc diff'
Summary:
This should be implemented more elegantly, but this is a mostly-reasonable
attempt at it.

Test Plan:
Ran 'arc diff --only --json' with this diff.

Reviewed By: gc3
Reviewers: gc3
CC: aran, epriestley, gc3
Differential Revision: 509
2011-06-23 16:03:37 -07:00
epriestley
b6fb0f7a6b Improve documentation for 'arc call-conduit'
Summary:
This documentation isn't terribly clear and it isn't obvious how to use the
workflow. Make it more clear and provide examples.

Test Plan:
Ran "arc help call-conduit"

Reviewed By: gc3
Reviewers: gc3, aran, jungejason
CC: aran, gc3, epriestley
Differential Revision: 502
2011-06-23 13:15:28 -07:00
slawekbiel
5171ec161a arc branch
Summary:
Appending differential status, sorting, filtering and coloring git
branches.

I think it turned out rather nicely. On my repository with 70 branches
it takes 1.6s, not terrible, though 1.2s is in the conduit call - seems
like there is potential for optimization.

I didn't end up changing 'arc list', as their semmantics are slightly
different, but I'm open to ideas of consolidating them

Test Plan:
- Tested on both facebook www and arcanist repositories.
- Validated that view-all flag works
- Validated that the ordering is correct
- Validated that the statuses match the differential status.

Reviewed By: epriestley
Reviewers: epriestley
CC: aran, epriestley, slawekbiel
Revert Plan:
sure

Other Notes:

Differential Revision: 497
2011-06-23 12:12:48 -07:00
epriestley
8660f186bf fix ~/.arcconfig typo
Summary:
When installing a certificate, it's being written to ~/.arcrc not ~/.arcconfig

Test Plan:
Installed a certificate it said the right thing.

Reviewed By: aran
Reviewers: epriestley, aran
Commenters: epriestley
CC: aran, epriestley
Differential Revision: 491
2011-06-21 16:03:25 -07:00
epriestley
d73179ea99 "arc install-certificate", client side changes
Summary:
Provide an "install-certificate" workflow to simplify ~/.arcrc edits. See also
D460.

Test Plan:
Installed certificates via "arc install-certificate".

Reviewed By: aran
Reviewers: aran, jungejason, tuomaspelkonen
CC: aran, epriestley
Differential Revision: 465
2011-06-20 05:48:40 -07:00
epriestley
36de84eeee Make image diffs work again
Summary:
I looked at this quickly to see what was involved and there were only a couple
of issues so here's a patch:

  - On OSX, the "-i" flag does not mean "--mime". Use "--mime" explicitly
instead. This is a minor fix which affects only OS X.
  - I wasn't able to repro the "crazy executables" behavior and think it might
have been me messing something up, so nuke it until we see an issue.
  - Some guid vs phid shenanigans. Differential reads "phid" but arcanist set
"guid". We should move toward "phid"; I started using "guid" before I realized
it was an overloaded term that also refers to a specific GUID implementation
(Microsoft's UUID).

Test Plan:
Uploaded an image diff, saw images in Differential.

Reviewed By: aran
Reviewers: jianfeng, jungejason, aran, tuomaspelkonen
CC: aran
Differential Revision: 466
2011-06-15 10:46:36 -07:00
epriestley
660dd74413 Include a link to documentation when throwing an error from arcanist about a bad
commit template

Summary:
When users run into this, point them at the documentation explicitly.

Test Plan:
Tried to "arc diff" with a commit message of 'derp', got a live link to
documentation instead of a vague set of general instructions.

Reviewed By: aran
Reviewers: moskov, aran, jungejason, tuomaspelkonen
CC: aran
Differential Revision: 468
2011-06-15 10:46:13 -07:00
tuomaspelkonen
42c6f00315 Let TestEngine know if the command that triggered tests is 'arc diff' or 'arc
unit'

Summary:
We want to handle 'arc unit' and 'arc diff' differently in our test
framework.

Test Plan:
Tested that with 'arc unit' the value was set to 'unit' and with 'arc diff'
the value was set to 'diff'.

Reviewed By: epriestley
Reviewers: slawekbiel, epriestley
CC: jungejason, grglr, aran, tuomaspelkonen, epriestley
Differential Revision: 430
2011-06-10 13:00:03 -07:00
tuomaspelkonen
dcc76bb58b Send postponed test results to differential.
Summary:
Differential showed 'okay' as the arc unit status even when there were
postponed tests.

Test Plan:
Tested that test results were pushed to differential when there were
postponed tests.

Reviewed By: jungejason
Reviewers: epriestley, jungejason
CC: slawekbiel, aran, jungejason
Differential Revision: 417
2011-06-09 10:29:54 -07:00