1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00
Commit graph

17124 commits

Author SHA1 Message Date
Christopher Speck
09c3c7d879 Add support to marking commits as UNREACHABLE for Mercurial
Summary:
When previously known commits have been destroyed in a Mercurial repository, Phabricator does not end up marking the commits as unreachable. This results in daemon tasks which continuously fail and retry.

This updates `PhabricatorRepositoryDiscoveryEngine` and `PhabricatorManagementRepositoryMarkReachableWorkflow` to include support of marking commits as unreachable for Mercurial repositories.

The `PhabricatorMercurialGraphStream` also needed updated to support a stream with no starting commit.

Refs T13634

Test Plan:
1. I set up a hosted Mercurial repository.
2. I removed the head commit from the on-disk repository state.
3. I attempted to load the repository page and saw an exception due to a missing commit.
4. I went to `/manage` for the repository and scheduled an update of the repository.
5. After an updated performed, I went to the repository main page and saw there was no exception and the history view properly did not have the commit I had removed.
6. I checked the phd logs and verified there were no exceptions related to the repository.
7. I ran the `./bin/repository mark-reachable` command on the Mercurial repository and it reported that it marked the commit as unreachable.
8. I pushed the same commit back upstream and verified that the commit was found and displayed in the history view of the repository page and `mark-unreachable` did not identify it as being unreachable.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13634

Differential Revision: https://secure.phabricator.com/D21715
2021-09-04 19:05:08 -04:00
Christopher Speck
458ad4a861 Remove history query from DiffusionRepositoryController as it is unused
Summary:
The history query for the repository page isn't actually used to display any content. It looks like it was previously used to display the last user which modified a file however this looks to be removed in D21404. This removes the history query from happening as well as updates `DiffusionBrowseTableView` to remove the parameters for passing this information in, resulting in also updating `DiffusionBrowseController` to no longer need to put this information together.

Refs T13666

Test Plan:
1. I removed commits from a repository on the local state.
2. I navigated to the repository's landing page and saw that the landing page attempted to render content and only failed to load the browse files section.
3. I navigated to the history tab and verified that it showed an exception about failing to query commit information.
4. I restored the repository working state to function properly.
5. I navigated to a repository's landing page and verified it loaded properly, including showing the last modified date for each file.
6. I navigated to the Code, Branches, Tags, and History tabs to verify each tab page loaded properly.
7. I verified on the Code tab that the last modified date for each file displayed properly.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13666

Differential Revision: https://secure.phabricator.com/D21717
2021-09-04 18:50:46 -04:00
epriestley
b757e5c302 Use "MethodCallFuture" to move Diffusion Conduit exceptions to resolution time
Summary:
Depends on D21720. Ref T13666. See D21720 for additional discussion.

Use "MethodCallFuture", introduced in D21720, so that exceptions raised in "execute()" are thrown when the future is resolved, not when the future is created.

This makes exception behavior for clustered and non-clustered setups consistent, and chooses the intended (clustered) behavior in both cases, which currently deals with errors better.

Test Plan:
  - Applied both parts of the patch in T13666 (break history queries, force immediate futures) to reproduce the issue in T13666.
    - Loaded a Diffusion landing page, reproduced the error described in that task.
  - Applied this patch, verified landing page works again.
  - Removed the "break history queries" change, verified landing page works in forced-immediate mode.
  - Removed the "force immediate" change, verified landing page works in "actual future" mode.

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13666

Differential Revision: https://secure.phabricator.com/D21721
2021-09-04 14:36:41 -07:00
Leon Eckardt
fd1922c763 Update Install and Update Scripts to the new Paths and Repository links
Summary:
Set the Reposity links to actually install Phorge, Update Documentation links to the new Website.

Notes:
 - Github Mirrors are not set up. Use one anyway? Or just use the Repos at we.phorge.it?
 - Documentation Links still contain "phabricator". The Docs are changed, but the Diviner Books are not rebuilt. (Add a Cronjob or do it after every Commit?)
 - mysql-server is not included anymore in Debian environments. Should mariadb-server be used?
 - Should we print somewhere that Phorge is a Fork of Phabricator?

Test Plan:
Run the install script.
It should install Phorge and display Links to we.phore.it

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: speck, tobiaswiese

Differential Revision: https://we.phorge.it/D25019
2021-09-04 15:48:49 -04:00
MacFan4000
ce31289228 (PhabricatorENV) update doclinks to link to we.phorge.it instead of secure.phabricator.com
Summary: With this change, links to documentation will point to we.phorge.it rather then secure.phabricator,com

Test Plan: No testing needed - simple URL update

Reviewers: O1 Blessed Committers, deadalnix

Reviewed By: O1 Blessed Committers, deadalnix

Subscribers: taavi, speck, tobiaswiese

Differential Revision: https://we.phorge.it/D25014
2021-09-04 15:47:05 -04:00
James Brown
a4948ec800 Add conduit endpoints for querying legalpad
Summary:
This diff adds conduit methods for searching for legalpad documents and signatures. This is very helpful for auditing who's actually signed a document. It also fixes the "contributorPHIDs" constraint in the existing search engine.

In order to expose legalpad signatures through Conduit, this adds a `phid` column to the `legalpad_documentsignature` table. It includes a migration (in the style of many previous phid-adding migrations) to actually populate the column.

Test Plan: We run this on my company's internal fork and it seems to work okay. I don't think any other conduit methods anywhere have tests (???), but if you can point me at one I'm glad to write a unit test!

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

Subscribers: 20after4, speck, tobiaswiese

Differential Revision: https://we.phorge.it/D25018
2021-09-04 13:53:13 -04:00
Dmitri Iouchtchenko
1965b78b34 Fix subtype extension support check
Summary: Fixes T13663. `supportsSubtypes` tries to create an editable object, but this isn't always valid for `PhabricatorCalendarImport`. Use `instanceof` instead.

Test Plan:
  - Edited calendar import, tasks (2 different subtypes), and projects (2 different subtypes).
  - Changed task subtypes using {nav Change Subtype} action and batch editor.
  - Changed task and project subtypes using Conduit.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T13663

Differential Revision: https://secure.phabricator.com/D21714
2021-08-20 18:49:35 -04:00
epriestley
8daaf5ef21 Pass a real context object to Phriction previews, fixing mentions
Summary:
Fixes T13662. Phriction currently passes a map as a "context object", but this code is ancient and predates the modern meaning of a "context object". In modern code, context objects should be real objects.

Provide a real object as a context object. We do this by either loading the actual document or constructing a synthetic version of it.

Test Plan:
  - Edited an existing document, observing the preview:
    - Used a mention rule, saw a preview.
    - Used `[[ a ]]` and `[[ ./a ]]` absolute and relative reference rules, saw accurate previews.
  - Edited a new document, observing the preview:
    - Used a mention rule, saw a preview.
    - Used absolute/relative references, saw accurate previews.
  - Grepped for other references to the removed properties (`phriction.isPreview` and `phriction.slug`), found none remaining.

Reviewers: 0

Reviewed By: 0

Maniphest Tasks: T13662

Differential Revision: https://secure.phabricator.com/D21709
2021-08-02 08:36:15 -07:00
epriestley
c7550dbee9 Fix Phriction document previews for the root document ("/") with Apache option "MergeSlashes On"
Summary:
Ref T13662. I ran into this while trying to reproduce the mention issue discussed there.

Currently, the root document (with slug "/") attempts to preview using the URI `/phriction/preview//` (with two `//` at the end). This is collapsed into "/phriction/preview/" by Apache if "MergeSlashes On" is configured, which is the default behavior. The route then 404s.

Instead, just use "/phriction/preview/?slug=/" so this endpoint functions properly regardless of the "MergeSlashes" configuration.

Test Plan:
  - Configured Apache with "MergeSlashes On" (which is the default behavior).
  - Tried to preview a content edit of the root document in Phriction, which didn't work and generated 404s for "/phriction/preview//" in the console log.
  - Applied patch.
  - Previwed content in Phriction (which now worked properly).
  - Accessed `/a//b///c////` and similar with "MergeSlashes On" and "MergeSlashes Off", confirmed that this option controls whether PHP receives a URI with or without merged slashes in "__path__" after rewriting.

Reviewers: 0

Reviewed By: 0

Maniphest Tasks: T13662

Differential Revision: https://secure.phabricator.com/D21708
2021-08-02 08:36:15 -07:00
epriestley
dbe2fb466f Add an "eval" rule to Remarkup
Summary:
Ref T13658. This adds a simple expression evaluator to Remarkup and supports platform name expressions. The syntax is:

```
${{{strings.platform.server.name}}}
```

Note that this won't work inside code blocks (or literal blocks, or other block-level literal elements) right now, although it could be made to selectively (the ".path" expressions might be useful in documentation codeblocks).

Test Plan: {F9391006}

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21713
2021-07-29 16:46:50 -07:00
epriestley
cc8cbed029 Make "DifferentialDiff->properties" a proper "attachable" property
Summary:
See PHI498. This should be initialized to "self::ATTACHABLE" like other attachable properties, but is currently initialized to "array()".

Initialize it the normal way and try to catch all code paths which may have accessed it without actually loading and attaching it.

Also, remove UI for the very old "excuse" property, which "arc" has not written for well more than a year.

Test Plan: Grepped for affected symbols, loaded various revision pages. Somewhat tricky to be 100% sure that every pathway is caught, but it should be obvious if I missed anything once someone hits the code path.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Differential Revision: https://secure.phabricator.com/D21710
2021-07-27 13:39:12 -07:00
epriestley
387d3b4983 Resolve deleted packages properly as having no mailable members
Summary:
Fixes T13648. If a package recipient has been destroyed, this query currently fails to return an expanded recipient value.

Instead, make sure all input PHIDs get an output. For destroyed packages, the output will just be an empty list.

Test Plan:
  - Added a package to a revision as a reviewer.
  - Destroyed the package.
  - Commented on the revision.
  - Processed the publishing worker with `bin/worker execute`.
  - Before: fatal after expanding the destroyed package.
  - After: clean publish.

Maniphest Tasks: T13648

Differential Revision: https://secure.phabricator.com/D21707
2021-07-21 14:50:07 -07:00
epriestley
4cffaa600b Rename "HarbormasterRestartException" to "HarbormasterMessageException"
Summary: Ref T13072. This exception is now raised by all of the message-sending code. Pretty straight find/replace.

Test Plan: Grepped for old class name, no hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21699
2021-07-21 14:17:00 -07:00
epriestley
4c4123f98b Allow "harbormaster.sendmessage" to send control command (pause, restart, abort, resume) to Builds/Buildables
Summary: Ref T13072. Expand the role of "harbormaster.sendmessage" and allow it to send control messages to Builds and Buildables.

Test Plan: Read documentation, sent commands to Builds and Buildables, hit a bunch of error cases, will deploy to catch full-lifecycle Build Target use cases.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21698
2021-07-21 14:17:00 -07:00
epriestley
3df1e17527 Add a side nav to Conduit API method console pages
Summary: Ref T13072. Make large Conduit doc pages a bit more navigable. This prepares for updating "harbormaster.sendmessage" to support sending messages to builds.

Test Plan: Viewed various Conduit API documentation pages, clicked links.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21696
2021-07-21 14:16:59 -07:00
epriestley
2ff1d4b3b0 Add stub "harbormaster.build.edit" and "harbormaster.buildable.edit" API methods
Summary: Ref T13072. These don't do anything useful yet, but get the skeletons in.

Test Plan: Loaded documentation pages without fataling.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21695
2021-07-21 14:16:59 -07:00
epriestley
346ffc51e1 Modularize "HarbormasterBuildableTransaction"
Summary: Ref T13072. Trivially convert this into a modular transaction type.

Test Plan: Issued commands to a buildable.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21694
2021-07-21 14:16:58 -07:00
epriestley
706b91adf6 Remove "HarbormasterBuildableTransaction::TYPE_CREATE"
Summary: Ref T13072. This transaction type has no writers and is mooted by EditEngine.

Test Plan: Grepped for transaction constant.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21693
2021-07-21 14:16:57 -07:00
epriestley
1a1395579f Remove "HarbormasterBuildCommand"
Summary: Ref T13072. Update the last few constant references to this class and remove it.

Test Plan: Grepped for "HarbormasterBuildCommand", got no hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21692
2021-07-21 14:16:57 -07:00
epriestley
1212dc5fbe Modularize almost all Harbormaster build message workflows and UI/UX
Summary: Ref T13072. Push nearly all Harbormaster build message logic into the new per-message transaction classes.

Test Plan:
  - Issued every message to Buildables.
  - Issued every message to Builds.
  - Looked at a big pile of error messages, couldn't find any typos.
  - Grepped for affected symbols, etc.
  - Ran `bin/harbormaster restart ...`.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21691
2021-07-21 14:16:56 -07:00
epriestley
8bbee92139 Modularize individual Harbormaster build messages
Summary:
Ref T13072. Further modularize build messages by applying each one in a separate transaction type.

This makes it easier to add new types of messages (although I have no particular plans to do this, offhand) and reduces the amount of switch-boilerplate.

This will probably also simplify validating "harbormaster.sendmessage".

Test Plan:
  - Applied all commands.
  - Ran migration, saw transactions render properly

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21690
2021-07-21 14:16:56 -07:00
epriestley
6dfea0adad Modularize HarbormasterBuildTransaction
Summary: Ref T13072. Update "HarbormasterBuild" to use modern modular transactions.

Test Plan:
  - Aborted, restarted, paused, and resumed a build.
  - Used `bin/harbormaster restart`.
  - Grepped for use of old "::TYPE_COMMAND" constant, didn't find any hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21689
2021-07-21 14:16:55 -07:00
epriestley
b84c02959a Remove "HarbormasterBuildTransaction::TYPE_CREATE"
Summary: Ref T13072. No callers currently generate these transactions, and they probably never have. Remove them.

Test Plan: Grepped for "HarbormasterBuildTransaction::TYPE_CREATE" and "self::TYPE_CREATE" in the class, found no hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21688
2021-07-21 14:16:55 -07:00
epriestley
bf83fffca1 Correct the flow of edit authority when sending messages to HarbormasterBuild objects
Summary:
Ref T13072. Currently, Harbormaster builds react to messages by applying a transaction inline (which can race) that has no real effect.

Later, the BuildEngine picks up the mesasge and applies a real effect, but this isn't transactional.

This is backwards, and makes it more difficult to transition to ModularTransaction and EditEngine. The desired workflow is:

  - sending a message //just// writes to the message table (and queues a worker to process the message);
  - the BuildEngine processes the message and applies effects in a transactional way.

Force this into at least roughly the right sequence of behaviors. This paves the way for porting to ModularTransaction, which should allow further cleanup.

Test Plan: Paused, resumed, aborted, and restarted a build. Ran BuildWorkers to process the commands, saw builds update appropriately.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21687
2021-07-21 14:16:54 -07:00
epriestley
012af00731 Improve formality of "HarbormasterBuild" states
Summary:
Ref T13072. Currently, Builds have basic states (like "passed" and "failed") and pending states where a command has been issued but not yet executed (pausing, resuming, restarting, and aborting).

These are handled in a bit of an ad-hoc way, and not everything treats them the same way. In particular, the build page can concurrently report a build as "Aborting" and "Pausing", with different icons and colors.

Make everything use the same logic so that a Build can only be in exactly zero or one pending state, and use the same icons and colors.

Also tighten up which transitions are allowed: for example, it doesn't make sense to pause an aborting build.

The tighter rules don't all produce great UX right now (like "You can't pause this build.", when it would be better as "You can't pause a build which is already aborting." or similar), but just leave that alone for now.

Test Plan: Viewed builds, applied various state changes, ran BuildWorker to effect the state changes, grepped for affected methods, tried to issue various out-of-sequence build commands.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21685
2021-07-21 14:16:54 -07:00
epriestley
b48d4fabaf Merge the "HarbormasterBuildCommand" table into "HarbormasterBuildMessage"
Summary:
Ref T13072. These two similar tables don't make sense to keep separate. Instead, make Build a valid receiver for BuildMessage objects.

These tables are practically the same, so this is straightforward: just copy the rows in and then drop the old table.

(This table was trivial and ephemeral anyway, so I'm not bothering to do the usual "keep it around for a couple years just in case".)

Test Plan:
  - Populated BuildCommand table, ran migration, saw Builds end up in the proper transitional state (e.g., pausing, aborting, restarting) with appropriate queued messages.
  - Queued new messages by clicking UI buttons.
  - Ran BuildWorkers, saw them process messages and mark them as consumed.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21684
2021-07-21 14:16:53 -07:00
epriestley
0f93d1ffe4 Rename "HarbormasterBuild" methods to prepare for use of the "BuildMessages" table
Summary:
Ref T13072. Rename various "command" properties to "message" properties, to prepare for merging "HarbormasterCommand" into "HarbormasterMessage".

This change only renames variables and methods and should not affect program behavior.

Test Plan: Grepped for affected symbols, found no unmodified hits.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

Differential Revision: https://secure.phabricator.com/D21683
2021-07-21 14:16:52 -07:00
epriestley
af6cc0c934 Use "resolve()", not "execute()", for PhutilExecPassthru callsites in Phabricator
Summary: Ref T13660. Clean up callsites to "PhutilExecPassthru->execute()" to prepare to deprecate it.

Test Plan:
  - Grepped for "PhutilExecPassthru" and looked for callsites.
  - Ran `GIT_SSH=.../ssh-connect git ls-remote origin` to execute the "ssh-connect" code.
  - The two passthru future methods have no callers and could possibly be removed, but I'm just letting sleeping dogs lie for now.

Reviewers: cspeckmim

Reviewed By: cspeckmim

Maniphest Tasks: T13660

Differential Revision: https://secure.phabricator.com/D21703
2021-07-21 10:21:06 -07:00
Dmitri Iouchtchenko
2f1acf8b10 Suppress PHP 8 deprecation warning in startup
Summary: Ref T13588. See D21497. As of PHP 8, the XML entity loader is disabled by default and the `libxml_disable_entity_loader` function is deprecated. Thus suppress the deprecation warning for now; we could skip the function call, but this is safer.

Test Plan:
* Still works with PHP 7.
* No more deprecation message with PHP 8.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T13588

Differential Revision: https://secure.phabricator.com/D21701
2021-07-20 21:07:33 -04:00
Mukunda Modell
a0b91de535 New MediaWiki logo for the icon that represents the MediaWiki oauth provider.
Summary: Replaced the old logo with a new png.

Test Plan: I only tested that the new image was the same dimensions, format and filename as the old one.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D21661
2021-07-11 20:27:58 -05:00
Christopher Speck
e5de7f0843 Update templates used with mercurial to remove '--debug'
Summary:
Refer to discussion on D21677#275541

Refs D21681 (arcanist changes)

Phabricator has several uses of the `--debug` flag being used with Mercurial. Use of this flag causes additional output to be added which Phabricator needs, however the behavior of `--debug` is not guaranteed to be stable, and in newer versions of Mercurial there have been additional output that has caused Phabricator to choke on parsing the output. This change removes several uses of `--debug` in favor of using `--template` with the `hg log` or `hg annotate` commands in combination with the `{p1.node}` or `{p2.node}` template format.

The use of `{p1node}` format in templates was added in [[ https://www.mercurial-scm.org/wiki/WhatsNew/Archive#Mercurial_2.4_.282012-11-01.29 | Mercurial 2.4 (2012) ]]. This format was deprecated in [[ https://www.mercurial-scm.org/wiki/WhatsNew#Mercurial_4.9_.282019-02-01.29 | Mercurial 4.9 (2019) ]] in favor of using `{p1.node}` format which is unclear when this new format was added (presumably earlier than Mercurial 4.9).

The use of `--template` with `hg annotate` is only officially supported in [[ https://www.mercurial-scm.org/wiki/Release4.6 | Mercurial 4.6 (2018) ]], though does appear to work in 4.5 but is not documented.

Since the `{p1node}` format was introduced in 2.4 this bumps the required version of `hg` to 2.4 (from 1.9). Since the `annotate --template` feature wasn't added until 4.6 (which is still fairly recent), the use of it is gated on a capability test, but still preferred for use where possible to avoid extraneous output from `--debug` flag.

Test Plan:
I verified I could do the following in a mercurial repository, while having mercurial 5.8 installed:
1. Navigate and view files in Diffusion under e.g. `/source/test-repo/`.
2. While viewing a file in Diffusion verified that I could view the blame of the file and the history/annotations looked accurate for the files I was browsing.
3. From the blame sidebar, select to view a commit which loaded and displayed changes properly.
4. View the history of the repository under e.g. `/source/test-repo/history/default/`. I verified the history looked correct and the tree-like structure showing relationship of commits also looked accurate.

I setup mercurial to run version 4.4, created a new repository, added some commits, and verified all the above behavior still works properly.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D21679
2021-07-09 12:35:20 -04:00
epriestley
5521f76fe4 Remove some "Phacility" and "epriestley" references
Summary:
Ref T13658. This just scrubs some of the simple references from the codebase.

Most of what's left is in documentation which won't be relevant for a fork and/or which I need to separately revise (or more-or-less delete) at some point anyway.

I removed the "install RHEL" and "install Ubuntu" scripts outright since I don't have any reasonable way to test them and don't plan to maintain them.

Test Plan: Grepped for "phacility", "epriestley"; ran unit tests.

Reviewers: cspeckmim

Reviewed By: cspeckmim

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13658

Differential Revision: https://secure.phabricator.com/D21678
2021-07-08 10:46:17 -07:00
Christopher Speck
14c516b7a1 Updating the filtering of Mercurial debug output
Summary:
With newer versions of Mercurial come newer debug messages which need filtered out.

1. In the scenario of Phabricator observing a hosted Mercurial repository which exists on a server in a multi-user environment it's possible that a repository computes branch cache at a tip revision which is not present. When this happens Mercurial will include in the debug output this information. This message indicates that the cache is going to be re-computed. See https://www.mercurial-scm.org/pipermail/mercurial/2014-June/047239.html.
2. Likely in some version with added or improved support for `pager` the debug info seems to indicate when a pager is being invoked for a command. This seems to print out regularly despite piping the stdout.
3. If the repository on Phabricator ever had the `largefiles` extension enabled then some additional details about "updated patterns" will print out.

Test Plan:
I verified an observed repository's history could be browsed, specifically the history of files which previously resulted in "Undefined offset: 1".

Added a unit test to check the results of `filterMercurialDebugOutput()`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D21677
2021-07-06 17:27:57 -04:00
Christopher Speck
9637420861 Update a few random typos
Summary: Found a few typos which could be updated.

Test Plan:
I tested the Configuration page change by navigating to `/config` and verifying the page title set in the browser as well as the page title text on the page
|Before|After|
|---|---|
|{F9013208}|{F9013210}|
|{F9013300}|{F9013301}|

I verified the Conduit error message by navigating to `/auth/start/?__conduit__=1`
{F9013289}

The CircleCI error message was not verified due to the involvement of testing with CircleCI however the change is very minor and has very little risk of impacting any functionality.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D21675
2021-06-27 17:38:34 -04:00
ekubischta
69cb760921 Updated .arclint in Phorge to exclude package-lock.json from Aphlict setup
Summary:
Aphlict requires a machine generated `package-lock.json` that can trigger linters unnecessarily.

This revision excludes it from all linters

Test Plan:
**Testing**

```name="Fake Change to set off the linter""
diff --git a/support/aphlict/server/package-lock.json b/support/aphlict/server/package-lock.json
index 8af62ae233..a417725182 100644
--- a/support/aphlict/server/package-lock.json
+++ b/support/aphlict/server/package-lock.json
@@ -2,11 +2,12 @@
   "name": "aphlict-server",
   "requires": true,
   "lockfileVersion": 1,
+  "testing" : true,
   "dependencies": {
     "ws": {
       "version": "7.5.0",
       "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz",
-      "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw=="
+      "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfi4vw=="
     }
   }
 }
```

```name="arc lint results"
root@63c842bff39e:/srv/phorge/phorge# arc lint
>>> Lint for support/aphlict/server/package-lock.json:

   Warning  (TXT3) Line Too Long
    This line is 156 characters long, but the convention is 80 characters.

               7     "ws": {
               8       "version": "7.5.0",
               9       "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz",
    >>>       10       "integrity": "sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfi4vw=="
              11     }
              12   }
              13 }
root@63c842bff39e:/srv/phorge/phorge#
```

Updated change

```name="Change to .arclint"
diff --git a/.arclint b/.arclint
index f215d93fdc..ca89c601e4 100644
--- a/.arclint
+++ b/.arclint
@@ -2,7 +2,8 @@
   "exclude": [
     "(^externals/)",
     "(^webroot/rsrc/externals/(?!javelin/))",
-    "(/__tests__/data/)"
+    "(/__tests__/data/)",
+    "(^support/aphlict/server/package-lock.json)"
   ],
   "linters": {
     "chmod": {
```

```name="arc lint results"
root@63c842bff39e:/srv/phorge/phorge# arc lint
 OKAY  No lint messages.
root@63c842bff39e:/srv/phorge/phorge#
```

Reviewers: O1 Blessed Committers, deadalnix, eax, speck

Reviewed By: O1 Blessed Committers, deadalnix, eax, speck

Subscribers: speck, tobiaswiese

Maniphest Tasks: T15021

Differential Revision: https://we.phorge.it/D25012
2021-06-26 15:48:55 +00:00
epriestley
a641ec82a3 Add an "Authority" control to Packages to support "Watcher" packages
Summary: See T13657. An install has "watcher" packages which should not allow owners to "Force Accept" other packages.

Test Plan:
  - Created package A, which I own, on "/", with "Weak" authority.
  - Created package B, which I do not own, on "/src".
  - Created a revision which touches "/src" and added package B as a reviewer.
  - Attempted to accept the revision...
    - Before patch: permitted to "Force Accept" for package B.
    - After patch: not allowed to "Force Accept" for package B.
  - Verified that setting package "A" back to "Strong" authority allows a force-accept for package B.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Differential Revision: https://secure.phabricator.com/D21674
2021-06-25 13:48:46 -07:00
epriestley
bf889c1c08 Correct a mistaken path in the "Advanced Configuration" documentation
Summary: Ref PHI2071. This path is incorrect; the correct path is `local.json`.

Test Plan: Looked in my `conf/local/` directory.

Differential Revision: https://secure.phabricator.com/D21663
2021-06-25 13:48:31 -07:00
Dmitri Iouchtchenko
1b54afdce5 Saturate day of month in datepicker
Summary:
The datepicker could step by the wrong number of months, due to the date rolling over to the next month when the number of days in the month is exceeded. For example, going forward from January 31 would jump to March 3, while going backward from July 31 would only go to July 1.

Push the date back to ensure that the datepicker stays in the correct month when switching.

Test Plan: Changed months starting from an assortment of dates.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: artms, Korvin

Differential Revision: https://secure.phabricator.com/D21673
2021-06-24 20:02:51 -04:00
Amaury Séchet
e7740c8669 Add HarbormasterHookController as an entry point for all Harbormaster hooks
Summary: This makes the set of hooks easily extensible, as a first step toward integrating more 3rd party CI in phorge.

Test Plan: Send requests to `/harbormaster/hook/circleci/` and `/harbormaster/hook/buildkite/` and check they run the proper handler.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: Matthew, speck, tobiaswiese

Maniphest Tasks: T15018

Differential Revision: https://we.phorge.it/D25005
2021-06-21 10:48:30 +00:00
Amaury Séchet
2258ba8535 Add package.json for aphlict
Summary: This makes the whole setup easier, future proof and reproducible.

Test Plan:
  cd support/aphlict/server/
  npm install

See that ws gets installed as expected.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: Matthew, Ekubischta, speck, tobiaswiese

Maniphest Tasks: T15019

Differential Revision: https://we.phorge.it/D25006
2021-06-21 10:46:27 +00:00
Matthew Bowker
af36da4741 Rename example sshd files
Test Plan: Looked at new files, made sure the only changes were to rename the files in line with the documentation

Reviewers: O1 Blessed Committers, eax

Reviewed By: O1 Blessed Committers, eax

Subscribers: speck, tobiaswiese

Maniphest Tasks: T15017

Differential Revision: https://we.phorge.it/D25010
2021-06-20 23:32:17 -06:00
Matthew Bowker
1ddb953b9f Update Diviner documentation to reference Phorge instead of Phabricator.
Summary: This commit also removes references to support pacts and updates links to point to the new upstream.

Test Plan: Generated Diviner documentation on a local install and verified that the changes look good.

Reviewers: O1 Blessed Committers, chris

Reviewed By: O1 Blessed Committers, chris

Subscribers: chris, speck, tobiaswiese

Maniphest Tasks: T15012

Differential Revision: https://we.phorge.it/D25007
2021-06-19 18:54:24 -06:00
Christopher Speck
7157dd96b3 T15006: Update .arcconfig to point to we.phorge.it
Summary:
Update the `.arcconfig` file to point to our decided-upon URL for hosting

Refs T15006

Test Plan:
I used `arc which` and verified it identified `https://we.phorge.it`:
```lang=console
REPOSITORY
To identify the repository associated with this working copy, arc followed this process:

    Configuration value "repository.callsign" is empty.

    This repository has no VCS UUID (this is normal for git/hg).

    The remote URI for this working copy is
    "ssh://git@we.phorge.it/source/phorge.git".

    Found a unique matching repository.

    This working copy is associated with the Phorge repository.
```

Reviewers: avivey, chris, tobiaswiese

Reviewed By: avivey, tobiaswiese

Maniphest Tasks: T15006

Differential Revision: https://we.phorge.it/D25001
2021-06-18 14:51:47 -04:00
Aviv Eyal
fda1a55450 Update Readme
Summary: Ref T15006

Test Plan: We'll test it in prod

Reviewers: #trusted_contributors, chris, tobiaswiese

Reviewed By: #trusted_contributors, chris, tobiaswiese

Subscribers: tobiaswiese, chris

Maniphest Tasks: T15006

Differential Revision: https://we.phorge.it/D25000
2021-06-18 11:36:31 -04:00
epriestley
51cb7a3db9 Provide an ad-hoc maintenance lock for clustered repositories
Summary: Ref T13614. Provide "bin/repository lock" to temporarily lock repositories for manual maintenance.

Test Plan:
  - Read instructions.
  - Used `bin/repository lock` according to the instructions.
  - Saw Storage tab in Diffusion report lock held during maintenance, released after it completes.
  - Saw "maintenance" push log generated and repository version bump.
  - Tried to lock some invalid repositories.

Maniphest Tasks: T13614

Differential Revision: https://secure.phabricator.com/D21671
2021-06-01 08:29:54 -07:00
epriestley
12a5eb4062 Allow maintenance scripts to write synthetic events to the push log that act as repository updates
Summary:
Ref T13614. When a script holds the write lock but modifies the repository directly (rather than by pushing), the repository version won't change when the script releases the write lock. Thus, the writes may not propagate to other nodes (it depends which node lucks out and accepts the next write).

To guarantee that writes propagate, allow these scripts to pretend they pushed the repository. These are bare-bones valid events flagged as "Maintenance".

Test Plan:
  - Wrote a script to hold the write lock, wait (or pretend to do something), then release the write lock.
  - Applied patches, modified script to use new APIs ("newMaintenanceEvent()").
  - Ran script, saw repository verison bump and relevant push logs:

{F8814923}

Maniphest Tasks: T13614

Differential Revision: https://secure.phabricator.com/D21670
2021-06-01 08:29:54 -07:00
epriestley
bdda7eed07 Improve display behavior for write locks held by omnipotent users
Summary:
Ref T13614. When an omnipotent user calls "synchronizeWorkingCopyBeforeWrite()", we record a WorkingCopyVersion record with a null "userPHID". The UI then renders this as "Unknown Object (????)".

Improve this behavior:

  - When no PHID is available, just render nothing in the UI (this doesn't seem meaningfully different from no version existing at all).
  - Allow callers to provide an acting user PHID, similar to Editor.

There's currently no way to perform this kind of write legitimately in the upstream, but T13614 is providing one.

Test Plan:
  - Wrote a script that calls "synchronizeWorkingCopyBeforeWrite()" as the omnipotent user.
  - Ran script, saw "Unknown Object (????)" in the UI.
  - Applied UI fix, saw empty UI.
  - Applied "acting as" fix, modified script to act as the Diffusion application, ran script, saw "Diffusion" attribution in UI.

{F8814806}

Maniphest Tasks: T13614

Differential Revision: https://secure.phabricator.com/D21669
2021-06-01 08:29:53 -07:00
epriestley
a8f429cdbf Correct an issue where "dashboard.panel.edit" fatals in the API console
Summary:
Ref T13650. Currently, viewing the API console help page for this method fatals because it constructs a generic, untyped panel.

As a step toward improving this, generate a concrete panel type instead. This isn't the best possible fix, see T13650 for discussion.

Test Plan: Viewed "dashboard.panel.edit" API page, now saw a usable page.

Maniphest Tasks: T13650

Differential Revision: https://secure.phabricator.com/D21668
2021-05-31 23:49:14 -07:00
epriestley
ad05ee00c0 Remove documentation for support, feature requests, contributing code, and filing bug reports
Summary: Ref T13654.

Test Plan: Read documents.

Maniphest Tasks: T13654

Differential Revision: https://secure.phabricator.com/D21665
2021-05-29 14:10:07 -07:00
epriestley
9ceb664535 Document Phabricator as no longer actively maintained
Summary: Ref T13654.

Test Plan: Read document.

Maniphest Tasks: T13654

Differential Revision: https://secure.phabricator.com/D21664
2021-05-29 13:58:22 -07:00