[en] Acrolinx for GitHub reads its configuration from the following sources:
-
[en] A user-specific, local config file:
-
[en] Path to file given with --config command-line option
-
[en] Path to file found in
ACROLINX_GITHUBHOOK_CONFIGURATION
environment variable -
[en] Default
~/.config/Acrolinx/githubhook/acrolinx-githubhook.edn
-
-
[en] Environment variables
-
[en] System properties given at the command line.
-
[en] A remote file in a GitHub repository, given by the
:data-repo-content-url
configuration. This is called the global remote configuration file. -
[en] When processing an event, another remote configuration file from the repository that triggered the event is read for a selected set of settings. This is called the repository-specific configuration file.
[en] We recommend using the user-specific configuration file or environment variables for sensitive settings like access tokens and the Acrolinx URL. Manage all other settings in the remote configuration file. Some settings aren't supported in the remote configuration file, though.
[en] This program uses the environ library and merges that into everything found in the config file. That yields the following order of settings (winners first):
-
[en] Repository-specific configuration file for selected settings
-
[en] Remote configuration file
-
[en] Java system properties (-D switch on the command line)
-
[en] Environment variables
-
[en] User-specific configuration file
[en] Naming conventions for settings are:
-
[en] Properties are lowercase and separated by a dot.
-
[en] Environment variables are all uppercase and separated by an underscore.
-
[en] Configuration file has an EDN map with kebab-case keys.
[en] For example, you can do the following to configure the size of the queue that has events that weren't processed:
[en] In your $HOME/.bashrc
export EVENT_QUEUE_SIZE=50
[en] or on the command line
java -Devent.queue.size=50 -jar githubhook.jar
[en] or in the user configuration file
{:event-queue-size 50}
[en] You can dump the computed configuration with the --dump-config
command-line option. This includes the remote configuration. Not all configuration settings support all sources. The settings that are maps and vectors in particular only work in the configuration files.
[en] You can generate a sample configuration by running Acrolinx for GitHub with the --sample-config
command-line switch. The sample configuration includes a list of all supported configuration settings that you can use as the user-specific configuration file. These are already in the EDN format.
[en] Topic |
[en] Property |
[en] Default |
[en] Supports |
[en] Description |
---|---|---|---|---|
[en] Remote Configuration |
[en] |
[en] |
[en] As described above, you can set almost all configuration values in a remote configuration file. The [en] Note that it's not exactly the HTTPS URL you see in your browser, but rather the content URL as seen in the GitHub API. If your organization is called "org" and your repository "my-repo," and if you keep your configuration in a subdirectory "conf" in that repository, the URL would look like this: [en] [en] Keep the strange-looking [en] Note, that remote configuration settings are added to the local settings. That means you can't remove a configuration from the remote configuration file to "unset" it. To achieve that, you'll need to set it to |
|
[en] Logging to StatsD |
[en] [en] |
[en]
|
[en] Enable sending metrics to a StatsD service. See Logging and Monitoring. |
|
[en] Acrolinx for Azure DevOps Talking to GitHub (for the remote global configuration file) |
[en] [en] |
[en] |
[en] ENV and system properties for exactly one token. Vector format only in the configuration file. |
[en] The GitHub User - Anonymous access to GitHub's APIs is limited. That's why you configure a token that the program uses to authenticate all calls to the GitHub API. The setting [en] The default makes Acrolinx for GitHub an unregistered user at GitHub. That won't work. |
[en] |
[en] |
[en] ENV and system property for single value |
[en] Securing Requests - GitHub can sign the payload of requests with a shared secret. If you don't define secrets, nothing will be validated. An attacker could make you call their service and present your OAuth token (gh-token) to them! You can define one shared secret as a string or many as a vector. One of the many must validate. Fingerprinting is expensive at runtime as it must hash the complete body. The secret may also have umlauts like ä, ö, or other non-ascii characters. Make sure to save your EDN or JSON file in UTF-8 without byte-order-mark for that to work. |
|
[en] |
[en] |
[en] ENV and system property |
[en] Automatically Register Repositories - If a |
|
[en] |
[en] |
[en] ENV and system property |
[en] Waiting for GitHub to Settle - Sometimes GitHub doesn't have our files ready for download even though we've received the webhook. According to their support, this is just how things are and we should wait a little. You can configure how long to delay each item. The delay takes the time already waited in the queue into account. |
|
[en] Provide the Service |
[en] |
|
[en] ENV and system property |
[en] HTTP - Acrolinx for GitHub opens an HTTP port which GitHub connects to. |
[en] |
[en] undefined |
[en] ENV and system property |
[en] User Database - To authenticate users in the built-in dashboard, the configuration needs to have a user-database file. See Logging and Monitoring. [en] The default is undefined, in which case this program tries to load the following files:
[en] If no files are found, the dashboard isn't available. |
|
[en] |
|
[en] ENV and system property |
[en] Buffer Events - Acrolinx for GitHub allows event buffering from GitHub before it passes the documents to Acrolinx to check. It uses an in-memory queue for this. The queue schedules the requests of different GitHub users fairly. The GitHub event is received immediately and put on a channel. The items stored in the queue are just the incoming events in JSON form. They don't consume much memory. So, it's safe to make this queue quite large, for example 1000. Larger values usually hint that the Acrolinx Platform can't handle the load. If the queue is full, Acrolinx for GitHub drops new incoming events. |
|
[en] |
[en] (15 min) |
[en] ENV and system property |
[en] Limit Processing Time - When you submit a pull request, some files might bring unexpected complexity and take a long time for Acrolinx to process. Network connections can also be slow, and foreign APIs can show problems that consume too much time. To work around all of this and maintain service, you can configure a maximum processing time. You'll need to set this locally. [en] You can also use this setting to stop processing pull request events that have reached the allowed time limit. |
|
[en] Connect to Acrolinx |
[en] |
[en] |
[en] ENV and system property |
[en] Acrolinx URL - The host and port of the Acrolinx Platform. Required. See Connect to Acrolinx. |
[en] |
[en] |
[en] ENV and system property |
[en] Authenticating with a Token - Since Acrolinx Platform 5.2, the preferred authentication mechanism for embedded integrations is the API token. You can create one on the Acrolinx Dashboard in your user settings. Copy that string and paste it into the configuration in this key. |
|
[en] [en] |
[en] |
[en] ENV and system property |
[en] Authentication with Username and Password - For backwards compatibility, Acrolinx for GitHub also supports authentication against Acrolinx via username and password. This will be removed in the future as it can compromise your user credentials and doesn't support Acrolinx setups with SSO or federated authentication. |
|
[en] |
|
[en] ENV and system property |
[en] Faster Results with Parallel Checking - On systems with high load, you can configure Acrolinx for GitHub to submit several checks to Acrolinx in parallel. If the environment allows it, events with more relevant files than this threshold will split their workload on multiple threads. Larger numbers lead to more serial checking, smaller numbers to more parallel checking. Uses Java's ForkJoin framework under the hood. |
|
[en] |
|
[en] ENV and system property |
[en] Limit Parallel Requests - Acrolinx for GitHub lets you limit the number of parallel requests to the Acrolinx Platform. When you do this, the maximum number of parallel requests made to the Acrolinx Platform is based on the smallest of the following values: |
|
[en] |
[en] |
[en] Configure your Guidance Profile - You configure the Guidance Profile that you want to check with. You can configure all check settings in the Acrolinx Platform in the Checking Profile settings. You can find the UUID of the Guidance Profile in the Acrolinx Dashboard. See also Connect to Acrolinx. |
||
[en] |
[en] ENV and system property |
[en] Map Metadata Names to Document Custom Field Names (currently a private beta) - Acrolinx for Git Hosting lets you use metadata values from the YAML front matter of a Markdown file to populate the corresponding document custom fields with that information. When you do this, you can use Target Batch Mapping in Markdown files. This is available at all configuration levels of the Git Hosting integration. [en] The configuration option takes an EDN map for configuring EDN files and a JSON object for configuring JSON files. [en] If a metadata point named “foo” corresponds to a document custom field named “bar,” the [en] EDN configuration files {:metadata {"foo" "bar"}} [en] JSON configuration files {":metadata": {"foo": "bar"}} Hinweis[en] If you want to enable Target Batch Mapping for Markdown files, you'll need to specify this configuration option. |
||
[en] |
[en] |
[en] ENV and system property |
[en] Limit file size - Limit the size of the files that get processed for pull requests and baseline checks. This helps prevent out of memory issues. [en] You'll want to set this in cases where a repository has files that are more than 1 MB. Specify this as Wichtig[en] This configuration option isn't available for push events. |
|
[en] |
[en] Map a particular file format to the file extensions pertaining to that file format - This semantic grouping of file extensions instructs the Git Hosting integration to process files that match the file extensions specified in the :filetypes configuration option. It is important to note that “processing” on the integration’s end means sending a file to the Acrolinx Platform for it to be checked. Specifying this configuration option has no impact on how the content will be processed by the platform or if it will be checked at all. |
|||
[en] |
||||
[en] |
[en] (5 min) |
[en] ENV and system property |
[en] Set a Maximum Wait Time for a Check - For each check, you can configure a limit. Set a maximum wait time, and define useful polling intervals. [en] This is set to 300 seconds (5 minutes) by default. |
|
[en] Filter Checks |
[en] Currently, Acrolinx for GitHub supports pull request events and push events. You can further filter what Acrolinx for GitHub checks with the options described in [en] Define What Acrolinx for Git Hosting Checks. |
|||
[en] Check Results |
[en] [en] |
[en] |
[en] ENV, system properties, global remote configuration, and repository-specific configuration |
[en] Acrolinx for GitHub can create comments on GitHub and set the status of a commit. Acrolinx for GitHub creates comments on GitHub to show the results of an Acrolinx check. [en] With statuses, you can use Acrolinx for GitHub as a quality Gateway. For this, you use the setting [en] For detailed information, see Check Results. |
[en] |
[en] You can set every configuration once for your installation of this program. Do this in either the local file or in the remote configuration. But sometimes you may want to overwrite settings in the GitHub repositories on a per-repository basis. You can set the following configuration keys in the GitHub repository that sent the GitHub event:
-
[en]
:template-header
-
[en]
:template-change
-
[en]
:template-footer
-
[en]
:allowed-event-types
-
[en]
:ignored-senders
-
[en]
:allowed-filename-matches
-
[en]
:allowed-branchname-matches
-
[en]
:allow-merges-from-default
-
[en]
:use-skip-label
-
[en]
:use-gh-statuses
-
[en]
:use-gh-comments
-
[en]
:gh-status-skip-errors
-
[en]
:gh-status-when-no-check
-
[en]
:guidance-profile
-
[en]
:acrolinx-client-locale
-
[en]
:acrolinx-author-field
-
[en]
:targets
-
[en]
:changed-files-limit
-
[en]
:file-size-limit
[en] To configure these values in a repository, create a file called .acrolinx-config.edn
in the root of your repository. This file needs a valid EDN hash map with only the keys listed above. If this file has any errors, Acrolinx ignores the settings. If you need to validate your changes to configuration files, you can do this with JSON and the Web IDE of the Git Hosting platform. Read more in [en] Format Migration for Configuration Files and Repository Registry.
[en] Errors are written to the log file. To avoid extra calls that count against the GitHub rate limit, files are cached in the program. Files are checked for changes for every GitHub event that's being processed.
[en] As a rule, the settings in the repo configuration override the global settings on the server side. That's why the repo settings are limited to a fixed set of supported keys. An exception to the rule is the value of :acrolinx-check-settings
, which gets merged. This is only relevant for the legacy Acrolinx API.
[en] Note, that repo configuration settings are added to all other settings. That means you can't remove a configuration from the specific configuration file to "unset" it. To achieve that, you'll need to set it to nil
.