Commit Graph

200 Commits

Author SHA1 Message Date
GitLab Bot 5064bf8c56 Add latest changes from gitlab-org/gitlab@master 2020-03-25 09:08:11 +00:00
GitLab Bot 5366964a10 Add latest changes from gitlab-org/gitlab@master 2020-02-14 12:09:03 +00:00
GitLab Bot 6b9d3a4e83 Add latest changes from gitlab-org/gitlab@master 2020-01-29 18:08:47 +00:00
GitLab Bot 37eff29d5c Add latest changes from gitlab-org/gitlab@master 2020-01-17 15:08:37 +00:00
GitLab Bot 6f0f893bd8 Add latest changes from gitlab-org/gitlab@master 2020-01-10 18:07:43 +00:00
GitLab Bot c6373a2cec Add latest changes from gitlab-org/gitlab@master 2019-12-24 12:08:01 +00:00
GitLab Bot 2a65a97e12 Add latest changes from gitlab-org/gitlab@master 2019-12-18 00:08:09 +00:00
GitLab Bot fdffdcf1ab Add latest changes from gitlab-org/gitlab@master 2019-11-20 18:06:04 +00:00
GitLab Bot 9e27f0d920 Add latest changes from gitlab-org/gitlab@master 2019-10-01 12:05:59 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Kamil Trzciński cee2f86d57 Optimise DAG processing 2019-08-14 11:34:44 +02:00
Sean McGivern d126df55fd Merge branch 'prefer-to-use-process-pipeline-worker' into 'master'
Extend PipelineProcessWorker to accept a list of builds

See merge request gitlab-org/gitlab-ce!31425
2019-08-05 09:29:45 +00:00
Kamil Trzciński 593490e5ac Extend PipelineProcessWorker to accept a list of builds
This changes used worker from `BuildProcessWorker`
to `PipelineProcessWorker` to make pipeline
processing much simpler. We process `pipeline_id`,
based on some triggers.
2019-08-02 20:31:17 +02:00
Kamil Trzciński a2bbf7b8c1 Properly process `needs:` with `when:`
Currently, some of the jobs with `needs:`
would be processed in stages, it means
that `when:` for such jobs would not be
respected.

This changes the behavior to have a separate
execution paths for jobs with `needs:`.
2019-08-02 19:14:59 +02:00
Kamil Trzciński e7ee84aad4 Add support for DAG
This implements the support for `needs:` keyword
as part of GitLab CI. That makes some of the jobs
to be run out of order.
2019-08-01 14:26:49 +00:00
Heinrich Lee Yu fc22626f45 Remove deprecated uses of attribute_changed?
Prepares us for upgrade to Rails 5.2
2019-04-30 15:24:25 +08:00
Nick Thomas 013f7cd24c
Inherit from ApplicationRecord instead of ActiveRecord::Base 2019-03-28 16:18:23 +00: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
Grzegorz Bizon 2d154cee32 Move processables scope into commit status class 2019-01-25 10:41:46 +01:00
Yorick Peterse 590ff80f83
Refactor how a few ActiveRecord enums are defined
In a few models we define ActiveRecord enums that are redefined in EE
using the following pattern:

    enum :some_enum, {
      ...
    }.merge(EE_ENUM_VALUES)

This particular approach is problematic to deal with, because it
requires that we `prepend` and EE module _before_ defining the enum.
This typically translates to the `prepend` being the first line in the
model in EE, but this can easily lead to merge conflicts when developers
add more `include` and/or `prepend` lines.

As part of https://gitlab.com/gitlab-org/gitlab-ee/issues/8244 and
https://gitlab.com/gitlab-org/gitlab-ee/issues/8241 we are moving
`prepend` to the last line in a file, reducing the chances of running
into merge conflicts. This poses a bit of a problem with the pattern
above, because this pattern does not allow us to move the `prepend`
further down a file.

To resolve this problem, we simply move the Hash value of the enum to a
separate class method. This method is defined in a separate module where
necessary, allowing us to use it like so:

    enum :failure_reasons, ::SomeModelEnums.failure_reasons

The method in turn is defined in a very straightforward manner:

    module SomeModelEnums
      def self.failure_reasons
        {
          ...
        }
      end
    end

This makes it easy for EE to add values without requiring the `prepend`
to be placed before the `enum` is defined.

For more information, see the following issues and merge requests:

* https://gitlab.com/gitlab-org/gitlab-ee/issues/8244
* https://gitlab.com/gitlab-org/gitlab-ee/issues/8241
* https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8424
2018-11-15 17:41:54 +01:00
Kamil Trzciński 40397f3577 Allow to make builds soft-archived.
The soft-archived builds cannot be run after some deadline time.
The intent is to aggressively recycle old builds after sometime.
2018-11-05 15:51:57 +01:00
George Tsiolis 733ae94921 Fix typos in comments and specs 2018-11-01 08:59:20 +02:00
Shinya Maeda 4611a59968 Add failure reason for execution timeout 2018-10-28 18:31:08 +00:00
Shinya Maeda 0c9ad4826a Support backward compatibility when introduce new failure reason 2018-10-26 08:01:28 +00:00
Shinya Maeda 8bc065e02d Rename failure reason to stale_schedule 2018-10-02 17:08:14 +02:00
Shinya Maeda 587560757f Fix StuckCiJobsWorker and added tests 2018-10-02 17:08:12 +02:00
Shinya Maeda c9077a0efd Add cleanup mechanizm for stale scheduled jobs 2018-10-02 17:04:04 +02:00
Shinya Maeda ffbc0b1c29 Remove whitespace 2018-10-02 17:02:12 +02:00
Shinya Maeda a7c767f164 Add a new status to ci_builds.status 2018-10-02 17:02:11 +02:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Rémy Coutable f20a40f4a1 Merge branch 'frozen-string-enable-app-models' into 'master'
Enable frozen string in app/models/*.rb

See merge request gitlab-org/gitlab-ce!20851
2018-08-02 09:11:52 +00:00
Kamil Trzciński c0abcc68de Fix spec failures 2018-08-01 12:25:19 +02:00
Kamil Trzciński 6b0bfda8ac Add `runner_unsupported` CI failure 2018-08-01 12:25:19 +02:00
gfyoung 50abbd3e53 Enable frozen string in app/models/*.rb
Partially addresses #47424.
2018-07-26 16:55:41 -07:00
Jan Provaznik 0665a8f730 Enable mapping to nil in enums
Enum in Rails 5 does not map nil values - IOW nil value remains nil,
even if there is a key with nil value in the enum definition.

This commit overrides the underlying Enum methods so nil value is
still mapped. This solution is far from being ideal: it uses dynamic
definition of methods which introduces more magic/confusion
into the codebase.

It would be better to get rid of the nil value in enums.
2018-06-06 20:46:54 +02:00
Mayra Cabrera 86ef822177 Makes CommitStatus and GenericCommitStatus respond to presentable
methods

Includes Presentable module into CommitStatus. This fixes presenter
methods being called on those classes.

Closes #46177
2018-05-15 14:24:11 -05:00
blackst0ne 9e78b86dd4 [Rails5] Fix enum question mark methods 2018-05-02 08:09:19 +00:00
Tomasz Maczukin 2cc0c692c0
Ensure that enqueuing a commit status always sets 'queued_at' value 2018-04-10 15:13:55 +02:00
Zeger-Jan van de Weg 16ea3315f2
Revert "Allow CI/CD Jobs being grouped on version strings"
This reverts commit 4f2cdb51df.
2018-04-04 14:10:22 +02:00
Zeger-Jan van de Weg 4f2cdb51df
Allow CI/CD Jobs being grouped on version strings
This makes grouping on version number available. In general I'd like to
group based on MAJOR.MINOR version numbers for Gitaly.
2018-03-01 12:39:30 +01:00
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Shinya Maeda 67c7e0fc5d Fail jobs if its dependency is missing 2017-12-06 15:53:59 +09:00
Kamil Trzcinski 07c7ba1bf4 Allow to drop jobs for deleted projects 2017-11-27 11:56:15 +01:00
Grzegorz Bizon 164b1df590 Extract ensure stage service from commit status class 2017-11-06 11:04:09 +01:00
Grzegorz Bizon e2828a6067 Use existing pipeline stage if stage already exists 2017-11-06 11:04:09 +01:00
Grzegorz Bizon 503f213670 Make sure that every job has a stage assigned 2017-11-06 11:04:09 +01:00
Shinya Maeda 38d9b4d77d Use script_failure. Add runner_system_failure. Improve spec. 2017-09-05 15:10:34 +09:00
Shinya Maeda 68f6c61cf6 - Allow runner API to pass failure_reason
- Fix spec
2017-09-05 14:30:28 +09:00
Shinya Maeda 1d7c039072 Fix enum lists 2017-09-05 14:30:28 +09:00