Commit Graph

167 Commits

Author SHA1 Message Date
Lin Jen-Shin b4a7e7cfbf Don't call anything on a block, use simple if
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20058743
2016-12-15 18:38:26 +08:00
Lin Jen-Shin 7cced60069 Introduce latest_status and add a few tests
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20003268
2016-12-14 23:37:49 +08:00
Lin Jen-Shin 3ce6ba7db9 Merge remote-tracking branch 'upstream/master' into show-commit-status-from-latest-pipeline
* upstream/master: (39 commits)
  Improve build status specs contexts descriptions
  Add some missing tests for detailed status methods
  Remove trailing blank line from Allowable module
  Update manual build icon SVG
  Make it possible to mix `Gitlab::Routing` in
  Extract abilities checking module from ability model
  Extend tests for pipeline detailed status helpers
  Add tests for common build detailed status helpers
  Add missing tests for build `cancelable?` method
  Add tests for detailed build statuses factory
  Make it possible to retry build that was canceled
  Make build retryable only if complete and executed
  Improve readability in methods for detailed status
  Add tests for build cancelable/retryable statuses
  Extend specs for build play/stop detailed statuses
  Refine build stop/play extended status specs
  Use manual build icon in play/stop build statuses
  Adds manual action icon and case to show it
  Fix detailed status specs for pipeline stage model
  Fix detailed status badge for generic commit status
  ...
2016-12-14 20:42:42 +08:00
Lin Jen-Shin 367024f170 Merge remote-tracking branch 'upstream/master' into show-commit-status-from-latest-pipeline
* upstream/master: (557 commits)
  Fix wrong error message expectation in API::Commits spec
  Move admin settings spinach feature to rspec
  Encode when migrating ProcessCommitWorker jobs
  Prevent overflow with vertical scroll when we have space to show content
  Make rubocop happy
  API: Ability to cherry-pick a commit
  Be smarter when finding a sudoed user in API::Helpers
  Backport hooks on group policies for the EE-specific implementation
  API: Ability to get group's project in simple representation
  Add AddLowerPathIndexToRoutes to setup_postgresql.rake
  For single line git commit messages, the close quote should be on the same line as the open quote
  added border-radius and padding to labels
  Allow all alphanumeric characters in file names (!8002)
  Add failing test for #20190
  Don't allow blank MR titles in API
  Replace static fixture for awards_handler_spec (!7661)
  Crontab typo '* */6' -> '0 */6' (4x/day not 1x-per-min-for-1h 4x/day)
  Fix test
  Tweak style and add back wording
  Clean up commit copy to clipboard and make consistent
  ...
2016-12-14 19:24:31 +08: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 c4e46c5740 Fix success status 2016-12-07 12:47:06 +01:00
Kamil Trzcinski 953a10947b Added Ci::Stage specs 2016-12-06 16:04:30 +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 fa1105b10b Fix broken pipeline rendering [ci skip] 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
Grzegorz Bizon 5e3cfe2f09 Expose pipeline detailed status using status factory 2016-12-05 13:23:58 +01:00
Grzegorz Bizon a49e9949c6 Rename `MergeRequest#pipeline` to `head_pipeline` 2016-11-29 14:12:49 +01:00
Lin Jen-Shin 6192ea53fa Rename latest_for to latest, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333/diffs#note_18819292
2016-11-24 16:50:37 +08:00
Lin Jen-Shin bd3a544ab0 Wrap against 80 chars and rename failed_or_canceled
to better reflect the status. Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7508#note_18858398
2016-11-23 19:43:56 +08:00
Lin Jen-Shin 66301ce274 Filter against status first, otherwise we can't
find the latest successful one if the last one is
failed and we already exclude the others.
2016-11-22 01:48:41 +08:00
Lin Jen-Shin dd6b16a111 Use latest_for in latest_successful_for 2016-11-21 22:24:09 +08:00
Lin Jen-Shin 721f2d3788 Still use compound pipeline status, but group by
ref and sha so that it would show latest pipeline
if ref and sha are both specified, otherwise still
the same as before.
2016-11-21 22:19:16 +08:00
Lin Jen-Shin b20c7846ff Merge remote-tracking branch 'upstream/master' into show-commit-status-from-latest-pipeline
* upstream/master: (754 commits)
  Add documentation about todos and failed builds
  Add Changelog entry for failed builds todos fix
  Do not create TODO when build is allowed to fail
  Fix 404 on some group pages when name contains dot
  Grapify the users API
  Remove duplicate sidekiq throttling parameters
  Fix regression in Merge request form
  Fix wrong link
  Fix test
  Fix broken test
  Changes for stop url to path
  fix typo in gitlab_flow.md ('munch'->'much')
  Fix spec
  Backport some changes done from Time Tracking feature in EE.
  Use build instead create in BroadcastMessage model spec
  Try to fix tests
  Remove unnecessary self from user model
  Expose stop_path for environment to not construct that in frontend
  Bring back the `commit_url` as it's used by CycleAnalytics
  Add api endpoint for creating a pipeline
  ...
2016-11-21 22:06:11 +08:00
Kamil Trzcinski ca639c9b82 Allow to retry failed or canceled builds and fix cancel running specs failure 2016-11-19 14:04:11 +01:00
Lin Jen-Shin 6d1c5761cd Improve how we could cancel pipelines:
* Introduce `HasStatus.cancelable` which we might be able to cancel
* Cancel and check upon `cancelable`
* Also cancel on `CommitStatus` rather than just `Ci::Build`

Fixes #23635

Fixes #17845
2016-11-17 20:22:57 +08:00
Lin Jen-Shin 18a71c4760 Show commit status from latest pipeline
Rather than compound status from all pipelines.

Closes #20560
2016-11-08 00:04:18 +08:00
Lin Jen-Shin 80032a84dc Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (216 commits)
  Remove invalid changelog entries
  require rails/generators for generators
  Adds variable. Fixes changelog
  Fix haml_lint
  Fixes after review
  Update changelog
  Remove tooltips from project header
  Makes table pagination responsive
  23545 Fix distorted project and group avatars
  Fix spinach tests
  Update links in side nav and header
  Allow to search for user by secondary email address in the admin interface
  Rename :name search parameter to :search_query at /admin/users
  Initialize Sidekiq with the list of queues used by GitLab
  Fix project features default values
  Add a link to the Issue Boards API in main README
  Add validation errors to Merge Request form
  Fix Markdown styling inside reference links
  Fix relative links in Markdown wiki when displayed in "Project" tab
  Adds label description to issue board title
  ...
2016-11-02 16:18:21 +08:00
Kamil Trzcinski 47b2add4f6 Add tests for optimistic locking 2016-10-26 11:37:23 +02:00
Kamil Trzcinski 5d7ee7a1b6 Use optimistic locking 2016-10-26 11:37:23 +02:00
Lin Jen-Shin e90a555745 Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (73 commits)
  Stop unauthized users dragging on issue boards
  Capitalize Git
  Add docker-compose environment initialization command
  Improve readability and add specs for label filtering
  Improve label filtering implementation
  Allow the use of params[:name] when filtering labels
  Fix Rubocop offenses in issue move specs
  Add spec in Issues::MoveService to fix label assignment regression
  Fix bug where labels would be assigned to issues that were moved
  Fix `User#to_reference`
  Fix rubocop build error
  Remove redundant class_name and foreign_key overrides
  Enable SingleLinePerSelector in scss-lint
  Escape ref and path for relative links (!6050)
  Add failing test for #21420
  Enable SpaceAfterVariableColon in scss-lint
  Enable SpaceAroundOperator in scss-lint
  Enable trailingWhitespace in scss-lint
  Disable Rails/Output cop since it makes no sense here
  Use File.write instead of File.open + File#write
  ...
2016-10-25 23:03:47 +08: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
Lin Jen-Shin 52ed6d8e4a Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (43 commits)
  Disable warming of the asset cache in Spinach tests under CI
  Trim project_path whitespace on form submit
  added skipped definition
  updated some links in definitions
  Don't use Hash#slice since it's not supported in Ruby 2.1
  Create protected branches bundle
  [ci skip] Add a comment explaining validate_board_limit callback
  Fix: Backup restore doesn't clear cache
  Fix GitLab project import when a user has access only to their default namespace.
  Test GitLab project import for a user with only their default namespace.
  We want to release this in 8.13.0
  Add CHANGELOG.md entry
  Return truncation for notification descriptions, fix minor bugs with rendering
  Use guard clause instead of if-else statement
  Tests for markdown HipChat notifications
  Clean up Banzai HTML for HipChat
  Ensure absolute URLs for single lines from Banzai for HipChat
  Absolute URLs for Banzai HTML for HipChat
  Also render commit titles in HipChat notifications
  Full Banzai rendering for HipChat notifications
  ...
2016-10-21 18:20:23 +08:00
Kamil Trzcinski c9108442b5 Update duration at the end of pipeline 2016-10-20 12:08:05 +02:00
Lin Jen-Shin e5de4c77ac Merge remote-tracking branch 'upstream/master' into pipeline-notifications
* upstream/master: (221 commits)
  Differentiate the expire from leave event
  Use LabelsFinder on Fogbuz importer
  Use LabelsFinder on Google Code importer
  Change the order of tested methods in project_members_controller_spec
  Remove show_menu_above attribute from issuable dropdowns.
  Spaces before `}`!
  Avoid touch label links that does not belongs to project when moving it
  Remove order by label type on LabelsFinder
  Rename Labels::CreateService to Labels::FindOrCreateService
  Add self.project_foreign_key on both Issue and MergeRequest
  Only show label type for projects that belong to a group
  Disable subscribing to group-level labels
  Remove unused method Project#all_labels
  Update specs to cope with new label types and priorities
  Fix max number of permitted priorities per project label
  Fix GitHub importer spec
  Update CHANGELOG
  Add support to group labels to SlashCommands::InterpretService
  Use join instead of subquery on Label.unprioritized scope
  Warn user deleting a group label affect all projects within the group
  ...
2016-10-20 17:14:31 +08:00
Kamil Trzcinski 67b96255d8 Keep around commits only on pipeline create 2016-10-19 14:04:09 +02:00
Lin Jen-Shin 12ef494db8 Use Array rather than compact, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_17089690
2016-10-18 18:52:09 +08:00
Lin Jen-Shin b3d401adcd Merge remote-tracking branch 'upstream/master' into retry-cancelled-pipelines
* upstream/master: (58 commits)
  Update endpoint to username validator
  change border color to variable
  Add todo for deprecated user routes and more information about deprecation to changelog
  Provide better error message to the user
  Apply better hierarchy to markdown headers and issue/mr titles
  Swapped button text manipulation outcomes for the toggle query
  Fixed find file keyboard navigation
  Update CHANGELOG for 8.12.7
  Added download-button class and applied button margin
  Enable activerecord_sane_schema_dumper for test
  Updated logo from @luke
  Fix broken specs on MySQL after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6896
  Fix Test Env (proper error handling when gitlab-shell is not clonned)
  Fix randomly crashing spinach test for merge request
  [Great spinach fix] Replace gsub with delete
  Remove carriage returns from commit description as summary is on a newline and will always include carriage returns
  Convert due_date_select.js filetype to es6.
  Stop directly parsing due_date with Date.parse, prefer parsing implicitly.
  Improve spec for pipeline metrics worker
  Add Pipeline metrics worker
  ...
2016-10-18 09:29:51 +00:00
Lin Jen-Shin ac51fb8882 Merge branch 'pipeline-emails' into pipeline-notifications
* pipeline-emails: (58 commits)
  Update endpoint to username validator
  change border color to variable
  Add todo for deprecated user routes and more information about deprecation to changelog
  Provide better error message to the user
  Apply better hierarchy to markdown headers and issue/mr titles
  Swapped button text manipulation outcomes for the toggle query
  Fixed find file keyboard navigation
  Update CHANGELOG for 8.12.7
  Added download-button class and applied button margin
  Enable activerecord_sane_schema_dumper for test
  Updated logo from @luke
  Fix broken specs on MySQL after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6896
  Fix Test Env (proper error handling when gitlab-shell is not clonned)
  Fix randomly crashing spinach test for merge request
  [Great spinach fix] Replace gsub with delete
  Remove carriage returns from commit description as summary is on a newline and will always include carriage returns
  Convert due_date_select.js filetype to es6.
  Stop directly parsing due_date with Date.parse, prefer parsing implicitly.
  Improve spec for pipeline metrics worker
  Add Pipeline metrics worker
  ...
2016-10-18 08:17:34 +00:00
Lin Jen-Shin 2e067480a9 Rename for a more consistent pipeline worker name, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17039533
2016-10-17 18:12:07 +08:00
Lin Jen-Shin b4e751557a Use run_after_commit to avoid race condition, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17038749
2016-10-17 18:09:53 +08:00
Lin Jen-Shin 0ea7f32afe Make cancelled pipelines being able to retry
Closes #23326
2016-10-17 15:52:10 +08:00
Lin Jen-Shin 776877c27d Pipeline#user could be nil. Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_16956937
2016-10-17 07:25:21 +00:00
Lin Jen-Shin eeeb96c9d0 Change service to be a worker, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_16118195
2016-10-17 07:25:20 +00:00
Lin Jen-Shin 12a6bbc36a Prefix _ to show that it's intended unused, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_16073734
2016-10-17 07:25:20 +00:00
Lin Jen-Shin 56562d26dd Fix spelling, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_16074432
2016-10-17 07:25:20 +00:00
Lin Jen-Shin 8ea702cfe5 Revert "Split notification integration into another branch"
This reverts commit 1404aa8677.
2016-10-17 07:24:48 +00:00
Kamil Trzcinski 9c6c5c79f8 Add Pipeline metrics worker 2016-10-17 08:54:33 +02:00
Kamil Trzciński 3f68303829 Merge branch 'feature/process-pipeline-hooks-asynchronously' into 'master'
Execute pipeline hooks asynchronously

## What does this MR do?

This MR makes it possible to execute pipeline hooks asynchronously, what should help to improve performance of CI pipeline processing.

## What are the relevant issue numbers?

Closes #23056

See merge request !6824
2016-10-14 16:48:42 +00:00
Grzegorz Bizon 2461e10912 Execute pipeline hooks asynchronously 2016-10-12 20:20:01 +02:00
Grzegorz Bizon df404f551a Schedule async pipeline success worker after commit 2016-10-12 12:07:58 +02:00
Grzegorz Bizon a98e4081d1 Process MWBS in successful pipeline asynchronously 2016-10-07 09:32:29 +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