Commit Graph

288 Commits

Author SHA1 Message Date
GitLab Bot 0ae8428c8e Add latest changes from gitlab-org/gitlab@master 2021-05-11 21:10:21 +00:00
GitLab Bot e7e40d45b0 Add latest changes from gitlab-org/gitlab@master 2021-04-26 18:09:45 +00:00
GitLab Bot 10130901f1 Add latest changes from gitlab-org/gitlab@master 2021-04-15 15:09:11 +00:00
GitLab Bot a3dfd311f4 Add latest changes from gitlab-org/gitlab@master 2021-04-14 15:09:04 +00:00
GitLab Bot 2e1b10493f Add latest changes from gitlab-org/gitlab@master 2021-04-06 15:09:23 +00:00
GitLab Bot 61ee5c3635 Add latest changes from gitlab-org/gitlab@master 2021-04-06 09:09:03 +00:00
GitLab Bot 4a1459aba9 Add latest changes from gitlab-org/gitlab@master 2021-04-02 00:09:32 +00:00
GitLab Bot 1e0d9b7134 Add latest changes from gitlab-org/gitlab@master 2021-04-01 21:09:22 +00:00
GitLab Bot 676109e1b3 Add latest changes from gitlab-org/gitlab@master 2021-03-31 18:09:19 +00:00
GitLab Bot 1d041b2968 Add latest changes from gitlab-org/gitlab@master 2021-03-24 18:09:31 +00:00
GitLab Bot b90d8b54a4 Add latest changes from gitlab-org/gitlab@master 2021-03-09 12:08:52 +00:00
GitLab Bot bcfab67c0f Add latest changes from gitlab-org/gitlab@master 2021-02-25 09:10:45 +00:00
GitLab Bot 1eec6b22b2 Add latest changes from gitlab-org/gitlab@master 2021-02-16 18:09:24 +00:00
GitLab Bot 5231344d99 Add latest changes from gitlab-org/gitlab@master 2021-02-11 15:09:11 +00:00
GitLab Bot 6e495b4e91 Add latest changes from gitlab-org/gitlab@master 2021-02-01 09:09:28 +00:00
GitLab Bot ea3306a15e Add latest changes from gitlab-org/gitlab@master 2021-01-14 18:10:59 +00:00
GitLab Bot dcacb5daf7 Add latest changes from gitlab-org/gitlab@master 2021-01-11 18:10:43 +00:00
GitLab Bot cb3b8bd589 Add latest changes from gitlab-org/gitlab@master 2020-12-21 15:10:05 +00:00
GitLab Bot edd183a633 Add latest changes from gitlab-org/gitlab@master 2020-10-22 12:08:41 +00:00
GitLab Bot 16515bdfcb Add latest changes from gitlab-org/gitlab@master 2020-10-13 15:08:53 +00:00
GitLab Bot a27b8a5c10 Add latest changes from gitlab-org/gitlab@master 2020-10-01 12:10:14 +00:00
GitLab Bot 0eaa82ad61 Add latest changes from gitlab-org/gitlab@master 2020-09-11 12:08:50 +00:00
GitLab Bot f0809fbc2c Add latest changes from gitlab-org/gitlab@master 2020-09-09 00:08:42 +00:00
GitLab Bot adfb0e182c Add latest changes from gitlab-org/gitlab@master 2020-09-01 15:10:39 +00:00
GitLab Bot 39a4ea6124 Add latest changes from gitlab-org/gitlab@master 2020-08-24 21:10:17 +00:00
GitLab Bot 6df7943512 Add latest changes from gitlab-org/gitlab@master 2020-08-13 15:10:03 +00:00
GitLab Bot 53758cb2ca Add latest changes from gitlab-org/gitlab@master 2020-08-01 00:09:45 +00:00
GitLab Bot 04338021ad Add latest changes from gitlab-org/gitlab@master 2020-07-31 18:09:37 +00:00
GitLab Bot 9215d9f761 Add latest changes from gitlab-org/gitlab@master 2020-07-15 12:09:26 +00:00
GitLab Bot e829ca213b Add latest changes from gitlab-org/gitlab@master 2020-06-22 15:09:27 +00:00
GitLab Bot 6744162376 Add latest changes from gitlab-org/gitlab@master 2020-06-15 12:08:44 +00:00
GitLab Bot c4844aea3f Add latest changes from gitlab-org/gitlab@master 2020-06-03 00:08:38 +00:00
GitLab Bot 4d5ee2b814 Add latest changes from gitlab-org/gitlab@master 2020-05-27 15:08:11 +00:00
GitLab Bot 4a3ba3e5f2 Add latest changes from gitlab-org/gitlab@master 2020-05-22 09:08:09 +00:00
GitLab Bot 8f306a7dc5 Add latest changes from gitlab-org/gitlab@master 2020-05-21 06:08:25 +00:00
GitLab Bot 674e7e2c3d Add latest changes from gitlab-org/gitlab@master 2020-05-14 12:08:21 +00:00
GitLab Bot 9a9415ab12 Add latest changes from gitlab-org/gitlab@master 2020-04-23 15:09:55 +00:00
GitLab Bot 8a7efa45c3 Add latest changes from gitlab-org/gitlab@master 2020-04-02 18:08:11 +00:00
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
Shinya Maeda b1af1f268b Fix enum wording 2017-09-05 14:30:28 +09:00
Shinya Maeda dcf09d1144 Implement `failure_reason` on `ci_builds` 2017-09-05 14:30:28 +09:00
Grzegorz Bizon 865de49b08 Update related stage status when job status is changed 2017-07-24 11:34:01 +02:00
Grzegorz Bizon 8657d5dd8a Do not implement CI/CD job to stage association yet 2017-07-24 11:33:01 +02:00
Grzegorz Bizon c7a7ef044c Use a new stage_id reference to a persisted stage 2017-07-20 12:56:27 +02:00
Grzegorz Bizon b3ee172b4e Add a workaround for a tmp job -> stage relation
We still didn't migrate `ci_builds.stage_id`, so we can't use a
belongs_to association. We also have `ci_builds.stage` string attribute,
that we need to phase out in favor of `ci_stages.name`.
2017-07-04 16:41:33 +02:00
Z.J. van de Weg 93b555af85 Handle legacy jobs without name
Older pipelines can contain jobs without a name, in which case
'nameless' is used right now, so we can properly still handle other
actions on these jobs.

Fixes gitlab-org/gitlab-ce#33403
2017-06-13 11:19:45 +02:00
Douwe Maan 6bea29649e Merge branch 'fix/import-commit-status-issue' into 'master'
Ignore commit status name validation on importing

Closes #33490

See merge request !12039
2017-06-12 15:38:09 +00:00
Filipa Lacerda 452202e36d Improve Job detail view to make it refreshed in real-time instead of reloading 2017-06-12 09:20:19 +00:00
James Lopez eaf71fc963 ignore name validation on importing 2017-06-12 10:11:08 +02:00
Grzegorz Bizon 79380fe5fb Merge branch 'master' into feature/gb/persist-pipeline-stages
* master: (524 commits)
  Improve user experience around slash commands in instant comments
  Fix LFS timeouts when trying to save large files
  retryable? is now available for CommitStatus
  Resolve "Documentation of `.gitlab-ci.yml` states incorrect example for variables"
  Fix test failures
  Add slugify project path to CI enviroment variables
  Fixed typo: craeted -> created
  32118 Make New environment empty state btn lowercase
  Expose import_status in Projects API
  32832 Remove overflow from comment form for confidential issues and vertically aligns confidential issue icon
  Fix test failures
  Allow manual bypass of auto_sign_in_with_provider
  Fix keys seed
  Allow users to be hard-deleted from the API
  fixup some classnames and media queries
  Enable the Style/PreferredHashMethods cop
  Lint our factories creation in addition to their build
  Don’t schedule workers from inside transactions
  Allow scheduling from after_commit hooks
  Forbid Sidekiq scheduling in transactions
  ...

Conflicts:
	app/serializers/pipeline_entity.rb
	db/schema.rb
	spec/factories/ci/stages.rb
	spec/lib/gitlab/import_export/safe_model_attributes.yml
	spec/services/ci/create_pipeline_service_spec.rb
	spec/spec_helper.rb
2017-06-05 12:51:59 +02:00
Kamil Trzciński 9ccb289aa1 Merge branch 'zj-job-view-goes-real-time' into 'master'
Initial implementation for real time job view

Closes #31397

See merge request !11651
2017-06-05 10:24:57 +00:00