Commit Graph

114 Commits

Author SHA1 Message Date
Grzegorz Bizon 346a7c696a Add after_stage scope to commit status class 2017-02-14 11:38:19 +01:00
Grzegorz Bizon ffcf3c6858 Skip job only when canceling the pipeline it belongs to 2017-02-13 15:11:21 +01:00
Grzegorz Bizon 008f22cd82 Fix pipeline specs related to canceling builds 2017-02-13 15:11:21 +01:00
Grzegorz Bizon a70a83cf29 Skip buils that were canceled but not started yet 2017-02-13 15:11:21 +01:00
Mike Greiling 1c5a506588 rename sort method 2017-01-02 11:44:08 -06:00
Mike Greiling 2eb0beb661 add natural sorting token for build names 2017-01-02 11:44:08 -06:00
Grzegorz Bizon 5f590a71fd Improve readability in methods for detailed status 2016-12-13 13:24:25 +01:00
Kamil Trzcinski 980009e6e8 Fix auto loading of constants for Ci Statuses 2016-12-12 12:59:01 +01:00
Kamil Trzcinski 633e64382d Added Ci::Status::Build 2016-12-12 12:59:01 +01:00
Kamil Trzcinski 260d754ca8 Fix handling of allowed to failure jobs 2016-12-06 14:13:21 +01:00
Kamil Trzcinski d865aedafc Introduce `Ci::Stage`, right now this is artificial object that is build dynamically. 2016-12-06 14:13:21 +01:00
Kamil Trzcinski 4e06818d33 Support pipelines API
Pass `updated_at` to get only incremental changes since last update
2016-12-06 14:13:21 +01:00
Lin Jen-Shin da9726170c Move has_trace? to CommitStatus than GenericCommitStatus
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7617#note_18762721
2016-11-22 13:36:19 +08:00
Kamil Trzcinski d8aed6a27b Fix optimistic locking 2016-10-26 11:37:23 +02:00
David Wagner 03b6108f6f Remove redundant class_name and foreign_key overrides
They were Rails' default and are unnecessarily overridden.

Signed-off-by: David Wagner <david@marvid.fr>
2016-10-24 22:29:48 +02:00
Grzegorz Bizon 2e3bc85421 Do not return from proc-closure in pipeline transition 2016-10-12 15:21:11 +02:00
Grzegorz Bizon 419518df67 Merge branch 'master' into feature/improve-mrwbs-and-todos-for-pipelines
* master: (221 commits)
  Add CHANGELOG entry for 8.12.6
  Added 'Download' button to snippet view
  Merge branch 'api-fix-project-group-sharing' into 'security'
  Add 8.12.5, 8.11.9, and 8.10.12 CHANGELOG entries
  FIx JS bug with select2 because of missing `data-field` attribute in select box.
  Remove pointless `.vagrant_enabled` file
  allow multiple labels commands
  Move some CHANGELOG entries to the 8.13.0 part
  Move operations/ to new location
  Move health check docs under user/admin_area/monitoring
  Make guests unable to view MRs
  Add examples of fake tokens to be used in docs
  Remove duplicate CHANGELOG entry
  Allow browsing branches that end with '.atom'
  Refactor the SubGit/SVN documentation
  Document the new CI_DEBUG_TRACE variable
  Remove redundant images
  changed the scss for the top line connectors to be exactly centered
  Rearrange GitLab basics READMEs
  New images for GitLab basics "Create MR" docs
  ...

Conflicts:
  app/models/commit_status.rb
2016-10-12 11:52:54 +02:00
Grzegorz Bizon 904de2d64b Check for transition loopback in commit status 2016-10-08 20:42:09 +02:00
Grzegorz Bizon 3fb4d86c6d Add temporary fix for race condition in MWBS 2016-10-08 20:34:45 +02:00
Grzegorz Bizon 74fd5cab15 Improve transitions and run hooks after transaction 2016-10-08 20:25:16 +02:00
Grzegorz Bizon f5631ff262 Fix ci pipeline processing with async jobs 2016-10-07 14:52:30 +02:00
Grzegorz Bizon a43baa056e Rename pipeline workers to match current convention 2016-10-06 14:52:00 +02:00
Grzegorz Bizon 217244074f Move MWBS trigger from build to pipeline event 2016-10-06 10:46:31 +02:00
Kamil Trzciński 0bbeff3d5e Merge branch 'feature/improve-async-pipeline-processing' into 'master'
Improve asynchronous pipeline processing

## What does this MR do?

This MR improves asynchronous processing of pipeline.

## Why was this MR needed?

It eliminates some race conditions and improves performance.

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing

## What are the relevant issue / merge request numbers?

Related merge request:  !6410  
Extracted from !6411

See merge request !6650
2016-10-06 08:42:35 +00:00
Lin Jen-Shin 5c9ac560e7 Introduce all_state_names so that we could avoid NOT IN 2016-10-05 00:10:23 +08:00
Grzegorz Bizon 7f270d041d Do not return false in commit status transition 2016-10-04 16:34:22 +02:00
Grzegorz Bizon 5ce5abdc1d Fix hipchat service specs after changes in pipeline 2016-10-04 14:43:58 +02:00
Grzegorz Bizon f57cfdb6b5 Update order of build transition callbacks 2016-10-04 14:43:58 +02:00
Grzegorz Bizon 7d4767fb48 Extract updating pipeline status to async worker 2016-10-04 14:43:24 +02:00
Grzegorz Bizon 578638742a Use internal commit status API to check if finished 2016-10-04 14:43:24 +02:00
Grzegorz Bizon 68774452a4 Fix async pipeline and remove unrelated changes 2016-10-04 14:42:32 +02:00
Lin Jen-Shin 752a4cce51 Add test for CommitStatus.exclude_ignored 2016-10-03 18:56:32 +08:00
Kamil Trzcinski 4567e624a0 Make pipeline processing asynchronous
Conflicts:
	app/models/ci/pipeline.rb
	app/models/commit_status.rb
2016-10-03 12:34:05 +02:00
Lin Jen-Shin 705d210c73 Style/EmptyLinesAroundBlockBody 2016-10-03 18:33:43 +08:00
Lin Jen-Shin 23e0a3ee7d Specify 3 cases we want them to be excluded. [ci skip] 2016-10-03 18:25:18 +08:00
Lin Jen-Shin 8dfec32d2b Rename ignored to failed_but_allowed, introduce exclude_ignored
which merges previous exclude_ignored_jobs and failed_but_allowed,
so that we don't treat ignored a special case in HasStatus.
2016-10-03 18:22:51 +08:00
Kamil Trzcinski de61efed0f Fix processing of events when build finished.
This solves Pipelines in `running` after all stages do finish.
2016-09-19 15:06:26 +02:00
Rémy Coutable 7b25add30f Merge branch 'group-similar' into 'master'
Group similar builds

We group builds by removing from the builds name two numbers which are delimited by whitespace or colon:
* `name 0 1` => `name`
* `name 0:1` => `name`
* `name 0/1` => `name`
* `name 0:1 ruby` => `name ruby`
* `name 0/1 ruby` => `name ruby`
* `0 1 name ruby` => `name ruby`
* `0:1 name ruby` => `name ruby`
* `0/1 name ruby` => `name ruby`

See merge request !6242
2016-09-15 15:41:15 +00:00
Kamil Trzcinski b964c6c579 Add grouping tests 2016-09-14 15:04:12 +02:00
Lin Jen-Shin 6baf9971db Revert "reload instead, so that we don't have to change order"
This reverts commit 575dc2b0d7.
2016-09-12 21:27:46 +08:00
Lin Jen-Shin 575dc2b0d7 reload instead, so that we don't have to change order 2016-09-12 20:37:44 +08:00
Lin Jen-Shin 683d8b7f00 Fix the ordering of transition callbacks:
Because pipeline status could be changed for the builds in the next
stages, if we process next stages first, the current build would be
out of synchronized, and would need a reload for that matter.

Alternatively, like what I did in this commit, we could process the
next stages later (by using `after_transition` rather than
`around_transition`), and complete what're doing for the current
build first. This way we don't have to reload because nothing is
out synchronized.

Note that since giving `false` in `after_transition` would halt the
callbacks chain, according to:

https://github.com/state-machines/state_machines-activemodel/blob/v0.4.0/lib/state_machines/integrations/active_model.rb#L426-L429

We'll need to make sure we're not returning false because we don't
intend to interrupt the chain.

This fixes #22010.

After this fix, both pipeline events and build events would only show
up once.
2016-09-12 18:55:49 +08:00
Kamil Trzcinski d392f147fc Group similar builds 2016-09-07 14:52:13 +02:00
Robert Speicher 34a472f674 Merge branch 'statuseable-hasstatus' into 'master'
rename Statuseable to HasStatus

## What does this MR do?

- Rename all instances of Statuseable in the codebase, to HasStatus
- Rename all files from statuseable to has_status

## What are the relevant issue numbers?

Closes #21103 

See merge request !6003
2016-08-25 18:49:03 +00:00
Paco Guzman 6280fd3777 Reduce number of database queries on builds tab 2016-08-25 14:42:18 +02:00
De Wet Blomerus 23bed91b3f rename Statuseable to HasStatus 2016-08-25 04:55:32 +02:00
Robert Speicher c711fe15dd Merge branch 'mark-as-processable' into 'master'
Make all future skipped builds as processable when retrying a build

## What does this MR do?

Makes a builds that are marked as skipped when a pipeline is processed to be reprocessed by changing their's state to created.

## Why was this MR needed?

Currently retry is broken. When you retry a build of pipeline it will succeed and be marked as succeeded, when the next stages should be triggered.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/21066

See merge request !5879
2016-08-19 18:35:07 +00:00
Kamil Trzcinski 71db3b1ce7 Make all future skipped builds as processable when retrying a build 2016-08-18 22:36:54 +01:00
Lin Jen-Shin 0ea81ae50a Merge remote-tracking branch 'upstream/pipeline-hooks-without-slack' into wall-clock-time-for-showing-pipeline
* upstream/pipeline-hooks-without-slack:
  Make explicit call for all event types for ProjectHook factory
  Capitalise URL on web_hooks/form
  Remove changes not related to this MR
  Added documentation for pipeline hooks
  Rename queue to enqueue in tests
  Instrument Project.visible_to_user
  Fix build play failure
  Update ruby 2.3.1
  Improve transition between states for event `enqueue`
  Use event `enqueue` instead of `queue`
  Fix test failures
  Fix bug where destroying a namespace would not always destroy projects
  Remove unused SpamReport model; this was renamed to SpamLog
  Corrected links/usernames in performance guide
  Add gravatars to build history
  Add deployment ID and gravatar to environments page
  Format environment history page
  Add avatar to commit message; environment style updates to match pipelines page
  Style deploy button
2016-08-15 19:02:48 +08:00
Lin Jen-Shin 5e7d99d3dc Rename to total_duration and we're not using CommitStatus.duration 2016-08-15 18:54:38 +08:00