package crs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Std.ConfigSource

A type to hold declarative values to configure crs commands for a given repository.

The expectations is that certain commands allow for a file to be given as argument to a --config FILE flag, which must contain a serialization of a value of type t.

This particular config is expected to contain repository specific configuration.

We are using JSON5 as serialization format.

Sourcemodule Annotation_severity : sig ... end
Sourcetype t
Sourceval to_json : t -> Crs_stdlib.Json.t

Getters

Sourceval default_repo_owner : t -> Cr_comment.Std.User_handle.t option

default_repo_owner When not in a PR, the default_repo_owner may be used to assign certain kinds of CRs that are otherwise not easy to assign to a particular user. For example, invalid CRs when creating CR annotations for a particular commit outside of a pull request.

If the repository is owned by an individual, this would typically be that user. If the repository is owned by an organization, this may be set to a user in particular who would be assigned otherwise unassignable CRs. If it isn't set, such CRs will simply not be assigned to any one in particular.

Sourceval user_mentions_allowlist : t -> Cr_comment.Std.User_handle.t list option

user_mentions_allowlist is the list of users who can be mentioned in annotation comments using "@" ^ user_name mentions. Only users in this list can be notified. If not provided, defaults to an empty list (no mentions allowed). This is a protection measure to avoid spamming users that do not have ties to a repo in particular, or simply do not wish to be notified via CRs.

Sourceval invalid_crs_annotation_severity : t -> Annotation_severity.t option

invalid_crs_annotation_severity controls the GitHub annotation severity level for invalid CR syntax. This determines how prominently invalid CRs are displayed in GitHub's UI. Defaults to Warning if not provided.

Sourceval crs_due_now_annotation_severity : t -> Annotation_severity.t option

crs_due_now_annotation_severity controls the GitHub annotation severity level for CRs that are due now (such as in the PR where they were found). Defaults to Info if not provided.

Create configs

Sourceval create : ?default_repo_owner:Cr_comment.Std.User_handle.t -> ?user_mentions_allowlist:Cr_comment.Std.User_handle.t list -> ?invalid_crs_annotation_severity:Annotation_severity.t -> ?crs_due_now_annotation_severity:Annotation_severity.t -> unit -> t
Sourceval empty : t
Sourceval load_exn : path:Fpath_sexp0.Fpath.t -> emit_github_annotations:bool -> t

The loading of the config allows for some compatibility transitions during which deprecated names and or constructs are allowed. However, when they are detected, warnings are emitted. For convenience and help users discover warnings during CI runs, the loading can optionally include CI warnings on stderr for GitHub, using workflow annotations. To activate, supply emit_github_annotations:true.