> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# empear/codescene-ci-cd

Run CodeScene Delta Analysis on commits and pull requests. See this orb's source: https://github.com/empear-analytics/codescene-ci-cd-orb


## Jobs

### run-delta-analysis

Run CodeScene Delta Analysis. Requires setting the codescene-delta-analysis-url, codescene-user, codescene-password and github-api-token parameters, either explicitly or by setting the corresponding environment variables using the CircleCI UI


| Parameter | Type | Default | Description |
|---|---|---|---|
| `codescene-delta-analysis-url` | string | ${CODESCENE_DELTA_ANALYSIS_URL} | The CodeScene delta analysis API URL.  Set the parameter or use the CircleCI UI to add the value to the 'CODESCENE_DELTA_ANALYSIS_URL' env variable.
 |
| `codescene-user` | string | ${CODESCENE_USER} | The name of a CodeScene user. Set the parameter or use the CircleCI UI to add the value to the 'CODESCENE_USER' env variable.
 |
| `codescene-password-key` | env_var_name | CODESCENE_PASSWORD | The name of an env variable containing the codescene password.  Use the CircleCI UI to add a value to the env variable.
 |
| `coupling-threshold-percent` | integer | 80 | The coupling threshold (percent) used for analysis.
 |
| `risk-threshold` | integer | 7 | The risk threshold (1-10) used for the high risk gate.
 |
| `http-timeout` | integer | 30000 | The timeout in ms for http calls.
 |
| `github-api-url` | string | https://api.github.com | The GitHub API URL
 |
| `github-api-token-key` | env_var_name | GITHUB_API_TOKEN | The name of an env variable containing a GitHub API token with permissions  to add comments to merge requests.  Use the CircleCI UI to add a value to the env variable.
 |

## Executors

### codescene-ci-cd-executor

| Parameter | Type | Default | Description |
|---|---|---|---|
| `version` | string | 1.1.1 |  |

## Examples

### delta_analysis

Run CodeScene Delta Analysis. A context is used for specifying values for codescene-user, codescene-password and  github-api-token by setting their default environment variables. The value for codescene-delta-analysis-url is project specific and is specified by  setting the default environment variable in the project settings.  The value it should be set to is available in the CodeScene project settings.


```yaml
version: 2.1
orbs:
  codescene-ci-cd: empear/codescene-ci-cd@x.y.z
workflows:
  version: 2
  my-workflow:
    jobs:
      - codescene-ci-cd/run-delta-analysis:
          context: codescene-ci-cd
```

### delta_analysis_with_custom_values

Run CodeScene Delta Analysis. Custom values for parameters are specified directly on the job.


```yaml
version: 2.1
orbs:
  codescene-ci-cd: empear/codescene-ci-cd@x.y.z
workflows:
  version: 2
  my-workflow:
    jobs:
      - codescene-ci-cd/run-delta-analysis:
          codescene-delta-analysis-url: ${MY_DELTA_ANALYSIS_URL_ENV_VAR}
          codescene-user: ${MY_CODESCENE_USER_ENV_VAR}
          codescene-password: ${MY_CODESCENE_PASSWORD_ENV_VAR}
          github-api-token: ${MY_GITHUB_API_TOKEN_ENV_VAR}
```