1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-08 13:51:02 +01:00
phorge-phorge/src/applications/config
Valerio Bozzolan 83edbffd52 Config page: add lovely git-related error messages in standard error log
Summary:
Premise: the Config page runs git commands. Spoiler: they can fail.

Before this change errors were just suppressed and ignored.

After this change you get at least a log line. Also, you get a tip for a very specific well-known error affecting recent git.

Probably suppressing stuff was fine in the moment git worked here. But nowadays
git doesn't work so easily here, since it introduced very weird additional
configurations in order for a repository to be indicated as "safe" or not.

Error suppression was a problem there, because understanding the error with
"future objects" is not trivial for most users. Really.

After this change, these errors are beautifully mentioned in the standard log
of your webserver, to the best of our communication ability.

This is a cute example of a new log line:

    Cannot identify the version of the phorge repository because the webserver does not trust it (more info on Task https://we.phorge.it/T15282).
    Try this system resolution:
    sudo git config --system --add safe.directory /var/www/phorge

Another:

    Cannot identify the version of the phorge repository because the webserver does not trust it (more info on Task https://we.phorge.it/T15282).
    Try this system resolution:
    sudo git config --system --add safe.directory /var/www/arcanist

Incidentally, these specific errors probably afflict your Phorge/Phabricator, and now
you have some useful resolution tips. You are welcome!

You can also join T15282 to discuss your specific case.

Closes T15243

Test Plan:
- visit the `/config/` page: does it worked before? it still works now
- visit the `/config/` page without `/etc/gitconfig`: you may still see "Unknown" as version - but, you finally get something in the log (instead of nothing)
- visit the `/config/` page after following your log messages: now you should see the library versions! yeeh

Additional tests:

- manually sabotage the command "git log" replacing with "gitfooolog" and visit /config page: see the unexpected 'gitfooolog command not found' log line
- manually sabotage the command "git remove" replacing with "gitremotelog" and visit /config/ page: see the unexpected 'gitremotelog command not found' log line

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, deadalnix, aklapper, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15243

Differential Revision: https://we.phorge.it/D25148
2023-06-10 13:21:41 +02:00
..
application Remove product literal strings in "pht()", part 2 2022-04-25 12:22:26 -07:00
check Correct spelling mistakes 2023-05-27 22:19:06 +01:00
constants Config re-design 2017-09-05 15:24:15 -07:00
controller Config page: add lovely git-related error messages in standard error log 2023-06-10 13:21:41 +02:00
custom Remove product literal strings in "pht()", part 3 2022-04-25 12:22:26 -07:00
editor Remove product literal strings in "pht()", part 3 2022-04-25 12:22:26 -07:00
engine When we "discover" new fatal setup issues, stop serving traffic 2016-11-21 15:54:40 -08:00
exception Apply some autofix linter rules 2014-09-10 06:55:05 +10:00
issue Remove product literal strings in "pht()", part 16 2022-04-25 16:46:25 -07:00
json Improve UI formatting of some configuration values 2015-12-05 09:58:47 -08:00
management Allow bin/config to create config file 2019-09-08 00:16:19 +00:00
module Split setup checks into "preflight" and "normal" checks 2016-09-06 11:57:18 -07:00
option Correct spelling mistakes 2023-05-27 22:19:06 +01:00
phid Mark PhabricatorPHIDType::getPHIDTypeApplicationClass() as abstract 2015-11-03 06:47:12 +11:00
query Update many Phabricator queries for new %Q query semantics 2018-11-15 03:48:10 -08:00
response Remove product literal strings in "pht()", part 4 2022-04-25 12:22:27 -07:00
schema Update MySQL schema inspection code for deprecation of integer display widths 2020-05-18 12:10:31 -07:00
storage Make the default behavior of getApplicationTransactionCommentObject() "return null" instead of "throw" 2019-02-07 14:56:38 -08:00
type Simplify one "array_keys/range" -> "phutil_is_natural_list()" in "phabricator/" 2019-02-28 07:29:36 -08:00
view Remove PHP version suffixes on "Missing Required Extensions"; Mention dnf 2023-05-20 17:47:19 +02:00