jenkinsci / jenkinsci/gitlab-plugin

Default to env.STAGE_NAME for gitlabCommitStatus

Open
#872 1 comment 3 reactions 0 assignees View on GitHub
feature request
Dominant language
Java
Stars
1.4k
Forks
615
Avg merge
4h 32m
Merged PRs (30d)
10

Description

## Issue

### Context
- **Gitlab plugin version**: 1.5.11
- **Gitlab version**: GitLab Community Edition 10.5.4 8d768f9
- **Jenkins version**: Jenkins 2.150.1
- **Job type**: Pipeline

### Problem description

Since `pipeline-stage-step-plugin` 2.3 was released we can get the current stage name with `env.STAGE_NAME`. See [JENKINS-44456](https://issues.jenkins-ci.org/browse/JENKINS-44456) for a description of the feature. I use this feature like this:

```groovy
pipeline {
stages {
stage('Lint') {
steps {
gitlabCommitStatus(name: env.STAGE_NAME) {
sh 'lint.sh'
}
}
}
}
}
```

I propose we let the `name` parameter to `gitlabCommitStatus` default to `env.STAGE_NAME` so that this pattern gets used by default. The reason is that this makes it easier to keep GitLab steps and Jenkins steps in sync.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.