Configuration Presets
=====================

In CodeScene, you can use define some configuration at server level and it can be then used
by a different user (e.g. typically one with less access permissions).

Preset Management Page
----------------------

You must be an admin user. Navigate to Configuation, click Code quality profiles. You can see your
presets, activate/deactivate them, and create new ones.

If a preset is deactivated it won't be selectable when configuring projects (but it will still
be used by all projects that are using it already.)

When editing a preset you can also choose to delete it, but the option is only enabled when
preset is not used by any project. To see the list of projects blocking the delete you can
hover the delete button.

Project Group Presets
---------------------

In addition to global presets, you can define presets on a project group from its Settings Presets
tab. Group-scoped presets are available to projects in that group and its subgroups.

Using presets
-------------

Navigate to a project configuration page corresponding to the preset type and you will see
a dropdown with the available entries.

PR Quality Gates and Coverage Quality Gates are singleton presets, one per scope. When a project
uses the global setting, CodeScene applies the most specific preset available from the project's
group hierarchy, falling back to the global preset.

PR provider presets are multi-instance. Project configuration lists active presets from the global
scope and the project's group hierarchy.

Some preset types and their locations:

- GitHub App stores GitHub App credentials without a webhook configuration. Its Host identifies
  which credential-free HTTPS repository URLs can use the app during cloning and analysis. See
  :doc:`/getting-started/github-app-repository-access` for setup instructions.
- PR Quality Gates and PR Code Coverage Gates can be configured globally and per project group.
- PR Check GitHub App can be used in PR Integration Configuration if you've selected Github App integration type.
- PR Check GitLab, Azure DevOps, Bitbucket, Bitbucket Server, and Gerrit presets work the same way
  for their respective integration types.
