Enable submitting inline comments

Summary:
Added a --attach-inlines option to aoncmd_comment.py that, when provided, will
cause arcyon to also attach any inline comments to the submission.

Test Plan:
given a comment with any inline comments, run arcyon comment id
--attach-inlines --action comment, and the comment should be submitted along
with the inline comments.  Running without will not submit the inline comments.

Reviewers: jevripio, jfalgout

Reviewed By: jevripio

CC: arcyd

Differential Revision: https://all.phab.dev.bloomberg.com/D98836
abdi_repo: Reformat lines to look nicer
phlsys_fs: add read_text_file() for convenience

Make simple and safe reading of small text files easy to inline by
wrapping it up in a helper function.

Test Plan:
Exercised in later commits.
Add phlgitx_ignoreident for easily ignoring idents

For non-interactive uses of Git repositories, it can be undesirable to
allow the 'ident string' functionality as there are some edge-cases that
may require manual intervention.

Provide a tested utility for doing this easily.

Test Plan:
Add test driver and
$ ./precommit.sh
Arcyd: use phlgitx_ignoreident to ignore idents

In a few repositories, Arcyd has had problems where files with expanded
ident strings have been checked in.  This means that phantom local
changes will be reported and we're unable to move between branches.

Use the new phlgitx_ignoreident utility to ignore these idents.

Test Plan:
$ ./precommit.sh

Check that new repos are ignoring ident and that 'arcyd fsck' will
repair the attributes file.
$ ./testbed/arcyd/test_shell.sh
    $ cd ../arcyd2
    $ arcyd fsck
    $ rm var/repo/localhost_fs1_origin/.git/info/attributes
    $ arcyd fsck
    'var/repo/localhost_fs1_origin' is not ignoring ident attributes
    use '--fix' to attempt to fix the issues
    $ arcyd fsck --fix
    'var/repo/localhost_fs1_origin' is not ignoring ident attributes
    setting var/repo/localhost_fs1_origin to ignore ident ..
    $ arcyd fsck
phlsys_fs: Add atomic_replace_text_file()

Make it easy to atomically write files on POSIX compliant filesystems.
This can be useful where obtaining locks on files is not possible, e.g.
when writing files on NFS.

Test Plan:
$ ./precommit.sh

Modify testbed/reader-writer to exercise atomic_replace_text_file()
instead. Observe that readers always read a consistent state of the
file, although temporary files can be left behind.
testbed/reader-writer/run.sh: tidy, use for loops

Tidy up 'run.sh' by using bash for loops in place of lots of repetition.

Test Plan:
testbed/reader-writer/run.sh
Arcyd: write status files w/ atomic swap not lock

Instead of using file locks to ensure that reads of Arcyd's status files
are consistent, use the new atomic_replace_text_file() routine instead.
This enables us to share the status files across machines using NFS.

Test Plan:
$ ./precommit.sh

examine instaweb dashboard with
$ ./testbed/arcyd/test_shell.sh
phlsys_fs: remove unused *_file_lock_context()

The file_lock_context routines aren't used any more, remove them.

Test Plan:
$ git grep file_lock_context
$ ./precommit.sh
Revert "phlsys_fs: remove unused *_file_lock_context()"

Turns out that atomic_replace_text_file() doesn't work well on NFS at
all, go back to locks on local filesystem.

This reverts commit 230922ee8e2255b7eef611b7532bd3c598df82bb.
Revert "Arcyd: write status files w/ atomic swap not lock"

Turns out that atomic_replace_text_file() doesn't work well on NFS at
all, go back to locks on local filesystem.

This reverts commit 5636816ce8b767f093e2174459ca3040ad62659a.
Revert "phlsys_fs: Add atomic_replace_text_file()"

Turns out that atomic_replace_text_file() doesn't work well on NFS at
all, go back to locks on local filesystem.

Keep the tidy to use for-loop in 'testbed/reader-writer/run.sh'.

This reverts commit 43662d2c0cca9d8b567b2387eea7b039eaad3dc3.

Conflicts:
	testbed/reader-writer/run.sh
Add progress indicators to test scripts

The './precommit.sh' tests are starting to take a while, make it easier
to see what's going on by displaying a sort of progress indicator.

e.g.
    gen_doc: . ....... ...OK

In the event of failure, this also makes it easier to tell which of
the steps failed - by counting the pips and comparing to the script.

Test Plan:
$ ./precommit.sh

Determined which static tester was complaining in a particular case, to
look for instructions to ignore the individual instance of the error.
Add 'raw_call()' method to phlsys_conduit

In some cases we want to get the raw response returned from the conduit
API.  Expose a new method on the Conduit class that returns the raw
response and change __call__() to use that.

Test Plan:
$ ./precommit.sh
Exercised in subsequent commits
Add new prototype 'conduit-proxy' command

Make steps towards making it possible to grant limited admin API access
to users, based on custom rules.

Introduce a new prototype command 'conduit-proxy', which serves proxied
conduit via http(s) on a specified port.

Connections to the 'conduit-proxy' go through a trivial auth process
before being forwarded on to the real Phabricator conduit.

Separating the proxy auth process from the Phabricator auth process
means that Phabricator admin credentials may be kept secret.  It also
raises the possibility of introducing customised auth rules.

Teach phlsys_conduit how to connect to the proxy, this means that Arcyon
and Arcyd may use proxies without modification.

Test Plan:
$ ./precommit.sh

Added ./testbed/conduit-proxy/smoketest.sh to exercise the proxy
end-to-end.
Arcyd: Exercise 'external-logger' in test_shell.sh

Make it possible to exercise the path to call out to external error
handlers in the test shell.

Test Plan:
$ ./testbed/arcyd/test_shell.sh
abdt_arcydreporter: less log_system_error() detail

It's easily possible for 'detail' to exceed the length of command-line
parameters allowed when calling out to a registered external system
error logger.

Limit the amount of detail that will be sent to an arbitrary small
number to prevent errors when reporting errors.

Test Plan:
$ ./precommit.sh

Modify abdi_processrepo to raise a massive exception, verify it fails to
report the exception before the change and succeed after the change.
$ ./testbed/arcyd/test_shell.sh
precommit.sh: tidy, print space before OK

It seems to be more visually pleasing to put a space between the
progress dots and the final 'OK', let's do that.

Test Plan:
$ ./precommit.sh
Arcyd: Enforce config name conventions

The naming convention for config files is advertised in the help for
functions but hasn't been enforced, until now.

Especially interesting is the common '.git' in the repo url, which is
invalid under the scheme, in later work we can update the add
subcommands to remove .git from the 'guessed' config names for
convenience.

Test Plan:
$ ./precommit.sh
$ ./testbed/arcyd/test_shell.sh
    Try adding various invalid names
    $ cd ../arcyd
    $ arcyd add-repo localhost fs1 dev --name blah.git
    $ arcyd add-repo localhost fs1 dev --name blah-blah
    $ arcyd add-repo localhost fs1 dev --name Blah-Blah
    $ cp -R ../dev ../dev3.git
    $ arcyd add-repo localhost fs1 dev3.git
Remove '.git' from auto-guessed repo names

It's a bit annoying to have to fully-specify names for repos which have
'.git' endings.  Update the guessing logic to strip them off.

Test Plan:
    $ ./precommit.sh
    $ ./testbed/arcyd/test_shell.sh
        Try adding a repo with '.git' in the url
        $ cd ../arcyd
        $ cp -R ../dev ../dev3.git
        $ arcyd add-repo localhost fs1 dev3.git