JiraConnect: Send deployment information
What does this MR do?
Relates to: #27986 (closed)
This adds the deployment module to our JiraConnect integration, with support for sending updates relating to relevant deployment information to Jira.
This feature is guarded by a feature flag: :sync_jira_deployments
.
QA instructions
- Enable the
:sync_jira_deployments
feature flag in your rails console. - Install or update your JiraConnect installation (see https://gitlab.com/gitlab-org/gitlab/blob/master/doc/development/integrations/jira_connect.md)
- Ensure that you have a runner and working pipelines in your local development environment (https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/howto/runner.md)
- Set up a suitable pipeline with a deploy stage (eg. https://docs.gitlab.com/ee/ci/environments/#defining-environments). Note - your deployment must happen on merge request branches, so that we can associate it with Jira issue keys.
- Create one or more MR's with references (in branch names or MR title) to different Jira issues.
- Push a change that results in a pipeline and a successful deployment (see below for a suitable build script)
- Verify that the deployment was created (in
rails c
orgdk psql
) - Verify that the deployment appears in Jira (see screenshots)
Screenshots (strongly suggested)
Showing a deployment in the sidebar:
Showing the details of the deployment:
Build script
I use the following build script with a shell based runner:
before_script:
- echo "Before script section"
- echo "For example you might run an update here or install a build dependency"
- echo "Or perhaps you might print out some debugging details"
after_script:
- echo "After script section"
- echo "For example you might do some cleanup here"
build1:
stage: build
script:
- echo "Do your build here"
test1:
stage: test
script:
- echo "Do a test here"
- echo "For example run a test suite"
test2:
stage: test
script:
- echo "Do another parallel test here"
- echo "For example run a lint test"
deploy1:
stage: deploy
environment:
name: staging
script:
- echo "Do your deploy here"
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - since this is behind a feature flag, no changelog is needed. -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Alex Kalderimis