setRepositoryMetricThreshold

Mutation:setRepositoryMetricThreshold Update the threshold for a metric in a repository.

Arguments

FieldTypeDescription
inputSetRepositoryMetricThresholdInput!Input for SetRepositoryMetricThreshold mutation.

Sample Request

mutation ($input: SetRepositoryMetricThresholdInput!) {
  setRepositoryMetricThreshold(input: $input) {
    ok
  }
}
variables = {
  "input": {
    "repositoryId": "VHJhbnNmb3JtZXI6bGp6a3d6",
    "metricShortcode": "LCV",
    "metricKey": "PYTHON",
    "thresholdValue": 90
  }
}

Sample Response

{
  "setRepositoryMetricThreshold": {
    "ok": true
  }
}

Objects

Metric

A metric tracked by an analyzer.

FieldTypeDescription
idID!The ID of the object.
nameString!The metric's name.
shortcodeMetricShortcode!The metric's unique identifier.
descriptionString!The metric's description in markdown format.
positiveDirectionDirection!Direction which can be considered positive for the metric.
unitStringUnit suffix to apply to the metric value.
minValueAllowedIntLower bound for the metric value.
maxValueAllowedIntUpper bound for the metric value.

RepositoryMetric

A Metric's manifestation specific to a repository.

FieldTypeDescription
nameString!The metric's name.
shortcodeMetricShortcode!The metric's unique identifier.
descriptionString!The metric's description in markdown format.
positiveDirectionDirection!Direction which can be considered positive for the metric.
unitStringUnit suffix to apply to the metric value.
minValueAllowedIntLower bound for the metric value.
maxValueAllowedIntUpper bound for the metric value.
isReportedBoolean!Whether this metric is enabled for reporting in the repository.
isThresholdEnforcedBoolean!Whether to fail checks when thresholds are not met for the metric in the repository.
items[RepositoryMetricItem!]Items in the repository metric.

RepositoryMetricItem

An item in the RepositoryMetric.

FieldTypeDescription
idID!The ID of the object.
keyMetricKey!Distinct key representing the metric in the repository.
thresholdIntThreshold value for the metric, customizable by the user. Null if no threshold is set.
latestValueFloatLatest value captured for this metric on the repository's default branch.
latestValueDisplayStringLatest value captured for this metric on the repository's default branch. Suffixed with the unit and returned as a human-readable string.
thresholdStatusMetricThresholdStatusThe status of the threshold condition for the latest metric value on the repository's default branch.
valuesMetricValueConnectionAll values captured for this metric in the repository or check.
commitOidIn[String]Commit OIDs to filter the metric values on. Applicable only for fetching metrics inside a repository but not check.
offsetInt
beforeString
afterString
firstInt
lastInt

MetricValue

An individual value captured for a RepositoryMetricItem.

FieldTypeDescription
idID!The ID of the object.
valueFloat!Metric value reported by the analyzer.
valueDisplayString!Value suffixed with the unit of the metric.
thresholdIntThreshold value for the metric when this value was reported. Null if no threshold was set.
thresholdStatusMetricThresholdStatusThe status of the threshold condition for the metric value.
commitOidStringCommit SHA for which this value was recorded on the repository.
createdAtDateTime!The time at which the value was captured.

MetricValueConnection

FieldTypeDescription
pageInfoPageInfo!Pagination data for this connection.
edges[MetricValueEdge]!Contains the nodes in this connection.
totalCountInt

MetricValueEdge

A Relay edge containing a MetricValue and its cursor.

FieldTypeDescription
nodeMetricValueThe item at the end of the edge.
cursorString!A cursor for use in pagination.

SetRepositoryMetricThresholdInput

Input for the setRepositoryMetricThreshold mutation.

FieldTypeDescription
repositoryIdID!GraphQL node ID of the repository.
metricShortcodeMetricShortcode!Metric shortcode to update the threshold for.
metricKeyMetricKey!The key of the metric you want to update the threshold for.
thresholdValueIntThreshold value to set. Setting to null removes the threshold.