Changeset View
Changeset View
Standalone View
Standalone View
src/docs/user/userguide/diffusion_updates.diviner
@title Diffusion User Guide: Repository Updates | @title Diffusion User Guide: Repository Updates | ||||
@group userguide | @group userguide | ||||
Explains how Diffusion updates repositories to discover new changes. | Explains how Diffusion updates repositories to discover new changes. | ||||
Overview | Overview | ||||
======== | ======== | ||||
When Phabricator is configured to import repositories which are hosted | When Phorge is configured to import repositories which are hosted | ||||
elsewhere, it needs to poll those repositories for changes. If it polls too | elsewhere, it needs to poll those repositories for changes. If it polls too | ||||
frequently, it can create too much load locally and on remote services. If it | frequently, it can create too much load locally and on remote services. If it | ||||
polls too rarely, it may take a long time for commits to show up in the web | polls too rarely, it may take a long time for commits to show up in the web | ||||
interface. | interface. | ||||
This document describes the rules around polling and how to understand and | This document describes the rules around polling and how to understand and | ||||
adjust the behavior. In general: | adjust the behavior. In general: | ||||
- Phabricator chooses a default poll interval based on repository | - Phorge chooses a default poll interval based on repository | ||||
activity. These intervals range from every 15 seconds (for active | activity. These intervals range from every 15 seconds (for active | ||||
repositories) to every 6 hours (for repositories with no commits in two | repositories) to every 6 hours (for repositories with no commits in two | ||||
months). | months). | ||||
- If you use `arc` to push commits, or you host repositories on Phabricator, | - If you use `arc` to push commits, or you host repositories on Phorge, | ||||
repositories automatically update after changes are pushed. | repositories automatically update after changes are pushed. | ||||
- If you don't use `arc` and your repository is hosted elsewhere, this | - If you don't use `arc` and your repository is hosted elsewhere, this | ||||
document describes ways you can make polling more responsive. | document describes ways you can make polling more responsive. | ||||
Default Behavior | Default Behavior | ||||
================ | ================ | ||||
By default, Phabricator determines how frequently to poll repositories by | By default, Phorge determines how frequently to poll repositories by | ||||
examining how long it has been since the last commit. In most cases this is | examining how long it has been since the last commit. In most cases this is | ||||
fairly accurate and produces good behavior. In particular, it automatically | fairly accurate and produces good behavior. In particular, it automatically | ||||
reduces the polling frequency for rarely-used repositories. This dramatically | reduces the polling frequency for rarely-used repositories. This dramatically | ||||
reduces load for installs with a large number of inactive repositories, which | reduces load for installs with a large number of inactive repositories, which | ||||
is common. | is common. | ||||
For repositories with activity in the last 3 days, we wait 1 second for every | For repositories with activity in the last 3 days, we wait 1 second for every | ||||
10 minutes without activity. The table below has some examples. | 10 minutes without activity. The table below has some examples. | ||||
Show All 32 Lines | |||||
Repositories that are currently importing are always updated at the minimum | Repositories that are currently importing are always updated at the minimum | ||||
update frequency so the import finishes as quickly as possible. | update frequency so the import finishes as quickly as possible. | ||||
Triggering Repository Updates | Triggering Repository Updates | ||||
============================= | ============================= | ||||
If you want Phabricator to update a repository more quickly than the default | If you want Phorge to update a repository more quickly than the default | ||||
update frequency (for example, because you just pushed a commit to it), you can | update frequency (for example, because you just pushed a commit to it), you can | ||||
tell Phabricator that it should schedule an update as soon as possible. | tell Phorge that it should schedule an update as soon as possible. | ||||
There are several ways to do this: | There are several ways to do this: | ||||
- If you push changes with `arc land` or `arc commit`, this will be done | - If you push changes with `arc land` or `arc commit`, this will be done | ||||
for you automatically. These commits should normally be recognized within | for you automatically. These commits should normally be recognized within | ||||
a few seconds. | a few seconds. | ||||
- If your repository is hosted on Phabricator, this will also be done for you | - If your repository is hosted on Phorge, this will also be done for you | ||||
automatically. | automatically. | ||||
- You can schedule an update from the web interface, in Diffusion > | - You can schedule an update from the web interface, in Diffusion > | ||||
(Choose a Repository) > Manage Repository > Status > Update Now. | (Choose a Repository) > Manage Repository > Status > Update Now. | ||||
- You can make a call to the Conduit API method `diffusion.looksoon`. This | - You can make a call to the Conduit API method `diffusion.looksoon`. This | ||||
hints to Phabricator that it should poll a repository as soon as it can. | hints to Phorge that it should poll a repository as soon as it can. | ||||
All of the other mechanisms do this under the hood. | All of the other mechanisms do this under the hood. | ||||
In particular, you may be able to add a commit hook to your external repository | In particular, you may be able to add a commit hook to your external repository | ||||
which calls `diffusion.looksoon`. This should make an external repository about | which calls `diffusion.looksoon`. This should make an external repository about | ||||
as responsive as a hosted repository. | as responsive as a hosted repository. | ||||
If a repository has an update scheduled, the Diffusion > (Choose a | If a repository has an update scheduled, the Diffusion > (Choose a | ||||
Repository) > Edit Repository interface will show that the repository is | Repository) > Edit Repository interface will show that the repository is | ||||
prioritized and will be updated soon. | prioritized and will be updated soon. | ||||
Troubleshooting Updates | Troubleshooting Updates | ||||
======================= | ======================= | ||||
You can manually run a repository update from the command line to troubleshoot | You can manually run a repository update from the command line to troubleshoot | ||||
issues, using the `--trace` flag to get full details: | issues, using the `--trace` flag to get full details: | ||||
phabricator/ $ ./bin/repository update --trace <repository> | phorge/ $ ./bin/repository update --trace <repository> | ||||
To catch potential issues with permissions, run this command as the same user | To catch potential issues with permissions, run this command as the same user | ||||
that the daemons run as. | that the daemons run as. | ||||
Next Steps | Next Steps | ||||
========== | ========== | ||||
Continue by: | Continue by: | ||||
- troubleshooting in greater depth with | - troubleshooting in greater depth with | ||||
@{article:Troubleshooting Repository Imports}. | @{article:Troubleshooting Repository Imports}. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0