FAQ | This is a LIVE service | Changelog

Skip to content
Commits on Source (4)
......@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.0.0] - 2023-08-09
### Changed
- Jobs using the "push and merge request" job-rules templates now will no-longer
disable themselves on push pipelines if a merge request is open. Users of the
templates should use workflow rules to disable push pipelines on MRs if that
is required. (Otherwise, duplicate jobs are created.)
- The common pipeline now configures a reasonable default workflow rule to run
only on branch pipelines.
## [2.7.0] - 2023-07-31
### Added
......
......@@ -3,6 +3,8 @@
# there are files present in the repo which indicate that the job is appropriate to run).
#
# All jobs automatically added by "safe" templates should allow for disabling via a `..._DISABLED` variable.
#
# We add a "default" workflow rule but downstream users of this template can easily override these with their own.
include:
# Bring in the AutoDevOps template from GitLab. It can be viewed at:
......@@ -18,6 +20,9 @@ include:
- local: "/auto-devops/python-publish.yml"
- local: "/auto-devops/python-check-tags-match-version.yml"
# Fail-safe workflow rules. These can be overridden by CI configuration which includes us.
- template: Workflows/Branch-Pipelines.gitlab-ci.yml
variables:
# Auto Test from Auto DevOps is deprecated and will be removed in GitLab 17.0. Get ahead of the curve by never
# enabling it for pipelines using this template.
......
......@@ -34,6 +34,17 @@ successful publication to the test one.
Any of the automatically created jobs above may be disabled by setting a
corresponding `..._DISABLED` variable.
## Duplicate pipelines
The Python jobs will run on both merge request and push pipelines. You should
use workflow rules to select an appropriate strategy in your CI configuration to
avoid duplicate jobs. For example:
```yaml
include:
- template: Workflows/Branch-Pipelines.gitlab-ci.yml
```
## Running tests
The [tox test runner template](./python-tox.yml) will add a "python:tox" job to
......
......@@ -3,26 +3,21 @@
# These rules are useful if you can't immediately see what a long list of job rule conditions means. There is no
# requirement to use the rules in this file.
# Disable the job if the source was not a merge request or push event. If there are open merge requests, jobs are
# disabled on push events.
# Disable the job if the source was not a merge request or push event. If there are open merge requests, jobs will
# run on *both* push and merge request events. Workflow rules should be used to disable one pipeline.
#
# This rule only ever *disables* a job; additional rules to enable the job must appear *after* this one.
.rules:disable-except-for-pushes-and-merge-requests:
- if: '($CI_PIPELINE_SOURCE != "merge_request_event") && ($CI_PIPELINE_SOURCE != "push")'
when: never
# $CI_COMMIT_BRANCH is only set for pushes with an associated branch. $CI_COMMIT_TAG is only set for pushes to a
# tag. We want to disable jobs in those cases if there are open merge requests since the merge request pipeline
# should run those jobs.
- if: '($CI_COMMIT_BRANCH || $CI_COMMIT_TAG) && $CI_OPEN_MERGE_REQUESTS'
when: never
# Enable the job on merge requests or push events. If a merge request is open for the commit associated with the
# pipeline, the push event jobs will be disabled in favour of the merge requests.
# pipeline, jobs will run on *both* push and merge request pipelines. Workflow rules should be used to disable one
# pipeline.
#
# This rule only ever *enables* a job; if needed, additional rules to disable the job appear *before* this one.
.rules:enable-for-pushes-and-merge-requests:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '($CI_PIPELINE_SOURCE == "push") && ($CI_OPEN_MERGE_REQUESTS == "" || $CI_OPEN_MERGE_REQUESTS == null)'
- if: '($CI_PIPELINE_SOURCE == "merge_request_event") || ($CI_PIPELINE_SOURCE == "push")'
# Disable the job if the source was not a push event. This job will run only on push pipelines, never on merge request
# ones.
......