1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-12 18:02:39 +01:00
Commit graph

313 commits

Author SHA1 Message Date
epriestley
3cc486d5c1 Add "pht_list()", a translation wrapper for lists of items
Summary: Ref T13603. This is just a small piece of cleanup I've wanted to do for a while: different languages might have different list separators and repeating this implosion manually all over the place is a bit ugly even if the beahvior is never a function of translation language.

Test Plan: See next change.

Maniphest Tasks: T13603

Differential Revision: https://secure.phabricator.com/D21814
2022-05-12 10:57:39 -07:00
epriestley
a33aeb3c36 Add a "product name literal in pht()" linter
Summary:
Ref T13658. One challenge in forking Phabricator is product name references in user-visible strings, particularly in "pht()".

Add a linter to identify the use of product name literals in "pht()" text.

The linter could fix these automatically, but it looks like there are fewer than 200 across both Arcanist and Phabricator and some sampling suggests that many are probably clearer when rewritten into generic language anyway.

Test Plan: Ran linter, saw it pop out reasonable warnings.

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21763
2022-04-25 12:21:31 -07:00
epriestley
f098e8d863 Introduce PHP8.1 replacement functions for string tests which may take multiple types
Summary: Ref T13588. Adds "phutil_nonempty_string()" and similar methods to support PHP8.1 compatibility.

Test Plan: Added unit tests, ran unit tests.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21762
2022-04-20 11:11:57 -07:00
epriestley
488f13a60e Add a lint rule forbidding use of "each()"
Summary:
Ref T13588. "each()" has been a bad idea for a long time, and was formally deprecated in PHP 7.2 and removed in PHP 8.0.

Catch use of "each()" in lint and reject it.

Test Plan:
Added and ran unit tests.

{F10021268}

Subscribers: cspeckmim

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21741
2021-12-09 15:58:54 -08:00
epriestley
c53bb21bbd Provide an API for parsing swap information from "/proc/meminfo"
Summary: Ref T13653. This entirely exists to support converging into the right swap state in deployment workflows.

Test Plan: Ran unit tests.

Maniphest Tasks: T13653

Differential Revision: https://secure.phabricator.com/D21733
2021-11-22 05:45:06 -08:00
Christopher Speck
d246a06562 Update ArcanistMercurialAPI to support getting the current commit ref
Summary:
Mercurial does not have an implementation for querying commit symbol hardpoints, which is what the "arc amend" workflow uses.

This provides an implementation for Mercurial as well as updating `ArcanistMercurialAPI` to specify the current working directory symbol as `.`.

Additionally removed an erroneous early return in `ArcanistAmendWorkflow` which prevents a check against uncommitted changes.

Fixes T13665

Test Plan:
1. I created a diff on a Mercurial revision.
2. I updated the revisions summary in phabricator.
3. I ran `arc amend` and it successfully amended the local commit with the updated commit message.
4. I modified a file in the repository and left the change uncommitted.
5. I ran `arc amend` and verified that it reported an error due to uncommited commits.

I ran the following commands to verify that they resolved to the correct commits
1. `arc inspect --explore -- 'commit(674492bb460)'` properly matched the right commit as a commit hash prefix
2. `arc inspect --explore -- 'commit(674492bb4606666d5321feb38d2a467a8733c786)'` properly matched the right commit as a full commit hash
3. `arc inspect --explore -- 'commit(master)'` properly matched the right commit as a bookmark
4. `arc inspect --explore -- 'commit(tip)'` properly matched the right commit as a tag
5. `arc inspect --explore -- 'commit(.)'` properly matched the right commit as the working directory
6. `arc inspect --explore -- 'commit(cafe)'` properly matched the right commit as a commit hash prefix
7. I created a 'cafe' bookmark on a changeset
8. `arc inspect --explore -- 'commit(cafe)'` properly matched the right commit as a bookmark
9. `arc inspect --explore -- 'commit(67449)'` properly matched the right commit as a revision number
10. `arc inspect --explore -- 'commit(2147483648)'` properly did not match any revision (no python exception)
11. `arc inspect --explore -- 'commit(0)'` properly matched the first commit

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13665

Differential Revision: https://secure.phabricator.com/D21716
2021-09-05 15:25:21 -04:00
epriestley
f993b1fbda Provide "MethodCallFuture" to fix exception semantics in mixed-future contexts
Summary:
Ref T13666. Currently, "PhabricatorRepository->newConduitFuture()" sometimes returns a real "ConduitFuture" (when repository clustering is configured) and sometimes returns a degenerate "ImmediateFuture" (when repository clustering is not configured).

To populate the "ImmediateFuture", the Conduit method is called inline without any special exception handling. This means that the two pathways have significantly different exception behavior:

  - On the "ImmediateFuture" pathway, the "newConduitFuture()" method itself may raise an exception related to resolving the call (e.g., invalid parameters).
  - On the "ConduitFuture" pathway, exceptions are raised only once the future is "resolve()"'d.

The second behavior is the correct behavior (and the primary behavior of upstream test environments, since all my stuff and the Phacility stuff is clustered).

Prepare to put both pathways on the second behavior by introducing a "MethodCallFuture", which can move the `$conduit_call->execute()` call (and thus its exception handling) to future resolution time.

See also the followup diff in Phabricator to actually enact this change.

Test Plan: Added unit tests and made them pass, see also next change.

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13666

Differential Revision: https://secure.phabricator.com/D21720
2021-09-04 14:19:04 -07:00
epriestley
ec68005d75 Remove "phutil_deprecated()"
Summary: This short-lived function never did anything more interesting than "phlog()" and never found a role. The last callsite for this function was removed in D330 in 2011.

Test Plan: Grepped for "phutil_deprecated()", found no callsites.

Differential Revision: https://secure.phabricator.com/D21704
2021-07-21 10:21:32 -07:00
epriestley
be1a4a9142 Avoid leaving stdin in nonblocking mode after a modern prompt
Summary:
Ref T13649. Currently, "arc" may leave stdin nonblocking after showing a prompt. This can cause various odd behaviors down the line.

I can't immediately reproduce this behavior on macOS in "zsh" or "bash" (I'm unable to get stdin to remain nonblocking beyond the process lifespan), and also don't have pcntl locally so there's a fair amount of handwaving here.

Test Plan: This is somewhat speculative since I can't immediately reproduce the behavior. I tested the locally-reachable paths (no pcntl) but they're not interesting.

Maniphest Tasks: T13649

Differential Revision: https://secure.phabricator.com/D21666
2021-05-30 01:33:15 -07:00
epriestley
6d60422dbb Add a simple primitive for managing PHP runtime error logs
Summary:
Ref T13624. If we want to send PHP errors to a log, using the "error_log" configuration option catches the broadest set of errors across versions of PHP.

Configuring this disables errors on `stderr`, since they're sent to the log instead. We'd like them to go to both places; provide a simple wrapper for this. Also do a bit of writability testing.

Test Plan: Wrote errors to a new log, see followup changes.

Maniphest Tasks: T13624

Differential Revision: https://secure.phabricator.com/D21578
2021-02-26 14:54:41 -08:00
epriestley
9d5802cb9f Provide some "preg_*" wrappers which raise exceptions on failure
Summary: Ref T13608. Ref T13100. Ref T13586. Properly checking "preg_match()" and similar calls for failure and raising useful exceptions is complicated and error-prone. Provide wrapper functions with an API that's more consistent with the rest of the codebase: matches are returned; and errors raise detailed exceptions.

Test Plan: See next change.

Maniphest Tasks: T13608, T13586, T13100

Differential Revision: https://secure.phabricator.com/D21561
2021-02-19 11:16:09 -08:00
epriestley
32fe933f3a Add a lint check for catching "Exception" without catching "Throwable"
Summary:
Ref T13588. For consistency of behavior between versions on either side of PHP7, any "catch (Exception)" block should generally have a "catch (Throwable)" block in the same catch list.

Raise a lint warning when "Exception" is caught without also catching "Throwable", since this is almost certainly not desired.

Test Plan: Added tests.

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21542
2021-02-03 14:49:13 -08:00
epriestley
b2e715fc5a Provide "gitsprintf(...)" and disambiguate Git ref selectors
Summary: Ref T13589. See that task for discussion.

Test Plan:
  - Created this diff, ran most commands in isolation.
  - This change is difficult to test extensively.

Maniphest Tasks: T13589

Differential Revision: https://secure.phabricator.com/D21509
2021-01-13 12:31:15 -08:00
epriestley
3633364bb9 Clean up push failure messaging in "arc land" slightly
Summary: Ref PHI1808. Currently, push failures are messaged awkwardly. Make this exception handling more selective and the user-facing behavior more readable.

Test Plan: Ran "arc land" against a failing remote, saw a human-readable message instead of a stack trace.

Differential Revision: https://secure.phabricator.com/D21395
2020-07-08 15:30:17 -07:00
epriestley
b8a5191e3b Improve login/auth messages from Arcanist toolset workflows
Summary:
See PHI1802. After D21384, "arc land" and similar with no credentials now properly raise a useful exception, but it isn't formatted readably.

Update the display code to make it look prettier.

Test Plan: Ran "arc land" with no and invalid credentials, got properly formatted output.

Differential Revision: https://secure.phabricator.com/D21387
2020-07-01 06:37:31 -07:00
epriestley
7e9f80971b Implement Conduit login prompt behavior as a pure FutureProxy, not a Future-like object
Summary:
See PHI1802. Currently, we can't raise a "you must login" error in a generic way at the beginning of a workflow because we don't know if a workflow needs credentials or not.

For example, "arc help" does not need credentials but "arc diff" does.

Additionally, some actual Conduit calls do not need credentials ("conduit.ping", "conduit.getcapabilities") and others do.

Although I'd like to simplify this eventually and move away from anonymous/unauthenticated "arc", this isn't trivial today. It's also possible for third-party code to add authenticated calls to "arc help", etc., so even if we could execute these tests upfront it's not obvious we'd want to.

So, for now, we raise "you must login" at runtime, when we receive an authentication error from Conduit.

This got implemented for Toolsets in a well-intentioned but not-so-great way somewhere in wilds/experimental, with an "ArcanistConduitCall" that behaves a bit like a future but is not really a future. This implementation made more sense when ConduitEngine was serving as a future engine, and FutureProxy could not rewrite exceptions.

After the Toolsets code was first written, ConduitEngine has stopped serving as a future engine (this is now in "HardpointEngine"). Since HardpointEngine needs a real future, this "show the user a login message" code gets bypassed. This results in user-visible raw authentication exceptions on some workflows:

```
[2020-06-30 21:39:53] EXCEPTION: (ConduitClientException) ERR-INVALID-SESSION: Session key is not present. at [<arcanist>/src/conduit/ConduitFuture.php:76]
```

To fix this:

  - Allow FutureProxy to rewrite exceptions (see D21383).
  - Implement "ArcanistConduitCall" as a FutureProxy, not a future-like object.
  - Collapse the mixed-mode future/not-quite-a-future APIs into a single "real future" API.

Test Plan:
- Created a paste with "echo hi | arc paste --".
- Uploaded a file with "arc upload".
- Called a raw method with "echo {} | arc call-conduit conduit.ping --".
- Invoked hardpoint behavior with "arc branches".
- Grepped for calls to either "resolveCall()" method, found none.
- Grepped for calls to "newCall()", found none.
- Grepped for "ArcanistConduitCall", found no references.

Then:

- Removed my "~/.arcrc", ran "arc land", got a sensible and human-readable (but currently ugly) exception instead of a raw authentication stack trace.

Differential Revision: https://secure.phabricator.com/D21384
2020-07-01 06:37:31 -07:00
epriestley
cd19216ea2 Render "arc markers" workflows as a tree, not a list
Summary:
Ref T13546. Currently, each "land" workflow executes custom graph queries to find commits: move toward abstracting this logic.

The "land" workflow also has a potentially dangerous behavior: if you have "master > A > B > C" and "arc land C", it will land A, B, and C. However, an updated version of A or B may exist elsewhere in the working copy. If it does, "arc land" will incorrectly land an out-of-date set of changes.

To find newer versions of "A" and "B", we need to search backwards from all local markers to the nearest outgoing marker, then compare the sets of changes we find to the sets of changes selected by "arc land".

This is also roughly the workflow that "arc branches", etc., need to show local markers as a tree, and starting in "arc branches" allows the process to be visualized.

As implemented here ,this rendering is still somewhat rough, and the selection of "outgoing markers" isn't good. In Mercurial, we may plausibly be able to use phase markers, but in Git we likely can't guess the right behavior automatically and probably need additional configuration.

Test Plan: Ran "arc branches" and "arc bookmarks" in Git and Mercurial.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21363
2020-06-30 15:50:05 -07:00
epriestley
50f7a853b5 Load and map repository objects for remote URIs
Summary:
Ref T13546. Query and associate known Phabricator repositories to working copy remotes by normalizing and comparing URIs.

This primarily gives us access to "permanentRefRules" so we can tell which branches have published changes.

Test Plan: Ran "arc look remotes" in Git and Mercurial working copies, saw repositories map properly.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21377
2020-06-30 13:43:14 -07:00
epriestley
6bf7a40358 Provide "arc look", a user-facing inspection command
Summary:
Ref T13546. Currently, "arc which" provides some amount of inspection but it generally isn't very helpful to users and is too limited and inflexible. "arc inspect" is an internal/debugging workflow.

The new "arc look" is much more aggressively unhelpful.

Test Plan: I'm not sure if this command should allow you to continue at night, because it's too dark.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21376
2020-06-30 13:08:31 -07:00
epriestley
ffb027e85c Support generating remote refs in Git
Summary: Ref T13546. Allow construction of remote refs in Git; previously they were only supported in Mercurial.

Test Plan: Ran "arc inspect remote(origin)" in Git, got a ref.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21375
2020-06-30 13:08:19 -07:00
epriestley
89f9eb66a7 Support inspection of remote refs with "arc inspect remote(...)"
Summary: Ref T13546. Expose remote refs for inspection via "arc inspect". For now, this only works in Mercurial.

Test Plan: Ran "arc inspect remote(default)" in Mercurial, got a ref out.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21374
2020-06-30 13:07:25 -07:00
epriestley
b19985a4bd Copy repository URI normalization code from Phabricator to Arcanist
Summary: Ref T13546. Move toward smarter remote repository lookup by providing URI normalization code in Arcanist. This diff duplicates code from Phabricator; the next change will collapse it.

Test Plan: Ran unit tests.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21372
2020-06-30 13:07:12 -07:00
epriestley
c53c05e5b2 Introduce "phutil_partition()" and natural case sorting for "msortv(...)"
Summary:
Ref T13546. Pull some small utility changes out of the deeper stack of "land/markers" changes.

"phutil_partition()" makes it easier to write code that loops over a list grouping elements, then acts on each group. This kind of code is not terribly common, but often feels awkward when implemented with raw primitives.

"msortv()" can support "natural" sorting, which sorts "feature1", "feature2", ..., "feature10" in a more human-readable order.

Test Plan: Ran unit tests, used new behaviors elsewhere in "arc markers" workflows.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21371
2020-06-30 06:45:03 -07:00
epriestley
33484b43c9 Introduce "GridView", an updated version of "ConsoleTableView"
Summary:
Ref T13546. In a future change, I'm providing a fancier version of "arc branches" that requires more sophisticated table rendering.

Implement a new view which can do some fancier things, like handle alignment of multi-line table cells.

Test Plan: See future changes.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21360
2020-06-30 06:31:24 -07:00
epriestley
63f2e667b9 Update "arc land" display of build failures, and rename "DisplayRef" to "RefView"
Summary:
Ref T13546. Show ongoing and failed builds more clearly in "arc land" output.

Also rename "DisplayRef" (which is not a "Ref") to "RefView" with the goal of improving clarity, and let callers "build...()" it so they can add more status, etc., information.

Get rid of "[DisplayRef|RefView]Interface". In theory, future refs (say, in Phabricator) might not do anything here, but every Ref just ends up implementing it. This could perhaps be subclassed more narrowly in the future if necessary.

Test Plan: Ran "arc land", grepped for various symbols.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21352
2020-06-30 06:27:56 -07:00
epriestley
1bb054ef47 Verify remotes ("paths") in Mercurial during "arc land"
Summary: Ref T13546. Parse "hg paths" and validate that the remotes "arc land" plans to interact with actually exist.

Test Plan: Ran "arc land" with good and bad "--into-remote" and "--onto-remote" arguments, got sensible validation behavior.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21342
2020-06-10 10:27:17 -07:00
epriestley
b003cf9310 Remove "arc feature", "arc branch", "arc bookmark", and significant chunks of obsolete marker code
Summary: Ref T13546. Moves away from the older workflows in favor of "arc branches", "arc bookmarks", and "arc work".

Test Plan: Grepped for affected symbols, didn't find any callers.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21337
2020-06-08 16:27:31 -07:00
epriestley
3d64140ff3 Implement "arc work", to replace "arc feature"
Summary: Ref T13546. Fixes T2928. Adds a new "arc work" workflow which functions like the older "arc feature" workflow, but with modern infrastructure.

Test Plan: Used "arc work" to begin work on branches, bookmarks, and revisions in Git and Mercurial.

Maniphest Tasks: T13546, T2928

Differential Revision: https://secure.phabricator.com/D21336
2020-06-08 16:27:27 -07:00
epriestley
599ba0f999 Provide a more powerful query mechanism for "markers" (branches/bookmarks)
Summary:
Ref T13546. Various Arcanist workflows, and particularly the MercurialAPI, currently repeat quite a lot of code around parsing branches and bookmarks.

In modern Mercurial, we can generally use the "head()" and "bookmark()" revsets to do this fairly sensibly.

This change mostly adds //more// code (and introduces "arc bookmarks" and "arc branches" as replacements for "arc bookmark" and "arc branch") but followups should be able to mostly delete code.

Test Plan: Ran "arc branches" and "arc bookmarks" in Git and Mercurial.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21333
2020-06-08 16:27:20 -07:00
epriestley
c5192bde34 Allow users to save prompt responses in "arc" workflows
Summary: Ref T13546. Permit users to answer "y*" to mean "y, and don't ask me again".

Test Plan: Answered "y*" to some prompts, re-ran workflows, got auto-responses.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21331
2020-06-08 16:26:18 -07:00
epriestley
8a53b5a451 When landing changes in an empty repository, merge cleanly in Git
Summary:
Fixes T12876. Ref T13546. When you make the first change in a new Git repository, "arc land" currently can not merge it because there's nothing to merge into.

Support merging into the empty state formally, reachable by using "--into-empty" (which should be uncommon) or "arc land" in an empty repository.

Test Plan:
  - Used "arc land --into-empty --hold ..." to generate merges against the empty state under "squash" and "merge" strategies in Git.
    - Got sensible result commits with appropriate parents and content.

Maniphest Tasks: T13546, T12876

Differential Revision: https://secure.phabricator.com/D21324
2020-06-08 16:19:55 -07:00
epriestley
68f28a1718 Substantially modernize the "arc land" workflow
Summary: Ref T13546. This has a lot of dangerously rough edges, but has managed to land at least one commit in each Git and Mercurial.

Test Plan:
  - Landed one commit under ideal conditions in Git and Mercurial.
  - See followups.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21315
2020-06-08 16:17:19 -07:00
epriestley
0da395ffe4 Introduce "RepositoryLocalState", a modern version of "requireCleanWorkingCopy()"
Summary:
Ref T13546. Introduces a more structured construct for saving and restoring local repository state.

This is similar to old behavior, except that:

  - "arc.autostash" is no longer respected;
  - untracked changes are stashed; and
  - we do not offer to amend.

Test Plan: In future changes, saved and restored various permutations of local state.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21314
2020-06-08 15:40:01 -07:00
epriestley
7ac3b791b0 Provide modern config options for "arc land" configuration
Summary: Ref T13546. Adds modern support for "arc.land.onto", "arc.land.onto-remote", and "history.immutable".

Test Plan: Read configuration in a future change.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21313
2020-06-08 15:40:01 -07:00
epriestley
de607e9fbc Add modern refs and hardpoints for buildables, builds, and build plans
Summary: Ref T13546. Prepares "arc land" to use hardpoint queries to load build information.

Test Plan: Ran `arc inspect --explore revision(1234)`, got a full related object tree including build information.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21312
2020-06-08 15:39:27 -07:00
epriestley
c1a4bee4a1 Add "Author" and "Parent Revision" hardpoints to RevisionRefs
Summary: Ref T13546. These are used by a future "arc land" workflow to support the "Land changes you don't own?" and "Land changes with open dependencies?" prompts.

Test Plan: Ran a future "arc land" flow, hit both prompts.

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21311
2020-06-08 15:10:20 -07:00
epriestley
a0c346bf63 Add a support class to simplify typechecking list-of-objects return values
Summary:
With some frequency, code wants to assert that some "$o->m()" returns a list of objects of type X, possibly with unique values for some "getKey()"-style method result.

Existing checks via `PhutilTypeMap` and `assert_instances_of()` aren't quite powerful enough to do this while producing an easily understandable error state. We want to know that the error arose from a call to "$o->m()" in particular.

Test Plan: Currently used elsewhere, in Piledriver code.

Differential Revision: https://secure.phabricator.com/D21293
2020-05-28 07:33:23 -07:00
epriestley
6ec09b2f48 Replace "PhutilFileTree" with a more abstract "VectorTree"
Summary:
Ref T13520. Replace "FileTree" with a "VectorTree" that does roughly the same thing. The major goals are:

  - Compress trees which contain sequences of child directories with no sibilings.
  - Build hierarchies of paths where path components may include renames.

This is approximately similar to "FileTree" and similar to client logic in the new paths panel.

Test Plan: See next change.

Maniphest Tasks: T13520

Differential Revision: https://secure.phabricator.com/D21182
2020-04-28 12:09:56 -07:00
epriestley
d408a80ae1 Update "arc paste" for Toolsets
Summary: Ref T13490. More-or-less straightforward upgrade to modern calls.

Test Plan: Created and viewed pastes.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21104
2020-04-13 15:01:51 -07:00
epriestley
196f8f54ce Remove "backout", "close", "flag", "start", "stop", "time", and "revert" workflows
Summary: Ref T13490. These workflows don't seem worth the maintenance cost, see T13488 for discussion.

Test Plan: Grepped for methods which looked like they might only be called by these flows, only dug up the backout stuff.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21100
2020-04-13 07:09:49 -07:00
epriestley
21e80a635d Upgrade "arc download" to Toolsets
Summary:
Ref T13490. This is mostly straightforward.

  - Drop "--show" in favor of "--as -".
  - Drop support for 4+ year old "file.info" API.
  - Use modern stream-to-disk support so we get a real progress bar and don't need to buffer files into memory.

Test Plan: Downloaded various files, including large files.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21097
2020-04-12 16:18:03 -07:00
epriestley
076f7be484 Update "arc call-conduit" for Toolsets
Summary: Ref T13490. Fairly straightforward update.

Test Plan: Made various Conduit calls.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21096
2020-04-12 16:17:47 -07:00
epriestley
0f2e277cd9 Update "arc amend" for Toolsets
Summary: Ref T13490. Moves "arc amend" to Toolsets with modern ref/hardpoint code.

Test Plan: Ran "arc amend --show", "--revision", etc. Hit all the prompts and errors, probably?

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21095
2020-04-12 13:48:26 -07:00
epriestley
ff4c1e7c81 Add a "SymbolEngine" to support top-level ref resolution by symbol
Summary:
Ref T13490. I'm continuing to move toward modernizing "amend", which needs to load some objects by symbol at top level.

Add an API to support this.

Test Plan: Added an API caller to "arc inspect", ran it and hit the new code. Things seemed to work.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21094
2020-04-12 13:48:09 -07:00
epriestley
5fc50c226a Add some support code for printing refs to stdout
Summary: Ref T13490. Make terminal strings work more like HTML does in Phabricator, and make it easier to display refs.

Test Plan: Added some display code, ran `arc inspect` to hit it, saw a nice ref printed.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21093
2020-04-12 13:44:46 -07:00
epriestley
088b157444 Add ref lookup for username symbols
Summary:
Ref T13490. I'm attempting to update "arc amend", but it needs to fetch revision authors to raise an "amending a revision you don't own" error.

Support user-symbol resolution.

Along the way, this introduces some infrastructure for abstracting away iteration over a multi-page Conduit result set.

Test Plan:
  - Ran "arc inspect ..." for various "user(...)" queries.
  - Set page size to 3 and issued a general query, saw the future page it away properly.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21092
2020-04-12 13:42:51 -07:00
epriestley
1f18f25fa5 Add a "RevisionSymbolRef", revision commit messages, and make "--explore" recursive
Summary:
Ref T13490.

  - Support resolution of revision symbols into revision objects.
  - Align commit inspection better against commit symbols.
  - Make "arc inspect --explore" recursively load all object hardpoints.
  - Add a "commit message" hardpoint to "RevisionRef".

Test Plan: Used "arc inspect" to resolve commits and revisions. Used "--explore" to see the whole tree.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21091
2020-04-12 13:24:32 -07:00
epriestley
4cc05c377d Add a "CommitSymbolRef" for resolving symbolic commits into stable commit hashes
Summary:
Ref T13490. Frequently, we know the symbolic name of a commit (like "master") but need the immutable identifier for it (the commit hash).

Provide a Ref and Query for doing this lookup.

Test Plan: Ran `arc inspect symbol(...)` with various symbols, saw appropriate resolutions, nulls, or errors.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21090
2020-04-12 13:19:53 -07:00
epriestley
9a198ffcc5 Update "feature", "branch", and "bookmark" flows to report properly in "arc help"
Summary:
Ref T13490. These workflows are aliases of one another, which is a little silly, but currently all identify as "arc feature" in "arc help".

Straighten that out, at least.

Test Plan: Ran "arc help", "arc branch".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21086
2020-04-12 13:16:07 -07:00
epriestley
ccd1ebb256 Port "arc prompts" from wilds and fix a path issue in shell completion
Summary:
Ref T13490. Bring "arc prompts" from "wilds" and hook it into the prompt in "arc shell-complete".

See D21069. Fix an issue where the shell hook tested for a path other than the path it writes to.

Test Plan: Ran "arc shell-complete" with no hook and got a prompt. Shell completed things. Ran "arc prompts shell-complete".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21085
2020-04-11 10:43:05 -07:00