Commit Graph

396 Commits

Author SHA1 Message Date
Lin Jen-Shin 63e03dada7 Make various trace methods take last_lines argument:
So that we could read last few lines rather than read
the entire file which could be huge.
2016-09-21 16:12:32 +08:00
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
Grzegorz Bizon 7cef4f1908 Improve valid keys validation for CI config nodes 2016-07-18 15:38:06 +02:00
Grzegorz Bizon 24b686ebb6 Move job artifacts configuration new CI config code 2016-07-18 15:21:53 +02:00
Grzegorz Bizon 47fa9f33ca Move job variables config entry to new CI config 2016-07-18 13:09:00 +02:00
Grzegorz Bizon 1bf9e34713 Move except and only job nodes to new CI config 2016-07-18 12:37:42 +02:00
Grzegorz Bizon 27e88efceb Move job image and services nodes to new CI config 2016-07-18 09:54:38 +02:00
Grzegorz Bizon 17084d42aa Simplify abstract class for CI config entry nodes 2016-07-15 22:49:18 +02:00
Grzegorz Bizon 4bb60b0789 Simplify CI config and remove logical validation 2016-07-15 21:39:26 +02:00
Grzegorz Bizon 41bcbdd8c2 Add metadata to new CI config and expose job name 2016-07-15 21:07:51 +02:00
Grzegorz Bizon 615c9730e7 Remove job cache configfrom legacy yaml processor 2016-07-14 16:01:18 +02:00
Grzegorz Bizon 5923741fe6 Remove references to global entry in new CI config 2016-07-14 15:45:29 +02:00
Grzegorz Bizon 3e16b015b9 Revert logical validation in CI job stage entry 2016-07-14 15:45:07 +02:00
Grzegorz Bizon f7c80e9f31 Revert references to global node in CI job entry 2016-07-14 15:07:38 +02:00
Grzegorz Bizon 56ae9f6ba9 Improve CI job entry validations in new config 2016-07-14 13:14:09 +02:00
Grzegorz Bizon 036e297ca3 Expose CI job commands and use in legacy processor 2016-07-13 15:04:12 +02:00
Grzegorz Bizon 6920390aad Add before script and commands to CI job entry 2016-07-13 14:38:10 +02:00
Grzegorz Bizon 097550f08a Fabricate CI entry with value, set attributes later 2016-07-13 13:42:57 +02:00
Grzegorz Bizon de4c9a2738 Improve CI stage configuration entry validations 2016-07-13 12:22:33 +02:00
Grzegorz Bizon b228787f5a Do not raise when getting value of invalid CI node 2016-07-12 14:58:48 +02:00
Grzegorz Bizon 61f7bede79 Fix using `try` on delegators in CI config entries
See:

af53280a4b
2016-07-12 14:40:51 +02:00
Grzegorz Bizon 06641a3fee Simplify undefined node definition in CI config 2016-07-12 14:28:50 +02:00
Grzegorz Bizon d41d330147 Add CI config node that is unspecified null entry 2016-07-12 13:03:19 +02:00
Grzegorz Bizon 8c9c3eda7a Prevalidate CI entries recursively on processed 2016-07-12 12:56:21 +02:00
Grzegorz Bizon 80587064eb Require parent when using node factory in CI config 2016-07-10 20:59:18 +02:00
Grzegorz Bizon 8f7c98ee2a Rename CI config job script entry node to commands 2016-07-10 20:26:37 +02:00
Grzegorz Bizon 500b61e14f Move after script CI job confg to new processor 2016-07-10 14:41:14 +02:00
Grzegorz Bizon 489e9be4e8 Add CI job script node in new config processor 2016-07-10 14:35:53 +02:00
Grzegorz Bizon 3c5b1da2a1 Add before_script node to CI job entry config 2016-07-10 13:54:39 +02:00
Grzegorz Bizon 2480701436 Extend CI job entries fabrication and validation 2016-07-09 18:43:26 +02:00
Grzegorz Bizon a80a01e841 Add comment for deprecated CI config `types` entry 2016-07-09 17:38:03 +02:00
Grzegorz Bizon 9edced40dd Use node factory to assemble global CI config entry 2016-07-09 16:51:26 +02:00
Grzegorz Bizon ccbdb4022a Integrate CI job stage entry into CI configuration 2016-07-09 14:56:41 +02:00
Grzegorz Bizon 1b624ba4eb Improve name of CI entry validation context hook 2016-07-08 13:36:01 +02:00
Grzegorz Bizon d9142f2c97 Add CI config known stage validation for job stage 2016-07-08 13:31:41 +02:00
Grzegorz Bizon 1ac62de2c1 Extract CI entry node validator and improve naming 2016-07-08 12:51:47 +02:00
Grzegorz Bizon 159aed1c42 Extract global CI config entry configuration setup 2016-07-08 11:29:03 +02:00
Grzegorz Bizon 8baee987be Extract internal attributes validator for CI entry 2016-07-08 11:27:36 +02:00
Grzegorz Bizon 3da57c800b Require reference to CI config for some entries 2016-07-07 15:15:44 +02:00
Grzegorz Bizon f067202e9b Improve creating CI config entries for jobs config 2016-07-07 15:10:39 +02:00
Grzegorz Bizon a7ac2f7494 Simplify CI config entry node factory, use attribs 2016-07-07 15:00:35 +02:00
Grzegorz Bizon 9410aecca8 Add scaffold of CI config for the job stage entry 2016-07-07 13:40:01 +02:00
Grzegorz Bizon ecdcf04e88 Add undefined CI node strategies to handle defaults 2016-07-07 13:17:50 +02:00
Grzegorz Bizon de8b93bbff Improve validation of CI config entry if composite 2016-07-07 12:56:00 +02:00
Grzegorz Bizon fea7762485 Delegate methods to default CI entry if undefined 2016-07-07 12:55:10 +02:00
Grzegorz Bizon b0ae0d730f Use only node factory to create CI config entries 2016-07-07 10:23:47 +02:00
Grzegorz Bizon 4491bf28e1 Move CI job config validations to new classes 2016-07-06 14:08:19 +02:00
Grzegorz Bizon b1b0c18b8c Add hidden job in new CI config that is irrelevant 2016-07-06 12:58:43 +02:00
Grzegorz Bizon dbab56a951 Create composite job entries in new CI config 2016-07-05 14:48:17 +02:00
Grzegorz Bizon 6ae80732bb Add ability to define nodes in new CI config entry 2016-07-05 14:17:09 +02:00
Grzegorz Bizon e00ae9a877 Add new CI config entry for single job in pipeline 2016-07-05 14:05:07 +02:00
Grzegorz Bizon 5b7f211cbb Add new CI config entry that holds jobs definition 2016-07-05 13:35:50 +02:00
Grzegorz Bizon 9686a4f2b2 Remove code creating job hash from legacy CI config 2016-07-05 13:19:22 +02:00
Grzegorz Bizon cf53d79873 Extract jobs config to separate key in config hash 2016-07-05 13:07:03 +02:00
Grzegorz Bizon bfad4c61f1 Add minor improvements in readability in CI config 2016-07-04 18:36:06 +02:00
Grzegorz Bizon eb151e77ff Extract CI configuration entry node factory method 2016-07-04 11:29:59 +02:00
Grzegorz Bizon b4f03e8b1e Improve description of CI types node and in specs 2016-06-30 12:59:17 +02:00
Grzegorz Bizon 7ef11ce3de Explicitly define entry node class in new CI config 2016-06-29 12:20:45 +02:00
Grzegorz Bizon c8c930f3ff Add CI config entry validator for allowed keys 2016-06-29 11:01:26 +02:00
Grzegorz Bizon b85d4969a9 Return compound value if CI config node is composite 2016-06-29 10:02:02 +02:00
Grzegorz Bizon 7759242ae5 Move global CI cache configuration to new CI classes 2016-06-29 09:49:46 +02:00
Grzegorz Bizon f4421817de Add global cache config entry to new CI config 2016-06-29 09:48:52 +02:00
Grzegorz Bizon 92312786f1 Add CI config entry location info to error message
This CI config entry location in configuration Hash.
2016-06-29 09:17:42 +02:00
Grzegorz Bizon 7c511c2f55 Make it possible to set parent in CI config node 2016-06-29 09:05:14 +02:00
Grzegorz Bizon c019585cb8 Validate interface only with CI node validator 2016-06-27 14:16:57 +02:00
Grzegorz Bizon 56e88b8c28 Add new ci config entry that handles cache config 2016-06-27 14:01:12 +02:00
Grzegorz Bizon ce4478ed86 Add ci config entry that represents array of paths 2016-06-24 09:54:52 +02:00
Grzegorz Bizon e017e1b629 Add ci config class that represents a boolean value 2016-06-24 09:49:54 +02:00
Grzegorz Bizon 04ece6664a Add ci config class that represents a key value 2016-06-24 08:58:09 +02:00
Grzegorz Bizon 1f320edb77 Minor refactorings in new CI configuration classes 2016-06-23 13:51:34 +02:00
Grzegorz Bizon 29b96d92c1 Move CI stages configuration to new CI config 2016-06-23 13:51:07 +02:00
Grzegorz Bizon 2240807c1a Assume that unspecified CI config is undefined
We assume that when someone adds a key for the configuration entry, but
does not provide a valid value, which causes entry to be `nil`, then
entry should be considered as the undefined one. We also assume this is
semantically correct, this is also backwards compatible with legacy CI
config processor.

See issue #18775 for more details.
2016-06-23 10:22:41 +02:00
Grzegorz Bizon bc2348f2e4 Return default config value when entry is undefined 2016-06-22 14:26:33 +02:00
Grzegorz Bizon 05ce8a1187 Handle CI environment variables in a new CI config 2016-06-22 11:22:53 +02:00
Grzegorz Bizon 04ecfca386 Rename CI config null node entry to undefined node 2016-06-22 10:44:33 +02:00
Grzegorz Bizon 97ec24f0b0 Return CI entry config as value by default 2016-06-21 13:12:58 +02:00
Grzegorz Bizon d399128955 Handle after script CI config in new classes
This also makes Script to return an array of commands instead of
concatented command, which is our current direction.
2016-06-21 13:02:14 +02:00
Grzegorz Bizon fc00c545b2 Handle CI services config in new CI config classes 2016-06-21 12:40:52 +02:00
Grzegorz Bizon cd6a2afbbb Move CI image configuration entry to new CI config 2016-06-21 12:10:13 +02:00
Grzegorz Bizon 8b550db33e Add image configuration entry to new ci config 2016-06-21 11:47:05 +02:00
Grzegorz Bizon c91298d554 Use generic type validator in new ci configuration 2016-06-21 11:43:32 +02:00
Grzegorz Bizon 9510d31b4d Merge branch 'master' into refactor/ci-config-add-entry-error
* master: (345 commits)
  use rails root join
  fixed a couple of errors spotted in production
  Fix RangeError exceptions when referring to issues or merge requests outside of max database values
  Fix bug in `WikiLinkFilter`.
  Small frontend code fixes and restore 8a2d88f commit
  Warn about admin privilege to disable GitHub Webhooks
  Listing GH Webhooks doesn't stop import process for non GH admin users
  fixup! updated docs for api endpoint award emoji
  Update CHANGELOG
  Ensure Todos counters doesn't count Todos for projects pending delete
  Add endpoints for award emoji on notes
  Sort API endpoints and implement feedback
  Add endpoints for Award Emoji
  Fixed issue with assignee dropdown not selecting correctly
  Removed update method Re-structured controller spec Renamed issuable param to issuable_id
  Fix clibpoard buttons on "Check out branch" modal.
  Track method call times/counts as a single metric
  Cache todo counters (pending/done)
  Fix a 'wrong number of arguments' error
  Added missing mount point for Sidekiq Metrics API, after it got lost on rebase.
  ...
2016-06-20 10:38:46 +02:00
Grzegorz Bizon 44b00a1ebb Extract CI entry config hash validation to validator 2016-06-17 15:02:39 +02:00
Grzegorz Bizon 2a87a55f87 Merge branch 'master' into refactor/ci-config-add-entry-error
* master: (189 commits)
  Update CHANGELOG for !4659
  Center the header logo for all Devise emails
  Add previews for all customized Devise emails
  Customize the Devise `unlock_instructions` email
  Customize the Devise `reset_password_instructions` email
  Customize the Devise `password_change` emails
  Use gitlab-git 10.2.0
  Use Git cached counters on project show page
  Fix indentation scss-lint errors
  Added title attribute to enties in tree view Closes #18353
  Banzai::Filter::ExternalLinkFilter use XPath
  Reduce queries in IssueReferenceFilter
  Use gitlab_git 10.1.4
  Fixed ordering in Project.find_with_namespace
  Fix images in emails
  Banzai::Filter::UploadLinkFilter use XPath
  Turn Group#owners into a has_many association
  Make project_id nullable
  ...
2016-06-17 12:25:43 +02:00
Grzegorz Bizon d9ca84015c Add first custom validator for new ci config
This follows a standard `ActiveModel` pattern of creating a custom
validators. We use `ActiveModel::EachValidator` here that reuses methods
provided by `LegacyValidationHelpers`.

We will remove `LegacyValidationHelpers` on some point in the future, at
the later stages of CI configuration refactoring. It may be possible
to rewrite custom validators to use format like:

`validates :config, array_of: String`
2016-06-17 12:06:48 +02:00
Grzegorz Bizon a9bd16bd0a Rename legacy validation helpers for new ci config 2016-06-17 11:55:55 +02:00
Kamil Trzcinski aef6214c42 Validate only and except regexp
Currently the RegexpError can be raised when processing next stage which leads to 500 in different places of code base.
This adds early check that regexps used in only and except are valid.
2016-06-17 11:52:22 +02:00
Grzegorz Bizon 002e6ed1f0 Improve CI config entries validations prototype 2016-06-17 11:23:16 +02:00
Grzegorz Bizon 95520dfc72 Add prototype of CI config node validator
This makes use of `ActiveModel::Validations` encapsulated in a separate
class that is accessible from a node object.
2016-06-16 15:46:03 +02:00
Grzegorz Bizon 76aea978c6 Add class that encapsulates error in new Ci config 2016-06-15 14:09:21 +02:00
Kamil Trzcinski 006b650988 Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
#	db/schema.rb
2016-06-14 16:19:29 +02:00
Kamil Trzcinski 975e388751 Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
#	lib/ci/gitlab_ci_yaml_processor.rb
2016-06-14 14:53:10 +02:00
Kamil Trzcinski 3f5819fb7a Merge remote-tracking branch 'origin/master' into artifacts-expire-date 2016-06-14 14:49:59 +02:00
Grzegorz Bizon 30e946ce8a Validate ci config entry value before processing nodes 2016-06-14 11:28:20 +02:00
Grzegorz Bizon 59eeec3ff8 Make method that composes ci config entry private 2016-06-14 10:48:51 +02:00
Grzegorz Bizon 11c0d02283 Simplify ci config node factory 2016-06-13 09:58:35 +02:00
Grzegorz Bizon 7c8f3b0cfc Duplicate CI config node factory on class level 2016-06-13 08:50:12 +02:00
Grzegorz Bizon cc373a3550 Add factory for fabricating new ci config nodes 2016-06-10 14:01:07 +02:00
Grzegorz Bizon 5abfc7fa71 Define ci entry accessor instead of method_missing 2016-06-10 11:32:49 +02:00
Grzegorz Bizon 12080ba150 Simplify new ci config entry class interface 2016-06-10 11:26:03 +02:00
Grzegorz Bizon 828a15bccd Rename method used to allow node in Ci config 2016-06-10 10:49:47 +02:00
Grzegorz Bizon d7e1251161 Rename method that returns allowed nodes in Ci config 2016-06-09 14:59:59 +02:00
Grzegorz Bizon 99ee39bf6c Add comments to new CI config classes and modules 2016-06-09 13:15:54 +02:00
Grzegorz Bizon 20ccd4465b Do not require Ci config node to have a hash value 2016-06-09 12:35:24 +02:00
Grzegorz Bizon 6a319fd287 Make it possible configure Ci entry description 2016-06-09 10:53:56 +02:00
Grzegorz Bizon d9d5042fd9 Extract method that composes new Ci config entry 2016-06-09 10:28:44 +02:00
Grzegorz Bizon 33cd090b93 Move new Ci config configurable DSL to concern 2016-06-09 10:08:49 +02:00
Grzegorz Bizon 48a59c1a8b Rename BeforeScript to Script in new Ci config 2016-06-08 13:22:39 +02:00
Grzegorz Bizon 5065612a0a Add minor improvements in new Ci config design 2016-06-08 13:01:44 +02:00
Grzegorz Bizon 87fe50f2a0 Delegate Ci config entry value to single method 2016-06-08 12:32:56 +02:00
Grzegorz Bizon 2b48da22ca Merge branch 'master' into refactor/ci-config-add-global-entry
* master: (285 commits)
  Bump recaptcha gem to 3.0.0 to remove deprecated stoken support
  Load knapsack in Rakefile only when is bundled
  Add License Finder information to contribution acceptance criteria.
  Add LGPLv2 to license whiltelist
  Instrument `RepositoryCheck::SingleRepositoryWorker` manually
  Bump nokogiri to 1.6.8
  Fix alignment of wiki top area
  Update charcoal theme colors
  Update nav link font size and spacing; fix hamburger icon
  Fix control btn position
  Remove todos count tests in nav
  Test impersonation using img data attribute instead of username
  Implement compact side nav
  Fix knapsack for master
  Align links and tabs
  Add scrolling tabs to code subnav
  Finish styling sub nav
  Updated colors
  Fixed failing tests
  CHANGELOG item
  ...

Conflicts:
	lib/gitlab/ci/config.rb
	spec/lib/gitlab/ci/config_spec.rb
2016-06-08 11:38:56 +02:00
Grzegorz Bizon 70bda3e89b Implement script in Ci config and use in legacy one 2016-06-07 14:23:47 +02:00
Grzegorz Bizon c2d6d61dac Add DSL for adding nodes in Ci config interface 2016-06-07 13:20:07 +02:00
Grzegorz Bizon df25c19699 Use Ci config validation helpers only where needed 2016-06-07 12:58:32 +02:00
Grzegorz Bizon 5ef104df59 Improve Ci config loader by changing method signature 2016-06-07 12:53:46 +02:00
Grzegorz Bizon 6bd67f5212 Do not process new Ci config entry when invalid 2016-06-07 12:48:26 +02:00
Grzegorz Bizon e8f995ef26 Pass root Ci config entry to each subsequent entry 2016-06-07 12:13:22 +02:00
Grzegorz Bizon 69a3755c5a Add Ci config entry that implements Null Object 2016-06-07 11:58:02 +02:00
Grzegorz Bizon b95c60a071 Do not process Ci config node when node is a leaf 2016-06-07 11:26:39 +02:00
Grzegorz Bizon fa097c678c Remove duplicated exception in Ci config
This is a temporary refactoring stub, that is planned to be removed
after removing legacy config processor.
2016-06-07 10:26:38 +02:00
Grzegorz Bizon 940763e0e7 Use CI config errors from new processor in legacy one 2016-06-06 20:56:58 +02:00
Grzegorz Bizon a3c0745514 Collect errors from all nodes in new CI config 2016-06-06 11:59:25 +02:00
Grzegorz Bizon 6dbd1c86a8 Validate new before script CI configuration entry 2016-06-06 11:33:45 +02:00
Grzegorz Bizon 251dd571df Extract CI config validation helpers to mixin 2016-06-06 11:05:15 +02:00
Grzegorz Bizon 8048dcc8e6 Implement CI configuration nodes tree processing 2016-06-06 10:43:11 +02:00
Grzegorz Bizon 7f2f683eeb Rename ci config module that holds nodes to Node 2016-06-06 09:24:16 +02:00
Grzegorz Bizon 6609589b93 Add ci config global and before_script entries 2016-06-06 09:05:00 +02:00
Grzegorz Bizon 23030439c2 Rename class that loads CI configuration to Loader 2016-06-06 08:20:55 +02:00
Grzegorz Bizon d2b708ac43 Extract CI config YAML parser to a separate class
With this approach it would be easier to add different sources of
configuration, that we do not necessairly have to be in YAML format.
2016-06-03 21:10:50 +02:00
Grzegorz Bizon d501850e05 Add gitlab ci configuration class that holds hash
As for now, we keep this class inside a oryginal config processor class.
We will move implementation to this class and delegate to it from
current config processor.

After original gitlab ci yaml processor not longer has relevant
impelemntation we will replace it with new configuration class.
2016-06-03 14:20:34 +02:00
Grzegorz Bizon 0ea017d997 Enable Style/WhileUntilDo rubocop style cop
See #17478
2016-05-30 11:37:14 +02:00
Kamil Trzcinski 9b0f57781e Add method that calculates total size for artifacts subfolder 2016-01-20 21:55:13 +01:00
Grzegorz Bizon be764a3a20 Minor improvements in build arfifacts browser
Added also a `Gitlab::Ci::Build::Artifacts::Metadata::ParserError`
exception class.
2016-01-14 12:48:17 +01:00
Grzegorz Bizon 0d6e7b9d3d Use Hash to store paths and entries metadata in artifacts browser 2016-01-14 12:48:17 +01:00
Grzegorz Bizon ad2b0358e0 Improve readability of artifacts `Metadata` related code 2016-01-14 12:48:17 +01:00
Grzegorz Bizon 6b0a43aff3 Improve readability of artifacts browser `Entry` related code 2016-01-14 12:48:17 +01:00
Grzegorz Bizon 3f0c18f80e Simplify encoding related implementation in artifacts metadata 2016-01-14 12:48:17 +01:00
Grzegorz Bizon a9783c439b Make encoding of paths returned by metadata consistent (UTF-8) 2016-01-14 12:48:16 +01:00
Grzegorz Bizon 487b0a026f Improvements, readability for artifacts browser 2016-01-14 12:48:16 +01:00
Grzegorz Bizon 2be76355ca Support only valid UTF-8 paths in build artifacts browser 2016-01-14 12:48:16 +01:00
Grzegorz Bizon ffee05c242 Improve invalid build artifacts metadata path matcher 2016-01-14 12:48:16 +01:00
Grzegorz Bizon 09a4a5aff8 Render only valid paths in artifacts metadata
In this version we will support only relative paths in artifacts
metadata. Support for absolute paths will be introduced later.
2016-01-14 12:48:16 +01:00
Grzegorz Bizon 61fb47a432 Simplify implementation of build artifacts browser (refactoring) 2016-01-14 12:48:15 +01:00
Grzegorz Bizon 387b27813d Change format of artifacts metadata from text to binary 0.0.1
This changes the format of metadata to handle paths, that may contain
whitespace characters, new line characters and non-UTF-8 characters.

Now those paths along with metadata in JSON format are stored as
length-prefixed strings (uint32 prefix).

Metadata file has a custom format:

1.   First string field is metadata version field (string)
2.   Second string field is metadata errors field (JSON strong)
3.   All subsequent fields is pair of path (string) and path metadata
     in JSON format.

Path's metadata contains all fields that where possible to extract from
ZIP archive like date of modification, CRC, compressed size,
uncompressed size and comment.
2016-01-14 12:48:15 +01:00
Grzegorz Bizon 1b1793c253 Show file size in artifacts browser using metadata 2016-01-14 12:48:15 +01:00
Grzegorz Bizon a5e1905d28 Render 404 when artifacts path is invalid 2016-01-14 12:48:15 +01:00
Grzegorz Bizon a7f99b67a0 Extract artifacts metadata implementation to separate class 2016-01-14 12:48:15 +01:00