Commit Graph

1088 Commits

Author SHA1 Message Date
Nick Thomas d95889b8a4 Merge branch '43263-git-push-option-to-create-mr' into 'master'
Git push options to create a merge request, set target_branch and set merge when pipeline succeeds

Closes #53198 and #43263

See merge request gitlab-org/gitlab-ce!26752
2019-04-09 12:53:07 +00:00
Wolphin 0a4f44de83 Add environment url validation 2019-04-09 09:28:55 +00:00
Luke Duncalfe 1883e320ea Use Gitlab::PushOptions for `ci.skip` push option
Previously the raw push option Array was sent to Pipeline::Chain::Skip.

This commit updates this class (and the chain of classes that pass the
push option parameters from the API internal `post_receive` endpoint to
that class) to treat push options as a Hash of options parsed by
GitLab::PushOptions.

The GitLab::PushOptions class takes options like this:

    -o ci.skip -o merge_request.create -o merge_request.target=branch

and turns them into a Hash like this:

    {
      ci: {
        skip: true
      },
      merge_request: {
        create: true,
        target: 'branch'
      }
    }

This now how Pipeline::Chain::Skip is determining if the `ci.skip` push
option was used.
2019-04-09 10:03:26 +12:00
Tiger Watson f92438b878 Restore original Security/DAST.gitlab-ci.yml
Reverts https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26520
for Security/DAST.gitlab-ci.yml.
2019-04-06 16:02:04 +00:00
Kamil Trzciński 8cdda8f79a Merge branch 'feature/gb/serverless-switch-to-gitlabktl' into 'master'
Serverless backend now uses `gitlabktl` tool

Closes #56252 and #58058

See merge request gitlab-org/gitlab-ce!26926
2019-04-05 17:59:30 +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
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
Grzegorz Bizon e90c2adcf5 Build and deploy serverless functions with gitlabktl 2019-04-03 13:52:24 +02: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
Kamil Trzciński 1b6fe3ae22 Merge branch 'kube_helm_auto_devops_213' into 'master'
Bump Kubectl and Helm in Auto-DevOps.gitlab-ci.yml

See merge request gitlab-org/gitlab-ce!26534
2019-04-02 07:21:26 +00:00
Tiger 343e834330 Add required variables to Jobs/Build.gitlab-ci.yml 2019-04-02 13:32:00 +11: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 ec5e032a12 Split non-security Auto-DevOps jobs into templates
This allows these templates to be used outside of Auto DevOps,
or easily excluded from Auto DevOps.

The security jobs in Auto DevOps differ slightly from the ones
that are already available as templates, they will be moved
next.
2019-04-02 13:29:43 +11:00
jerasmus 11f2ddf021 Display error for unmet prerequisites
Added the ability to display an error for unmet prerequisites
2019-04-02 11:07:06 +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
Thong Kuah 3bc946ade3 Bump Kubectl and Helm in Auto-DevOps.gitlab-ci.yml 2019-04-01 23:38:40 +13:00
Philippe Lafoucrière 6a25f8bc79
Fix Container Scanning for Kubernetes Runners
closes https://gitlab.com/gitlab-org/gitlab-ee/issues/6636
closes https://gitlab.com/gitlab-org/gitlab-ee/issues/5763
2019-03-31 08:58:01 -04: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
Dylan Griffith 3c25ec8827 Fix Auto DevOps missing domain error handling
For some reason this value can be an empty string and we want to ensure
that we correctly fail the job before a deploy. This is particularly
problematic at the moment when coupled with
https://gitlab.com/gitlab-org/gitlab-ce/issues/54760 as the user has no
easy way to recover without destroying the cluster and starting over.
2019-03-28 14:00:38 +11:00
James Fargher 01aa1ef77b Update dashboards to additionally use new environment selector
Deploy boards now will check for app.gitlab.com/env and
app.gitlab.com/app
2019-03-21 08:06:47 +00:00
Clement Ho 6a0702fe93 Merge branch '57115-just-in-time-k8s-resource-creation' into 'master'
Create project-specific Kubernetes resources just-in-time

See merge request gitlab-org/gitlab-ce!25586
2019-03-20 22:25:23 +00:00
Grzegorz Bizon a99fcc0c29 Merge branch '57598-use-vendored-files-for-ci-config' into 'master'
Resolve "Use vendored files for CI config"

Closes #57598

See merge request gitlab-org/gitlab-ce!25871
2019-03-20 21:12:30 +00: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
Victor Zagorodny 53842505ca Remove before_script from DAST vendored template 2019-03-19 08:35:24 +00:00
Robert Speicher f012e93482 Merge branch 'resolve-lib-gitlab-differences' into 'master'
Move EE specific code out of lib/gitlab

See merge request gitlab-org/gitlab-ce!25741
2019-03-18 15:11:21 +00:00
Matija Čupić dfacd3a02d
Move gitlab-org specific config to .gitlab-ci.yml 2019-03-15 16:37:27 +01:00
Matija Čupić 3b3b160241
Hardcode CodeQuality version used 2019-03-15 16:37:26 +01:00
Matija Čupić f2eac81bc8
Add Code-Quality CI template 2019-03-15 16:37:26 +01:00
Matija Čupić 3527e3e43c
Tidy up CI templates
Tidies up CI templates to have better formatting.

* Removes redundant whitespace
* Removes redundant newlines
2019-03-15 16:37:21 +01: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
Grzegorz Bizon 51c1a49a66 Merge branch '58482-update-airminc/clair-local-scan-to-2.0.6' into 'master'
Update clair-local-scan to 2.0.6

Closes #58482

See merge request gitlab-org/gitlab-ce!25743
2019-03-15 13:25:41 +00:00
Stan Hu c048422fa2 Merge branch 'update-rubocop' into 'master'
Update rubocop target ruby version

See merge request gitlab-org/gitlab-ce!24804
2019-03-13 18:03:12 +00:00
Takuya Noguchi ba018b52bd Update clair-local-scan to 2.0.6 to support Ubuntu 18.04
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-03-14 00:21:19 +09:00
Nick Thomas 9f05e97aad
Run rubocop -a 2019-03-13 13:42:43 +00:00
walkafwalka 7f0f752aab Use project name and id in review app url instead of project path slug 2019-03-12 18:11:28 -07:00
Yorick Peterse 018fc6c696
Backport allow_mirror_update for Chain::Command
This backports the allow_mirror_update update field for Chain::Command
from EE to CE. There's no particular reason to keep this in EE. Doing so
would require refactoring of CE as there currently is no easy way to
inject new Struct members into the Chain::Command class.
2019-03-12 11:10:40 +01:00
Yorick Peterse 0cabb555f0
Backport Gitlab::Ci::Model from EE
This backports the EE changes to Gitlab::Ci::Model back into CE,
ensuring the code is the same for both versions.
2019-03-12 11:10:39 +01:00
Takuya Noguchi 37f9cf8a26 Use curl silent/show-error options on Auto DevOps
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-03-11 16:54:40 +09:00
Victor Zagorodny 2cb0e98401 Use vendored templates for Sec Products
Update Dependency Scanning and add other templates
2019-03-08 03:39:35 +00:00