Skip to main content

ScopeDoctorGroup

A "group" is a set of operations that should be preformed as part of solving a problem. For example, there may be a group to install and configure Node, or other language.

A Group is defined by one or more "actions". Taking a look at an example

apiVersion: scope.github.com/v1alpha
kind: ScopeDoctorGroup
metadata:
name: node
spec:
include: by-default
description: Check node is ready.
needs:
- python
- brew
actions:
- description: Node Version
name: node-version
check:
paths:
- '.npmrc'
commands:
- ./scripts/check-node-version.sh
fix:
commands:
- ./scripts/fix-node-version.sh
helpText: Running into errors reach out in #foo-help
helpUrl: https://go.example.com/get-help
required: false
- description: Install packages
name: yarn
check:
paths:
- 'package.json'
- '**/package.json'
- yarn.lock
- '**/yarn.lock'
fix:
commands:
- yarn install

In the example above, there are two actions, the first ensures that node is operational.

Actions

An action is a discrete step, they run in order defined. The action should be atomic, and target a single resolution.

Notice an action can provide both paths and commands, if either of them indicate that the fix should run, it will run. In the event there are no defined check, the fix will always run.

paths indicate a fix should run when:

  1. No files match any of the path globs, or
  2. Any of the matching files contents have changed

Fix

When the checks determine that something isn't correct, a fix is the way to automate the resolution. When provided, scope will run them in order.

Commands

A command can either be relative, or use the PATH. To target a script relative to the group it must start with ., and giving a relative path to the group file.

Schema

Loading ....