<commit_before>[[scm-catalog]]
==== SCM Catalog

Ontrack allows to collect information about all registered SCMs
and to correlate this information with the Ontrack <<model,projects>>.

[[scm-catalog-model]]
===== Model

A _SCM Catalog entry_ represents a physical SCM reposotory which
is accessible by Ontrack. An entry contains the following information:

* _SCM_ - type of SCM, like `github` or `bitbucket`.
* _Configuration_ - associated configuration in Ontrack to access
  this repository (URL, credentials, etc.).
* _Repository_ - identifier for this repository. It depends on the
  type of SCM. For example, for GitHub, it can be name of the repository,
  like `nemerosa/ontrack`.

A SCM catalog entry can be:

* _linked_ if an Ontrack project exists which is associated to this repository
* _unlinked_ otherwise

Some Ontrack projects are _orphan_ if they are not associated
with any repository accessible by Ontrack or if their associated
repository is not accessible.

[[scm-catalog-list]]
===== SCM Catalog list

To access the SCM catalog, you must be logged in. You must
select the _SCM Catalog_ item in your user menu.

The list looks like:

image::images/scm-catalog-list-entries.png[800,SCM Catalog]

The _Project_ column indicates if the entry is _linked_ or _unlinked_.
In case it is linked, a link to the Ontrack project page is available.

Filtering is possible using text boxes at the top. You can also
navigate back and forth in the list using the _Previous_ and
_Next_ buttons.

The main filter, labelled _Only SCM entries_, allows to select
the type of entry:

* _Only SCM entries_ - selected by default, shows all repositories
   accessible by Ontrack
* _All entries and orphan projects_ - additionally, shows the _orphan_ projects
* _Linked entries only_ - shows only the entries which are _linked_ to projects
* _Unlinked entries only_ - shows only the _unlinked_ entries
* _Orphan projects only_ - shows only the _orphan_ projects, as shown below:

image::images/scm-catalog-orphan.png[800,Orphan projects]

In this case, only the link to the project is available since
no repository information is accessible.

[[scm-catalog-orphan-decoration]]
===== Orphan project decoration

Since _orphan_ projects are an anomaly (because every Ontrack
project should be associated with some kind of SCM), they
get a special decoration, so that they can easily be identified
(and fixed):

image::images/scm-catalog-orphan-decoration.png[150,Orphan project decoration]

[[scm-catalog-labels]]
===== Project labels

If the <<projects-labels-auto,collection of project labels>>
is enabled, the following labels will be set for projects:

* `scm-catalog:entry` when the project is associated with a SCM Catalog entry
* `scm-catalog:no-entry` when the project is NOT associated with a SCM Catalog entry

Those labels can

[[scm-catalog-graphql]]
===== GraphQL schema

The SCM Catalog is accessible through the Ontrack GraphQL schema.
<commit_msg>#717 SCM Catalog labels<commit_after>[[scm-catalog]]
==== SCM Catalog

Ontrack allows to collect information about all registered SCMs
and to correlate this information with the Ontrack <<model,projects>>.

[[scm-catalog-model]]
===== Model

A _SCM Catalog entry_ represents a physical SCM reposotory which
is accessible by Ontrack. An entry contains the following information:

* _SCM_ - type of SCM, like `github` or `bitbucket`.
* _Configuration_ - associated configuration in Ontrack to access
  this repository (URL, credentials, etc.).
* _Repository_ - identifier for this repository. It depends on the
  type of SCM. For example, for GitHub, it can be name of the repository,
  like `nemerosa/ontrack`.

A SCM catalog entry can be:

* _linked_ if an Ontrack project exists which is associated to this repository
* _unlinked_ otherwise

Some Ontrack projects are _orphan_ if they are not associated
with any repository accessible by Ontrack or if their associated
repository is not accessible.

[[scm-catalog-list]]
===== SCM Catalog list

To access the SCM catalog, you must be logged in. You must
select the _SCM Catalog_ item in your user menu.

The list looks like:

image::images/scm-catalog-list-entries.png[800,SCM Catalog]

The _Project_ column indicates if the entry is _linked_ or _unlinked_.
In case it is linked, a link to the Ontrack project page is available.

Filtering is possible using text boxes at the top. You can also
navigate back and forth in the list using the _Previous_ and
_Next_ buttons.

The main filter, labelled _Only SCM entries_, allows to select
the type of entry:

* _Only SCM entries_ - selected by default, shows all repositories
   accessible by Ontrack
* _All entries and orphan projects_ - additionally, shows the _orphan_ projects
* _Linked entries only_ - shows only the entries which are _linked_ to projects
* _Unlinked entries only_ - shows only the _unlinked_ entries
* _Orphan projects only_ - shows only the _orphan_ projects, as shown below:

image::images/scm-catalog-orphan.png[800,Orphan projects]

In this case, only the link to the project is available since
no repository information is accessible.

[[scm-catalog-orphan-decoration]]
===== Orphan project decoration

Since _orphan_ projects are an anomaly (because every Ontrack
project should be associated with some kind of SCM), they
get a special decoration, so that they can easily be identified
(and fixed):

image::images/scm-catalog-orphan-decoration.png[150,Orphan project decoration]

[[scm-catalog-labels]]
===== Project labels

If the <<projects-labels-auto,collection of project labels>>
is enabled, the following labels will be set for projects:

* `scm-catalog:entry` when the project is associated with a SCM Catalog entry
* `scm-catalog:no-entry` when the project is NOT associated with a SCM Catalog entry

Those labels can be used to filter _orphan_ projects on the
home page for example, or in GraphQL queries.

[[scm-catalog-graphql]]
===== GraphQL schema

The SCM Catalog is accessible through the Ontrack GraphQL schema.

{'fraction_non_alphanumeric': 0.0643819663949426, 'fraction_numerical': 0.00349359507569456, 'mean_word_length': 4.73117254528122, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6431705', 'n_tokens_mistral': 1680, 'n_tokens_neox': 1612, 'n_words': 811}