Commit Graph

195 Commits

Author SHA1 Message Date
Grzegorz Bizon 31e8721a44 Fix scope of the CI config key nodes in jobs entry 2016-09-19 10:07:15 +02:00
Grzegorz Bizon 99f1385ee0 Restore validation of CI job environment name 2016-09-19 10:07:14 +02:00
Grzegorz Bizon 2ad7753d34 Fix CI job environment configuration attributes 2016-09-19 10:07:14 +02:00
Grzegorz Bizon 3fbfc30f5e Fix CI job environment configuration entry class 2016-09-19 10:07:14 +02:00
Kamil Trzcinski abfceb1e56 Cleanup changes 2016-09-19 10:07:14 +02:00
Kamil Trzcinski 6b97968745 Update support for dynamic environments 2016-09-19 10:07:13 +02:00
Kamil Trzcinski 08272ec151 Add validation of URL and validation of name 2016-09-19 10:07:12 +02:00
Grzegorz Bizon ba5bd3d1d6 Add new CI configuration entry for the environment 2016-09-19 10:07:12 +02:00
Kamil Trzcinski a4638dddf2 Add support for dynamic environments
Environments that can have a URL with predefined CI variables.
2016-09-19 10:05:35 +02:00
Rémy Coutable eb2d20665f Merge branch 'smart-pipeline-duration' into 'master'
Smartly calculate real running time and pending time

## What does this MR do?

Try to smartly calculate the running time and pending time for pipelines, instead of just use wall clock time from start to end. The algorithm is based on:

> Suppose we have A, B, and C jobs:

> * A: from 1 to 3
> * B: from 2 to 4
> * C: from 6 to 7

> The processing time should be accumulated from 1 to 4, and 6 to 7, totally 4, excluding retires, and calculate on `%w[success failed running canceled]` jobs (if a job is not finished yet, assume it's `Time.now`)

## Are there points in the code the reviewer needs to double check?

I would actually like to test `Gitlab::Ci::PipelineDuration#process_segments`, but it's a private method right now and it's not very convenient to test it. Is there a way to test it without changing the original code too much? Note that I would like to avoid saving merged segments because it's not used and should be garbage collected.

## Screenshots:

![Screen_Shot_2016-09-05_at_6.45.32_PM](/uploads/a82bfaf316661091e383b743a2f11334/Screen_Shot_2016-09-05_at_6.45.32_PM.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Added for this feature/bug

## What are the relevant issue numbers?

Closes #18260, #19804

See merge request !6084
2016-09-08 17:38:20 +00:00
Lin Jen-Shin 822efd5c3b Struct.new could take a block for defining methods, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15091858
2016-09-08 23:55:07 +08:00
Lin Jen-Shin 27a3f1182a Split try_merge_period into overlap? and merge:
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15083507
2016-09-08 21:49:17 +08:00
Lin Jen-Shin 61bc90af0e Be more specific since it's not needed to be generic now,
feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14995016
2016-09-06 19:57:51 +08:00
Lin Jen-Shin 7351c269de Sort by database, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991226
and
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14994233
2016-09-06 19:36:07 +08:00
Lin Jen-Shin 3a68c98973 Just use module because there's nothing to save, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14992064
2016-09-06 19:14:28 +08:00
Lin Jen-Shin b92c75ab98 Use sum, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991392
2016-09-06 18:12:46 +08:00
Lin Jen-Shin d071f61b0d Forget about pending duration for now, need more discussion 2016-09-05 17:55:30 +08:00
Grzegorz Bizon 2436631dea Merge branch 'master' into refactor/ci-config-add-logical-validation
* master: (414 commits)
  Remove suggested colors hover underline
  Fix markdown anchor icon interaction
  Fix expiration date picker after update
  Refactored code to rely less on IDs that could change
  Move CHANGELOG entry for !5858 from 8.11 to 8.12
  Hides merge request section in edit project when disabled
  Fix a typo
  Change minimum Unicorns required to two
  Update memory requirements
  Added `.term-bold` declaration.
  Change the inline code to codeblocks for the new features doc guideline
  Fix GitLab import button
  Rename behaviour to behavior in bug issue template for consistency
  Convert datetime coffeescript spec to ES6
  Align add button on repository view
  Update CHANGELOG with 8.11.4 entries.
  removed null return - renamed 'placeTop' to 'placeProfileAvatarsToTop'
  Refactor Ci::Build#raw_trace
  Move CHANGELOG entry to a proper version
  Change widths of content in MR pipeline tab
  ...

Conflicts:
	lib/gitlab/ci/config/node/jobs.rb
2016-09-03 09:35:21 +02:00
Lin Jen-Shin 7aaed299eb Just sum all the queuing time, indication for needing more runners 2016-09-02 23:43:10 +08:00
Lin Jen-Shin defd889905 Actually we still need to use total - running to get:
real pending time, because that's actually by definition,
(the time that it's not running!)
or we could end up with awfully complicated algorithm :(
2016-09-02 21:08:26 +08:00
Lin Jen-Shin 245103e888 Merge remote-tracking branch 'upstream/master' into smart-pipeline-duration
* upstream/master: (289 commits)
  Fix a typo
  Change minimum Unicorns required to two
  Update memory requirements
  Change the inline code to codeblocks for the new features doc guideline
  Update CHANGELOG with 8.11.4 entries.
  removed null return - renamed 'placeTop' to 'placeProfileAvatarsToTop'
  Change widths of content in MR pipeline tab
  Add curve to generic commit status pipeline
  Rubocop syntax 2.3
  Some minor updates for upgrade guides for 8.12.
  Remove inconsistent font weight for sidebar's labels
  Replace play icon font with svg
  Project tools visibility level
  Added todo filter tests
  Fixed project filtering
  Review changes, simplified dropdown init
  Removed select2 from todos feature spec
  Removed inline JS and improved dropdown labels
  Added type and action dropdowns, need to finalize by removing all inline and polishing off the selected dropdown states
  Completed project filter dropdown, still need to move it from inline to ProjectSelect.js (or different)
  ...
2016-09-02 19:33:19 +08:00
Lin Jen-Shin 39c090fecb Calculate real queueing time to exclude gaps from:
retries and probably also manual actions!

Feedback:

* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14735478
* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14737804
2016-09-02 19:15:42 +08:00
Lin Jen-Shin d2cfcb3ec1 Use guard clause, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14754681
2016-08-31 16:48:29 +08:00
Lin Jen-Shin 1e49a8bc6c Introduction to PipelineDuration 2016-08-31 03:09:16 +08:00
Lin Jen-Shin f10a1e331d Fix renaming 2016-08-30 23:11:57 +08:00
Lin Jen-Shin 2af2b78e49 Avoid shadowing method name. Just use existing method 2016-08-30 23:08:25 +08:00
Lin Jen-Shin 1f6efa352c Rename to periods since it's easier to understand 2016-08-30 23:06:29 +08:00
Lin Jen-Shin bd78e6af29 Use algorithm from Kamil:
Excluding sorting, this is O(n) which should be much faster and
much simpler and easier to understand.
2016-08-30 23:02:39 +08:00
Lin Jen-Shin 7e32e2ef20 build might not start yet 2016-08-30 02:53:53 +08:00
Lin Jen-Shin e9e7c3788d no builds no pending 2016-08-29 23:40:15 +08:00
Lin Jen-Shin ace0a005b8 Smartly calculate real running time and pending time 2016-08-29 20:24:48 +08:00
Grzegorz Bizon 1255205d89 Add method that returns commands for ci job entry 2016-08-29 13:11:35 +02:00
Grzegorz Bizon 62f704c5ad Make it possible to inherit global ci config nodes 2016-08-29 13:10:20 +02:00
Grzegorz Bizon 2991f93f2f Rename CI config hidden job entry to hidden entry 2016-08-29 09:30:48 +02:00
Grzegorz Bizon b125006517 Do not enforce using a hash with hidden ci key 2016-08-29 09:20:53 +02:00
Grzegorz Bizon 30f58cf392 Add [] method for accessing ci entry dependencies 2016-08-25 14:31:06 +02:00
Grzegorz Bizon 4f837f6690 Remove temporary stub method from ci config nodes 2016-08-25 13:58:46 +02:00
Grzegorz Bizon eaf211c2e3 Expose compose method in the ci config entry nodes 2016-08-25 13:49:15 +02:00
Grzegorz Bizon 700078e8e4 Rename unspecified and undefined CI config nodes 2016-08-25 11:37:45 +02:00
Grzegorz Bizon 6c704fd99e Inject dependencies into each CI config entry node 2016-08-25 11:37:45 +02:00
Grzegorz Bizon 57451f52cd Memoize CI config node validator to prevent leaks 2016-08-09 11:29:32 +02:00
Robert Speicher 34c083a184 Merge branch 'rubocop/enable-access-modifiers-cops' into 'master'
Enable Rubocop cops that check access modifiers

## What does this MR do?

This MR enables Rubocop cops that detect methods that should be restricted but are the part of public API because of access modifiers used improperly.

This also fixes existing offenses.

## Why was this MR needed?

Some method in our codebase are public instead of being private because it is sometimes difficult to get it right without static analysis.

## What are the relevant issue numbers?

See #17478  
Closes #17372 

See merge request !5014
2016-07-29 15:58:09 +00:00
Grzegorz Bizon a42cce1b96 Improve code, remove unused validator, improve names 2016-07-29 14:09:35 +02:00
Grzegorz Bizon dff10976da Move job dependencies entry to the new CI config 2016-07-20 14:15:18 +02:00
Grzegorz Bizon f83bccfe4f Add minor readability, style improvements in CI config 2016-07-20 14:02:09 +02:00
Grzegorz Bizon 795c9f2241 Merge branch 'master' into refactor/ci-config-move-job-entries
* master: (321 commits)
  Fix the Sentry spam from CSP violations by disabling it.
  Limit git rev-list output count to one in forced push check
  Ensure Owners are included in the scope for authorized_projects
  Fix alignment of icons on project page
  Fix ci_status_helper_spec to look for new SVGs
  use 2.0.5, actually (2.0.4 was a bad release)
  upgrade rouge to 2.0.4
  Fix help page paths to make sure shortcuts and the UI help page work.
  fixes an issue cause by a bad merge
  Vertically align status icon within table
  Add new icons for every CI status
  Add global style for running icon
  Align running icon in merge request
  Add new running icon; add a bunch of styles to get svg to match existing fa icons
  Improve code design
  Fix broken builds_for_ref
  Move when tests before to make it no conflict with manual-actions
  Use value of `yaml_variables` and `when` from config_processor if undefined
  Add CHANGELOG entry
  CHANGELOG item
  ...

Conflicts:
	lib/ci/gitlab_ci_yaml_processor.rb
	spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
2016-07-20 10:44:01 +02:00
Grzegorz Bizon d6f6697744 Enable Rubocop cops for invalid access modifiers
This enables following cops:

Check for useless access modifiers

  Lint/UselessAccessModifier

Checks for attempts to use `private` or `protected` to set the
visibility of a class method, which does not work.

  Lint/IneffectiveAccessModifier

This also disables two false possitives in concerns.
2016-07-19 15:12:15 +02:00
Grzegorz Bizon bb8bf6427d Move job environment validation to new CI config 2016-07-19 13:08:28 +02:00
Grzegorz Bizon 943ae747ea Move tags and allow_failure CI entries to new config 2016-07-18 16:33:20 +02:00
Grzegorz Bizon 6d466733a2 Validate allowed keys only in new CI config 2016-07-18 16:26:38 +02:00