Commit Graph

775 Commits

Author SHA1 Message Date
Fabio Pitino c75b8ad4da Remove workaround by upgrading Fugit gem
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/58241
* Upgrade Fugit gem to 1.2.1 which recognizes cron expressions
for invalid days
* Reverted previously implemented workaround
* Leave test case which previously exposed the bug
2019-05-07 08:07:16 +01:00
Fabio Pitino 673ea5d2ac Rescue RuntimeError when "too many loops" occur
With this workaround we temporarily prevent an
exception from Fugit gem to be raised in
Gitlab::Ci::CronParser
2019-05-07 08:06:49 +01:00
Fabio Pitino 0edd1e6714 Write test that exposes bug with Fugit gem 2019-05-07 07:46:07 +01:00
Mayra Cabrera 89132bbdd6 Add gitlab-managed option to clusters form
When this option is enabled, GitLab will create namespaces and service
accounts as usual. When disabled, GitLab wont create any project
specific kubernetes resources

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56557
2019-05-03 01:05:53 +00:00
Mayra Cabrera 5432f5480f Adds a way to start multiple manual jobs in stage
- Adds an endpoint on PipelinesController
- Adds a service that iterates over every build in a stage and
plays it.
- Includes 'play_manual' details on EntitySerializer
- Builds a new Stage state: PlayManual. An stage can take this status if
it has manual builds or an skipped, scheduled or manual status
- Includes FE modifications and specs
2019-05-02 18:27:35 +00:00
Douwe Maan 86900f0000 Merge branch '53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs' into 'master'
Disable retrying cancelled jobs

Closes #53064

See merge request gitlab-org/gitlab-ce!27503
2019-05-02 10:28:39 +00:00
Matija Čupić 07b5c50381
Remove variable masking feature flag 2019-04-26 15:20:47 -04:00
Kamil Trzciński 8fa1ab4c33 Support negative matches
This adds support for != and !~ operators
giving more flexibility in comparing values
2019-04-23 14:19:06 +02:00
mfluharty 6b7b07b7ec
Update specs that use retryable canceled jobs
Specs that test canceled jobs now
- expect them not to be retryable or playable
- expect them not to show retry buttons

Specs that test retryability now
- use failed status instead of canceled status
2019-04-19 14:03:53 -06:00
Kamil Trzciński a6a1afe070 Merge branch '60500-disable-jit-kubernetes-resource-creation-for-project-level-clusters' into 'master'
Disable JIT Kubernetes resource creation for project level clusters

Closes #60500

See merge request gitlab-org/gitlab-ce!27352
2019-04-17 18:41:15 +00:00
George Tsiolis 579fa8b8ec Rename CI related selectors 2019-04-16 12:57:07 +03:00
Tiger e33ecfdec3 Disable JIT resource creation for project clusters
JIT resource creation blocks deployments if a user is
self-managing their cluster, as it will fail the build
if unable to create a namespace and service account.

Using a custom namespace and service account was previously
supported for project level clusters, so we should preserve
this functionality.

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27352
2019-04-16 13:59:37 +10:00
drew cimino b26fd49eb7 catching and cleanly reporting SSL errors in Ci::Config::External::Processor 2019-04-15 17:58:17 +01:00
Kamil Trzciński ef84f7bbe2 Un-quarantine spec 2019-04-15 12:50:47 +02:00
Sean McGivern 026896cca2 Merge branch 'require-all-templates-to-include-default-stages' into 'master'
Require all templates to use default stages

Closes #59992

See merge request gitlab-org/gitlab-ce!26954

(cherry picked from commit 39eb16aab2)

e0df05cf Require all templates to use default stages
2019-04-15 12:47:35 +02:00
Sanad Liaquat 0991dc8c82 Reduce number of rspec retries
In both e2e QA tests and unit tests, reduce the number of retires
to 2 (i.e., 1 initial and one retry)
2019-04-09 10:04:03 +00:00
Wolphin 0a4f44de83 Add environment url validation 2019-04-09 09:28:55 +00:00
Sean McGivern e32c82ed1e Revert "Merge branch 'require-all-templates-to-include-default-stages' into 'master'"
This reverts merge request !26954
2019-04-05 13:18:35 +00:00
Sean McGivern 39eb16aab2 Merge branch 'require-all-templates-to-include-default-stages' into 'master'
Require all templates to use default stages

Closes #59992

See merge request gitlab-org/gitlab-ce!26954
2019-04-05 10:18:10 +00:00
Thong Kuah 4ec16912b8 Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'

Note: I had to manually fixup "onlies" to "only"
2019-04-05 08:43:27 +00:00
Kamil Trzciński e0df05cfbc Require all templates to use default stages
Our templates are free to override the 'stages:'.
However, they should follow the convention to always include
'build', 'test', 'deploy' which are defaults when not defined.
2019-04-05 10:13:49 +02:00
Grzegorz Bizon ff64887964 Merge branch '54506-show-error-when-namespace-svc-missing' into 'master'
Show error when namespace/svc account missing

Closes #54506

See merge request gitlab-org/gitlab-ce!26362
2019-04-05 07:05:32 +00:00
Paul 🐻 9f36097db2 fix(gitlab-ci-config): allow strings in the 'include' keyword
This fix is a followup to !24098 which introduced a validation of the
`include:` keyword of a gitlab-ci configuration file when triggered
from /ci/lint API calls.

However, there was a test case missing: the case of a single string as
value. I have added a test case for that which shows that the code was
not validating it correctly.

This commit fixes that to allow all `include:` valid inputs.
2019-04-05 06:44:33 +00:00
Kamil Trzciński 8a833c720e Allow to use untrusted Regexp via feature flag
This brings support for untrusted regexp for 'only:refs:' when
enabled via feature flag: alllow_unsafe_ruby_regexp.

This is by default disabled, and should not be used in production
2019-04-04 15:00:56 +00:00
Lucas Charles 1d88fa9c82 Include DAST as dependent CI template 2019-04-04 00:21:44 +00:00
Francisco Javier López 6ee1d8cf77 Add port section to CI Image object
In order to implement https://gitlab.com/gitlab-org/gitlab-ee/issues/10179
we need several modifications on the CI config file. We are
adding a new ports section in the default Image object.

Each of these ports will accept: number, protocol and name.

By default this new configuration will be only enabled in
the Web IDE config file.
2019-04-03 09:50:54 +00:00
Dmitriy Zaporozhets 478077747d Merge branch '47234-composable-auto-devops' into 'master'
Resolve "Composable Auto DevOps"

Closes #47234

See merge request gitlab-org/gitlab-ce!26520
2019-04-03 09:05:28 +00:00
John Jarvis 69b65a6b74 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02 2019-04-02 10:12:32 +02:00
GitLab Release Tools Bot 3098259e90 Merge branch 'security-use-untrusted-regexp' into 'master'
Use UntrustedRegexp for CI refs matching

See merge request gitlab/gitlabhq!3005
2019-04-02 07:48:24 +00:00
Tiger 3be46bdf08 Split Security Auto DevOps jobs into templates
Container Scanning, Dependency Scanning, License Management
and SAST parts of Auto DevOps now use the preexisting templates.

Auto DevOps and the DAST job template will now use a
shared job template instead of maintaining two copies
of the job. This also allows Auto DevOps to use custom
authentication with DAST.
2019-04-02 13:31:26 +11:00
Tiger de03a8bcb4 Detailed status for builds that fail prerequisites
Create FailedUnmetPrerequisites status to allow custom
messaging for builds that were unable to be queued due
to failing to meet prerequisites (eg. failing to create
Kubernetes namespace for deployment).
2019-04-02 11:04:41 +11:00
Shinya Maeda bf639fd504 Create detached merge request pipelines
By using `refs/merge-requests/:iid/head`

ok

ok

Improve naming nicely

Add nice tests

add nice tests

fix some more

revert
2019-03-29 13:58:45 +07:00
Tiger 325d504c3c Don't recreate Kubernetes namespaces if they exist
Instead of attempting to create or update a Kubernetes
namespace on every deploy, only do so when we know it
doesn't exist yet.
2019-03-20 12:04:46 +11:00
Tiger 89b0bc04b9 Create one Kubernetes namespace for a deployment
Instead of creating a Kubernetes namespace on every
cluster related to a project, only create one on the
cluster the project is about to be deployed to.
2019-03-20 12:04:46 +11:00
Tiger 98a14a498d Add build prerequisite for Kubernetes namespaces
Builds that have deployments require Kubernetes resources
to be created before the build can be deployed. These
resources are no longer created when the cluster is
created, which allows us to only create the resources
required by each specific build.
2019-03-20 12:04:46 +11:00
Tiger 00f0d356b7 Create framework for build prerequisites
Introduces the concept of Prerequisites for a CI build.
If a build has unmet prerequisites it will go through the
:preparing state before being made available to a runner.

There are no actual prerequisites yet, so current
behaviour is unchanged.
2019-03-20 12:04:40 +11:00
Tiger 42ca9c6f0d Add :preparing status to HasStatus
Introduces a new status for builds between :created and :pending
that will be used when builds require one or more prerequisite
actions to be completed before being picked up by a runner
(such as creating Kubernetes resources before deploying).

The existing :created > :pending transition is unchanged, so
only builds that require preparation will use the :preparing
status.
2019-03-20 11:48:31 +11:00
Kamil Trzciński b22287f00f Make CI refs matching to to use UntrustedRegexp
This makes ref validation to use always `UntrustedRegexp`.
This also splits the existing RubySyntax into separate
class.
2019-03-15 14:38:28 +01:00
Stan Hu d11b112664 Merge branch 'fix/gb/fix-bridge-jobs-variables-policy' into 'master'
Fix bridge jobs only/except variables policy

Closes #58199

See merge request gitlab-org/gitlab-ce!25710
2019-03-05 22:27:22 +00:00
Grzegorz Bizon b491e3f91b Freeze abstract templates constant in specs 2019-03-04 21:09:39 +08:00
Grzegorz Bizon d9fb27f42a Make serverless template a valid abstract template 2019-03-04 21:09:38 +08:00
Grzegorz Bizon 4b0036b87e Merge branch 'allow-to-recursively-include' into 'master'
Allow to recursively expand includes

Closes #55937 and #56836

See merge request gitlab-org/gitlab-ce!24356
2019-03-04 09:06:42 +00:00
Grzegorz Bizon 9e12baea1a Add test for evaluating bridge variables policy 2019-03-02 21:04:59 +01:00
Grzegorz Bizon 981c248863 Do not raise when adding undefined variables resource 2019-03-02 15:18:14 +01:00
Kamil Trzciński c78861bc42 Allow to recursively expand includes
This change introduces a support for nesting the includes,
allowing to evaluate them in context of the target,
by properly respecting the relative inclusions and user permissions
of another projects, or templates.
2019-03-01 15:55:53 +01:00
Shinya Maeda f62dc67d26 Add suffix for merge request event
Fix

ok

Add spec

Fix

ok

Fix

Add changelog

Fix

Add memoization

a

fix
2019-03-01 22:52:38 +09:00
Matija Čupić 316889cb47
Revert "Merge branch 'revert-8baf9e5f' into 'master'"
This reverts commit f5201a816f, reversing
changes made to 48e6db0dad.
2019-02-27 12:52:53 +01:00
Grzegorz Bizon 1b10b77bab Merge branch 'include-ci-yaml' into 'master'
fix: validate 'include' keywords in gitlab-ci.yml configuration files

Closes #55863

See merge request gitlab-org/gitlab-ce!24098
2019-02-27 10:29:08 +00:00
Shinya Maeda 314062fec5 Persist source sha and target sha for merge pipelines
source_sha and target_sha are used for merge request pipelines
2019-02-27 17:12:04 +09:00
Kamil Trzciński 7b445f9b15 Revert "Merge branch '13784-simple-masking-of-protected-variables-in-logs' into 'master'"
This reverts merge request !25293
2019-02-26 17:32:23 +00:00