Commit Graph

733 Commits

Author SHA1 Message Date
Grzegorz Bizon 52b34969a5 Add build policy for pipeline expressions 2018-02-28 13:08:42 +01:00
Grzegorz Bizon 1926eca04d Add method that checks if pipeline expression is truthy 2018-02-28 12:10:32 +01:00
Grzegorz Bizon 64e86dab62 Allow using an empty string with pipeline expressions 2018-02-28 12:06:50 +01:00
Grzegorz Bizon 8a7c89adfb Use pipeline runtime variables in expressions 2018-02-28 11:37:23 +01:00
Grzegorz Bizon 6eeb837f3d Merge branch 'feature/gb/pipeline-variable-expressions' into feature/gb/variables-expressions-in-only-except
* feature/gb/pipeline-variable-expressions:
  Do not use keyword args to pass expression variables
2018-02-28 10:54:16 +01:00
Grzegorz Bizon c52255884e Add support for only/except: variables CI/CD config 2018-02-28 10:50:02 +01:00
Grzegorz Bizon 886988c9e1 Do not use keyword args to pass expression variables 2018-02-27 12:36:30 +01:00
Grzegorz Bizon 3938d1c3a0 Robustify pipeline expressions nodes parser 2018-02-27 10:39:35 +01:00
Grzegorz Bizon bd17ff3d52 Improve null lexeme in pipeline expressions 2018-02-27 10:30:55 +01:00
Grzegorz Bizon 85333aed42 Add support for single quoted string in pipeline expressions 2018-02-27 10:27:22 +01:00
Grzegorz Bizon 76cf6c6a7b Remove unused method from base expression lexeme class 2018-02-23 11:25:03 +01:00
Grzegorz Bizon 84c14a4ac2 Add missing specs for pipeline expression lexemes 2018-02-23 11:23:18 +01:00
Grzegorz Bizon 227e18ea43 Add support for evaluating pipeline expression variables 2018-02-23 10:41:10 +01:00
Grzegorz Bizon 8c7374cafc Add operator / value types in pipeline expressions 2018-02-23 10:13:43 +01:00
Grzegorz Bizon 8517627410 Move pipeline expression lexemes to a separate module 2018-02-23 10:01:27 +01:00
Grzegorz Bizon 5ee43097fd Simplify pipelines expression parser 2018-02-23 09:52:34 +01:00
Grzegorz Bizon 6fe4d2c6f0 Build a recursive parser for pipeline expressions 2018-02-22 16:04:18 +01:00
Grzegorz Bizon 867a4f68cb Extract pipeline expressions parser to a separate class 2018-02-22 13:54:22 +01:00
Grzegorz Bizon b92ce0ccb6 Rename pipeline expressions statement exception class 2018-02-22 13:33:36 +01:00
Grzegorz Bizon d532a9cb2f Add variables to pipeline expressions evaluator 2018-02-21 16:54:29 +01:00
Grzegorz Bizon 35354826b1 Improve pipeline expressions specs and freeze constants 2018-02-21 14:55:35 +01:00
Grzegorz Bizon e6498efe0a Make pipeline variables evaluation concept explicit 2018-02-21 14:17:01 +01:00
Grzegorz Bizon 2da569a229 Simplify evaluating pipeline expressions 2018-02-21 14:15:20 +01:00
Grzegorz Bizon 890df1b1f0 Add code that evaluates pipelines expressions 2018-02-21 14:09:43 +01:00
Grzegorz Bizon 2c4aa50463 Implement pipeline expressions parser 2018-02-21 13:38:37 +01:00
Grzegorz Bizon cee3be29ec Add a lexeme for a string pipeline expression 2018-02-21 12:51:56 +01:00
Grzegorz Bizon 9954928cce Implement pipeline expressions lexer 2018-02-21 12:37:55 +01:00
Grzegorz Bizon 523b84d432 Move pipeline expressions grammar from lexer to parser 2018-02-21 10:55:05 +01:00
Grzegorz Bizon 4e9f017ea7 Rename tokens to lexemes in pipeline expressions 2018-02-21 10:53:37 +01:00
Grzegorz Bizon 2125d6fa02 Add basic pipeline expressions grammar definition 2018-02-21 10:52:08 +01:00
Grzegorz Bizon 49cad30daf Add a null token to pipelines expressions 2018-02-21 10:48:58 +01:00
Grzegorz Bizon fa2a546836 Rename pipeline expressions token for checking equality 2018-02-21 10:47:26 +01:00
Grzegorz Bizon 7c6063dda2 Add a base class for pipeline expressions tokens 2018-02-20 15:11:14 +01:00
Grzegorz Bizon 34bebde866 Add base classes to evaluate variables expressions 2018-02-20 15:06:49 +01:00
Grzegorz Bizon 4efcc0618c Add pipeline expression statement class 2018-02-16 13:13:23 +01:00
Kamil Trzciński ead97c55ea Merge branch '41209-ci-linter-fails-on-gitlab-ci-blob-viewer' into 'master'
Resolve "CI linter fails to work"

Closes #41209

See merge request gitlab-org/gitlab-ce!16922
2018-02-07 13:09:56 +00:00
Dylan Griffith 66d41d2c22 Handle all YAML parser exceptions in .gitlab-ci.yml (fixes #41209)
- Move the exception handling as close to the source as possible to
avoid leaking Psych ahstraction
- Also remove unnecessary rescue all statement from LintsController.
This should not be necessary anymore since any YAML errors should all be
caught by the #validation_message method.
2018-02-07 10:09:01 +11:00
Shinya Maeda abc64da90c Rename CreateArtifactsTraceService to CreateTraceArtifactService 2018-02-06 15:50:08 +09:00
Shinya Maeda 62e257f53a Revert live-trace path 2018-02-06 15:50:08 +09:00
Shinya Maeda 5f6d826165 Add CreateArtifactsTraceWorker 2018-02-06 15:50:08 +09:00
Shinya Maeda 002f314f32 Expose current_path 2018-02-06 15:50:08 +09:00
Shinya Maeda b969250106 Check existance of the file when trace_artifact is read 2018-02-06 15:50:07 +09:00
Shinya Maeda 1d983024db Move default_path to legacy_default_path. Switch to the new path for live-trace 2018-02-06 15:50:07 +09:00
Shinya Maeda 8a89efd87a Remove unnecessary changes 2018-02-06 15:50:07 +09:00
Shinya Maeda 63a9d582aa Trace as artifacts 2018-02-06 15:50:07 +09:00
Takuya Noguchi 2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Oswaldo Ferreira f351cc28c2 Merge branch 'sh-backport-10-3-4-security-fixes' into 'master'
Backport 10.3.4 security fixes into master

See merge request gitlab-org/gitlab-ce!16509
2018-01-17 20:26:59 +00:00
Robert Speicher 954a44574f Merge branch 'ac/fix-path-traversal' into 'security-10-3'
[10.3] Fix path traversal in gitlab-ci.yml cache:key

See merge request gitlab/gitlabhq!2270

(cherry picked from commit c32d0c6807dfd41d7838a35742e6d0986871b389)

df29094a Fix path traversal in gitlab-ci.yml cache:key
2018-01-16 17:04:38 -08:00
Grzegorz Bizon c0e9a46dd5 Fix running manual action tooltip 2018-01-16 12:22:09 +01:00
Lin Jen-Shin 4f00a05152 Introduce PredicateMemoization cop and fix offenses
with StrongMemoize
2018-01-12 17:54:55 +08:00
🙈 jacopo beschi 🙉 729f05f0e3 Adds Rubocop rule for line break around conditionals 2018-01-11 16:34:01 +00:00
Danny 57a490ec19 fix issue #37843 2018-01-03 20:57:41 +00:00
Rémy Coutable a2d39b8010 Use gitlab-styles
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-22 08:34:44 -06:00
Lin Jen-Shin 59ac184fcf Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (671 commits)
  Make rubocop happy
  Use guard clause
  Improve language
  Prettify
  Use temp branch
  Pass info about who started the job and which job triggered it
  Docs: add indexes for monitoring and performance monitoring
  clearer-documentation-on-inline-diffs
  Add docs for commit diff discussion in merge requests
  sorting for tags api
  Clear BatchLoader after each spec to prevent holding onto records longer than necessary
  Include project in BatchLoader key to prevent returning blobs for the wrong project
  moved lfs_blob_ids method into ExtractsPath module
  Converted JS modules into exported modules
  spec fixes
  Bump gitlab-shell version to 5.10.3
  Clear caches before updating MR diffs
  Use new Ruby version 2.4 in GitLab QA images
  moved lfs blob fetch from extractspath file
  Update GitLab QA dependencies
  ...
2017-12-15 17:14:26 +08:00
Kamil Trzcinski b5f6a5f91f Add Chain::Command specs 2017-12-08 12:01:15 +01:00
Kamil Trzcinski 865341acf8 Fix a bug of before_sha being inproperly evaluated to `checkout_sha` 2017-12-08 12:01:15 +01:00
Kamil Trzcinski ad3be46b9f Implement and use Gitlab::Ci::Pipeline::Chain::Command 2017-12-08 12:01:15 +01:00
Grzegorz Bizon b30e0e0691 Fix invalid pipeline build chain tag evaluation 2017-12-08 10:50:10 +01:00
Grzegorz Bizon be12f3ed24 Update pipeline create chain Prometheus metric 2017-12-07 10:27:07 +01:00
Grzegorz Bizon 5ccced6312 Move invalid builds counter out of the transaction 2017-12-06 15:30:20 +01:00
Grzegorz Bizon 382a1ef453 Add invalid builds counter metric to stage seeds class 2017-12-06 15:12:04 +01:00
Grzegorz Bizon 9737f582a1 Reduce pipeline chain life span to minimize side effects 2017-12-04 14:02:56 +01:00
Grzegorz Bizon 5df4ba0a93 Merge branch 'master' into backstage/gb/build-pipeline-in-a-separate-class
* master: (1794 commits)
2017-11-30 12:52:04 +01:00
Lin Jen-Shin 663593e87e Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (126 commits)
  Update VERSION to 10.3.0-pre
  Update CHANGELOG.md for 10.2.0
  default fill color for SVGs
  ignore hashed repos (for now) when using `rake gitlab:cleanup:repos`
  Use Redis cache for branch existence checks
  Update CONTRIBUTING.md: Link definition of done to criteria
  Use `make install` for Gitaly setups in non-test environments
  FileUploader should check for hashed_storage?(:attachments) to use disk_path
  Set the default gitlab-shell timeout to 3 hours
  Update composite pipelines index to include "id"
  Use arrays in Pipeline#latest_builds_with_artifacts
  Fix blank states using old css
  Skip confirmation user api
  Custom issue tracker
  Revert "check for `read_only?` first before seeing if request is disallowed"
  add `#with_metadata` scope to remove a N+1 from the notes' API
  Fix promoting milestone updating all issuables without milestone
  Batchload blobs for diff generation
  check for `read_only?` first before seeing if request is disallowed
  use `Gitlab::Routing.url_helpers` instead of `Rails.application.routes.url_helpers`
  ...
2017-11-22 17:07:01 +08:00
Lin Jen-Shin 07d3d44775 Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
2017-11-22 17:06:57 +08:00
Lin Jen-Shin 45568bed36 Updates based on feedback 2017-11-22 00:59:38 +08:00
Lin Jen-Shin 9ac0c76b78 Use StrongMemoize and enable/disable cops properly 2017-11-18 01:01:53 +08:00
Lin Jen-Shin 0af35d7e30 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (507 commits)
  Add dropdowns documentation
  Convert migration to populate latest merge request ID into a background migration
  Set 0.69.0 instead of latest for codeclimate image
  De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb
  Update database_debugging.md
  Update database_debugging.md
  Move installation of apps higher
  Change to Google Kubernetes Cluster and add internal links
  Add Ingress description from official docs
  Add info on creating your own k8s cluster from the cluster page
  Add info about the installed apps in the Cluster docs
  Resolve "lock/confidential issuable sidebar custom svg icons iteration"
  Update HA README.md to clarify GitLab support does not troubleshoot DRBD.
  Update license_finder to 3.1.1
  Make sure NotesActions#noteable returns a Noteable in the update action
  Cache the number of user SSH keys
  Adjust openid_connect_spec to use `raise_error`
  Resolve "Clicking on GPG verification badge jumps to top of the page"
  Add changelog for container repository path update
  Update container repository path reference
  ...
2017-11-17 19:19:06 +08:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Tim Zallmann a97cd2906e Fixed Status Warning Icon 2017-11-06 15:59:07 +01:00
Lin Jen-Shin f8b681f6e9 WIP 2017-11-06 22:40:19 +08:00
Lin Jen-Shin fc6aad0b44 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (1723 commits)
  Resolve "Editor icons"
  Refactor issuable destroy action
  Ignore routes matching legacy_*_redirect in route specs
  Gitlab::Git::RevList and LfsChanges use lazy popen
  Gitlab::Git::Popen can lazily hand output to a block
  Merge branch 'master-i18n' into 'master'
  Remove unique validation from external_url in Environment
  Expose `duration` in Job API entity
  Add TimeCop freeze for DST and Regular time
  Harcode project visibility
  update a changelog
  Put a condition to old migration that adds fast_forward column to MRs
  Expose project visibility as CI variable
  fix flaky tests by removing unneeded clicks and focus actions
  fix flaky test in gfm_autocomplete_spec.rb
  Use Gitlab::Git operations for repository mirroring
  Encapsulate git operations for mirroring in Gitlab::Git
  Create a Wiki Repository's raw_repository properly
  Add `Gitlab::Git::Repository#fetch` command
  Fix Gitlab::Metrics::System#real_time and #monotonic_time doc
  ...
2017-11-06 21:44:57 +08:00
Tim Zallmann 4731eba4c3 Update Action Icons 2017-10-30 10:27:46 +01:00
Tim Zallmann e3c7d26425 Updated also Badge + Dropdown Icons 2017-10-30 10:27:46 +01:00
Grzegorz Bizon eedf43d69b Set pipeline config source attribute in a build step 2017-10-11 14:48:28 +02:00
Grzegorz Bizon 9ad48a7438 Extract class responsible for building a pipeline 2017-10-09 13:07:55 +02:00
Kamil Trzciński 5ee20b6375 Merge branch 'master' into '37970-ci-sections-tracking'
# Conflicts:
#   db/schema.rb
2017-10-07 08:07:33 +00:00
Alessio Caiazza 91f8e734fe
Add CI build trace sections extractor 2017-10-05 15:42:25 +02:00
Grzegorz Bizon 9f639b0733 Set a pipeline failure reason when it has YAML errors
Conflicts:
	app/models/ci/pipeline.rb
2017-10-05 11:38:01 +02:00
Grzegorz Bizon d3762c2247 Implement pipeline seeds size methods 2017-10-05 11:29:28 +02:00
Kamil Trzciński da9d42f2b3 Merge branch '37970-timestamped-ci' into 'master'
Hide CI section markers from job trace

See merge request gitlab-org/gitlab-ce!14393
2017-10-03 18:16:54 +00:00
Alessio Caiazza 5709408585 Hide CI section markers from job trace 2017-10-03 11:35:23 +02:00
Grzegorz Bizon 26e73c2e8f Add some minor improvements to pipeline creation chain 2017-09-27 11:45:16 +02:00
Grzegorz Bizon 2432d5bd9e Add specs for builder chain step that skipps pipelines 2017-09-26 13:22:28 +02:00
Grzegorz Bizon 1a8777c8d7 Fix coding style offenses in pipeline chain classes 2017-09-26 13:02:57 +02:00
Grzegorz Bizon fa3fb23fb1 Move pipeline builder validation chain to a module 2017-09-26 11:53:50 +02:00
Grzegorz Bizon 609fa45f0e Split pipeline chain builder validation class 2017-09-26 11:50:47 +02:00
Grzegorz Bizon 3e60d62cc3 Add class that handles pipeline creation sequence 2017-09-26 11:13:40 +02:00
Grzegorz Bizon 61dc0b7dc7 Extract pipeline persistence to a separate chain class 2017-09-26 09:54:56 +02:00
Grzegorz Bizon 7cfaccd6ed Fix code style offenses in pipeline create services 2017-09-26 09:38:16 +02:00
Grzegorz Bizon 9776dbda4f Use tag/branch methods to check if pipeline ref exists 2017-09-25 17:04:15 +02:00
Grzegorz Bizon 8f47d484da Extract pipeline chain builder classes from service 2017-09-25 16:22:00 +02:00
Grzegorz Bizon 1209f4f671 Move related pipeline class to new pipeline module 2017-09-25 13:22:04 +02:00
Lin Jen-Shin 239332eed3 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (168 commits)
  Update CHANGELOG.md for 10.0.1
  Remove Grit settings from default settings
  Fix duplicate key errors in PostDeployMigrateUserExternalMailData migration
  Workaround for #38259
  Workaround for n+1 in Projects::TreeController#show
  Removed old icons from project page
  Make branches page translatable
  fix typo in icons section
  Don't show it if there's no project.
  Update CHANGELOG.md for 10.0.0
  Inform user that current shared projects will remain shared
  Allow the git circuit breaker to correctly handle missing repository storages
  Reserve refs/replace cos `git-replace` is using it
  Resolve "Better SVG Usage in the Frontend"
  Replace the 'project/service.feature' spinach test with an rspec analog
  Replace the 'project/shortcuts.feature' spinach test with an rspec analog
  Removed two legacy config options
  Fix rendering double note issue.
  IssueNotes: Switch back to Write pane when note cancel or submit.
  Upgrade Nokogiri because of CVE-2017-9050
  ...
2017-09-25 15:42:34 +08:00
Grzegorz Bizon 87637693ac Introduce CI/CD variables collection class 2017-09-22 12:29:06 +02:00
Lin Jen-Shin 6a4ee9aa71 Allow simple ivar ||= form. Update accordingly 2017-09-19 01:29:32 +08:00
Lin Jen-Shin 9ae92b8caa Add cop to make sure we don't use ivar in a module 2017-09-18 21:23:45 +08:00
Grzegorz Bizon f028718641 Raise exception when initializing unknown policy 2017-09-18 14:39:42 +02:00
Grzegorz Bizon f52c61f846 Do not initialize YAML processor with project full path 2017-09-18 14:35:31 +02:00
Grzegorz Bizon d79ad28fcb Do not pass project path from YAML processor
Use project full path that can be received from a pipeline object
2017-09-18 14:29:43 +02:00
Grzegorz Bizon 6681ea9cd8 Simplify pipeline source policy pattern matching 2017-09-18 14:00:59 +02:00
Grzegorz Bizon a04cbd5bb5 Add specs for CI/CD job policy refs specification 2017-09-18 13:57:14 +02:00
Grzegorz Bizon a7a7e2d8f7 Fix Rubocop offenses in YAML processor classes 2017-09-18 13:57:14 +02:00
Grzegorz Bizon 10a486b366 Remove YAML processor refactoring stubs and fix specs 2017-09-18 13:57:14 +02:00
Grzegorz Bizon 241197c29a Extract job refs policy specs into separate class 2017-09-18 13:57:14 +02:00
Grzegorz Bizon dd784b1518 Use CI/CD job policy specification in YAML processor 2017-09-18 13:57:14 +02:00
Grzegorz Bizon 59f87e7317 Implement CI/CD kubernetes policy specification 2017-09-18 13:57:14 +02:00
Maxim Rydkin e83a818751
adds changelog
fix CI

fix CI
2017-09-12 22:32:02 +03:00
Maxim Rydkin 5b296f81e2
move `lib/ci/mask_secret.rb` into `lib/gitlab/ci/mask_secret.rb` 2017-09-12 22:32:02 +03:00
Maxim Rydkin c45ace8972
move `lib/ci/gitlab_ci_yaml_processor.rb` into `lib/gitlab/ci/yaml_processor.rb` 2017-09-12 22:32:02 +03:00
Maxim Rydkin c295d3362b
move `lib/ci/model.rb` into `lib/gitlab/ci/model.rb` 2017-09-12 22:32:01 +03:00
Maxim Rydkin f364cc34ea
move `lib/ci/charts.rb` into `lib/gitlab/ci/charts.rb` 2017-09-12 22:32:01 +03:00
Maxim Rydkin 060fc3905d
move `lib/ci/ansi2html.rb` into `lib/gitlab/ci/ansi2html.rb` 2017-09-12 22:32:01 +03:00
Grzegorz Bizon 3b9f9aa00b Merge commit 'd1b60cbc67dc14b21820ef3f823a8e1ea851697d' into feature/gb/download-single-job-artifact-using-api
* commit 'd1b60cbc67dc14b21820ef3f823a8e1ea851697d': (210 commits)
2017-09-06 14:29:17 +02:00
Grzegorz Bizon b03d9e506d Remove unneeded string interpolation from entry class 2017-09-06 11:42:14 +02:00
Grzegorz Bizon c53f319f88 Extract a class that represents artifacts file path 2017-09-05 12:17:56 +02:00
Grzegorz Bizon e23e86953d Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (469 commits)
2017-09-04 12:13:11 +02:00
Shinya Maeda bbe967abeb Add the rest of specs 2017-09-03 23:49:10 +09:00
Shinya Maeda eda34b1a18 Add spec. Fix runner setting page. It worked. 2017-09-03 23:49:10 +09:00
Shinya Maeda e1ef436d1f Update application code by the db schema change 2017-09-03 23:49:10 +09:00
Grzegorz Bizon fc4fb6e4d2 Change CI/CD kubernetes policy keyword to `active` 2017-09-01 13:04:08 +02:00
Grzegorz Bizon ef030709eb Change kubernetes job policy allowed values
It is now possible to use `kubernetes: configured`.
2017-08-31 14:56:25 +02:00
Grzegorz Bizon 92673c2c63 Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (275 commits)
  Decrease Metrics/PerceivedComplexity threshold to 17
  Upgrade mail and nokogiri gems due to security issues
  Link out to stackoverflow answer on setting swappiness
  Document swappiness recomendations in the requirements doc
  Fix invalid attribute used for time-ago-tooltip component
  Update latest artifacts doc
  Add changelog entry for flipping verify_certificates
  Default LDAP config verify_certificates to true
  Update share project with groups docs
  remove accidental console.log from karma tests
  update specs to match reorganized monitoring components
  Remove tooltips from new sidebar
  Use `git update-ref --stdin -z` to delete refs
  Don't use public_send in destroy_conditionally! helper
  Remove unused expressions policy from ci/cd config
  Simplify code for appending strategies in CI/CD config
  Raise exception when simplifiable ci entry incomplete
  Add changelog entry
  Fix MySQL failure for emoji autocomplete
  max-width for lazy-loaded images (this was removed in the original MR through merge resolution most probably)
  ...

Conflicts:
	lib/gitlab/ci/config/entry/policy.rb
2017-08-31 14:02:52 +02:00
Grzegorz Bizon 1bf87d2524 Remove unused expressions policy from ci/cd config 2017-08-30 14:47:54 +02:00
Grzegorz Bizon 3474e109b7 Simplify code for appending strategies in CI/CD config 2017-08-30 13:27:48 +02:00
Grzegorz Bizon 808fb2549b Raise exception when simplifiable ci entry incomplete 2017-08-30 13:26:11 +02:00
Grzegorz Bizon 326dc7da3b Check if kubernetes required before creating a job 2017-08-26 12:45:36 +02:00
Grzegorz Bizon 5ce9e03f6c Use new complex only/except policy internal scheme 2017-08-26 11:11:28 +02:00
Grzegorz Bizon 0410861171 Add specs for attributable aspect of ci config entry 2017-08-25 18:26:55 +02:00
Grzegorz Bizon 7e6bc4dde2 Improve reporting of a CI/CD entry config location 2017-08-25 15:16:09 +02:00
Grzegorz Bizon 99dddac558 Simplify ci config entry validator implementation 2017-08-25 13:00:45 +02:00
Grzegorz Bizon 946e8d3a93 Use only/except policy that returns an array 2017-08-25 12:01:59 +02:00
Grzegorz Bizon a061a2461a Fix CI/CD trigger policy default value 2017-08-25 11:42:40 +02:00
Grzegorz Bizon fcb4d1f809 Implement complex only/except policy CI/CD config 2017-08-25 10:27:00 +02:00
Grzegorz Bizon 8c409fc40b Make it possible to define CI/CD config strategies 2017-08-25 09:49:18 +02:00
Grzegorz Bizon 0d7d7c1057 Use aspect-oriented design in CI/CD config entries 2017-08-24 14:54:27 +02:00
Grzegorz Bizon 5ced2d8d7d Rename CI/CD job triggering policy class to Policy 2017-08-24 12:22:01 +02:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Nick Thomas 4bda5b502d Short-circuit build coverage extraction for empty regexes 2017-07-22 07:12:19 +01:00
Nick Thomas 000ddc96c5 Fix the gcovr coverage regex by removing line separators before scanning
RE2 differs from Ruby in handling multiple-line strings. The string "foo\n"
will not match the regular expression "foo$" unless multi-line mode is enabled
(and it's off by default).

Since we're already scanning the build trace line by line (and so multi-line
coverage regular expressions won't work), we can fix this by removing the line
separator before scanning the string.
2017-07-21 22:08:23 +01:00
Kamil Trzciński 4766a77b1d Merge branch 'feature/gb/auto-retry-failed-ci-job' into 'master'
Make it possible to auto retry a failed CI/CD job

Closes #3442

See merge request !12909
2017-07-20 11:25:54 +00:00
Douwe Maan ba60d4f6e4 Merge branch '24570-use-re2-for-user-supplied-regexp-9-3' into 'security-9-3'
24570 use re2 for user supplied regexp 9 3

See merge request !2129
2017-07-19 22:28:41 -05:00
Grzegorz Bizon 23223ba64e Do not allow to auto-retry a job more than 2 times 2017-07-19 11:27:49 +02:00
Grzegorz Bizon c1918fb10b Add a new `retry` CI/CD configuration keyword 2017-07-17 12:05:07 +02:00
Kamil Trzcinski 6d272f8e7d Pass before_script and script as-is preserving arrays 2017-07-07 14:42:54 +02:00
Kamil Trzciński 7f500acb5f Merge branch '33772-readonly-gitlab-ci-cache' into 'master'
Introduce cache policies for CI jobs

Closes #33772

See merge request !12483
2017-07-06 07:40:43 +00:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Nick Thomas 35f4a00f37 Introduce cache policies for CI jobs 2017-07-05 15:39:26 +01:00
Tomasz Maczukin dcdf2a8bc5 Make entrypoint and command keys to be array of strings 2017-07-02 14:48:11 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Grzegorz Bizon b29bf62602 Merge branch 'feature/add-support-for-services-configuration' into 'master'
Add support for services configuration in .gitlab-ci.yml

See merge request !8578
2017-06-14 07:57:47 +00:00
Kamil Trzcinski 25b99a5b3b Update tests and application 2017-06-13 16:05:38 +02:00
Kamil Trzcinski a4a3da764a Allow to access pipelines even if they are disabled, but only present jobs and commit statuses without giving ability to access them 2017-06-13 09:52:48 +02:00
Tomasz Maczukin 645c865141
Remove Gitlab::Ci::Config::Entry::DockerImage 2017-06-12 14:27:17 +02:00
Tomasz Maczukin c70e9f2ed1
Send new configuration options with job's payload 2017-06-12 12:58:35 +02:00
Tomasz Maczukin 8c6e2bada2
Add support for docker image configuration in .gitlab-ci.yml 2017-06-12 12:58:35 +02:00
Bob Van Landuyt bdebe849b8 Translate project & repository pages 2017-06-07 20:13:44 +00: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
Grzegorz Bizon fe0b2f81c7 Refine implementation of pipeline stage seeds 2017-06-02 12:16:11 +02:00
Grzegorz Bizon c72e21fd97 Return stage seeds object from YAML processor 2017-05-31 15:13:40 +02:00
Grzegorz Bizon c881425b66 Refine pipeline stages seeds class 2017-05-31 14:40:50 +02:00
Grzegorz Bizon 805715cc68 Add stage seed class that represents attributes 2017-05-30 15:30:45 +02:00
Lin Jen-Shin 70eb0c6a88 Merge remote-tracking branch 'upstream/master' into rename-builds-controller
* upstream/master: (307 commits)
  Address feedback
  Add small update for the i18n guide.
  update webpack to v2.6.1 patch release to fix "Can't find variable: Promise" error
  update webpack-bundle-analyzer past v2.4.1 to support NamedChunksPlugin
  name all webpack chunks to improve long term cacheability
  add NameAllModulesPlugin to cover shortcomings of NamedModulesPlugin
  upgrade to latest webpack version
  Only use DROP INDEX CONCURRENTLY on postgreql 9.2+
  Provide default for calculating label text color (!11681)
  Add failing test for #32728
  Bugfix: Always use the default language when generating emails.
  Remove unecessary commit pattern check
  Add regexp_for_value helper method
  Remove shared example and improve sub_group_issuables_spec.rb
  Remove 'should' from scenario in has_subgroup_title_spec.rb
  Cartfile git and binary methods cannot take a GitHub repo
  Fix terminals support for Kubernetes service
  Add review comments to compare_spec.rb
  Fix transient error clicking dropdown items in compare_spec.rb
  Use non-global jQuery reference within raven bundle
  ...
2017-05-26 18:25:32 +08:00
Shinya Maeda f9c9daac78 Resolve static analysys. Use until instead of negative while 2017-05-25 01:35:40 +09:00
Shinya Maeda cf4ab10d71 Adopt ayufan script 2017-05-24 20:20:20 +09:00
Shinya Maeda a16387486a put force_encoding in def reverse_line 2017-05-24 20:10:15 +09:00
Shinya Maeda 22f1d2a1c4 Append gurad clause. remove unless debris.empty 2017-05-24 20:10:14 +09:00
Shinya Maeda 72b0af2c4c Avoid tap. Use unless&empty. 2017-05-24 20:10:14 +09:00
Shinya Maeda fdcd2f192d Improve calc_read_size 2017-05-24 20:10:14 +09:00
Shinya Maeda 8c1b07e0cc Optimize reverse_line 2017-05-24 20:10:14 +09:00
Shinya Maeda 6be609dd64 much better 2017-05-24 20:10:14 +09:00
Shinya Maeda dddfa28eec Refer reverse_line from read_last_lines 2017-05-24 20:10:14 +09:00
Shinya Maeda 318b464072 Use force_encoding(regex.encoding) 2017-05-24 20:10:14 +09:00
Shinya Maeda a6f6056c62 Use force_encoding when regex contains UTF-8 char 2017-05-24 20:10:14 +09:00
Shinya Maeda b9950c22b3 Use each_line. Avoid comparison of partial. Add UTF-8 spec. 2017-05-24 20:10:14 +09:00
Shinya Maeda 3d11b7d8e2 Fix reverse_line from chunk based 2017-05-24 20:10:14 +09:00
Shinya Maeda ddf67424ec Fix while true 2017-05-24 20:10:14 +09:00
Shinya Maeda 6018afa89f Add reverse_line 2017-05-24 20:10:14 +09:00
Lin Jen-Shin 71777a4a18 Rename BuildsController to JobsController
Rename other URL generators

admin_builds_path -> admin_jobs_path

Fix tests and more renaming

Fix more tests

Also change build_id to job_id in the controller
2017-05-17 20:17:30 +08:00
Kamil Trzciński e261b4b851 Merge branch 'allow_numeric_values_in_gitlab_ci_yml' into 'master'
Allow numeric values in gitlab-ci.yml

Closes #30017

See merge request !10607
2017-05-15 07:59:45 +00:00
Dosuken shinya 1175937469 Resolve "Update gem sidekiq-cron from 0.4.4 to 0.6.0 and rufus-scheduler from 3.1.10 to 3.4.0" 2017-05-10 15:48:09 +00:00
blackst0ne 295cecfb56 Allow numeric values in gitlab-ci.yml 2017-05-07 08:29:43 +11:00
Kamil Trzciński 6ad3814e1b Merge branch 'feature/gb/manual-actions-protected-branches-permissions' into 'master'
Check access to a branch when user triggers manual action

Closes #20261

See merge request !10494
2017-05-06 17:17:02 +00:00
Zeger-Jan van de Weg c17e6a6c68 Real time pipeline show action 2017-05-06 16:45:46 +00:00
Grzegorz Bizon 55cec2177c Refine inheritance model of extended CI/CD statuses 2017-05-05 15:21:06 +02:00
Grzegorz Bizon 2cc8f43e54 Introduce generic manual action extended status class 2017-05-05 15:13:58 +02:00
Grzegorz Bizon 9363675380 Use update build policy instead of new play policy 2017-05-05 12:25:24 +02:00
Grzegorz Bizon b6facd8313 Merge commit '3a2b60f7' from 'master'
* commit '3a2b60f7a0109cdb84e8727a2625318a746e84dc': (151 commits)
  Fixed Karma spec
  Reject EE reserved namespace paths in CE as well
  Updated webpack config
  Include the bundler:audit job into the static-analysis job
  Document serializers
  Add artifact file page that uses the blob viewer
  Pipeline table mini graph dropdown remains open when table is refreshed
  Adds off for event hub
  Compile gitlab-shell go executables
  Allow to create new branch and empty WIP merge request from issue page
  Moved to a view spec
  Improving copy of CONTRIBUTING.md, PROCESS.md, and code_review.md
  Convert seconds to minutes and hours on chat notifations
  Disable navigation to Pages config if Pages is disabled
  Sort the network graph both by commit date and topographically.
  Add tooltips to note action buttons
  Add breadcrumb, build header and pipelines submenu to artifacts browser
  Update todos screenshots
  removes the possibility of commit messages having carriage returns
  Handle incoming emails from aliases correctly
  ...
2017-05-05 12:22:46 +02:00
Douwe Maan 0f58eb6bde Add artifact file page that uses the blob viewer 2017-05-04 08:50:12 -05:00
Dosuken shinya 2fbcaaafcd Fix lazy error handling of cron parser 2017-05-03 15:23:20 +00:00
Grzegorz Bizon 4f2cc5951f Extend action tooltop to show info about abilities 2017-05-01 14:29:20 +02:00
Grzegorz Bizon 8c8f6db457 Merge branch 'master' into feature/gb/manual-actions-protected-branches-permissions
* master: (274 commits)
  Update VERSION to 9.2.0-pre
  Update CHANGELOG.md for 9.1.0
  Update Auto Deploy documentation
  Disable import URL field in New project form since it's hidden by default
  Remove reference to burndown charts since they don't exist for ce.
  Use master_password for Sentinel
  Refactor Discussions docs
  Start versioning cached markdown fields
  Refactor add_users method for project and group
  Improved the spec Now correctly tests against different forms
  Refactor environments components into vue files - part 3
  Adding animation for all dropdown
  fix placeholder visibility
  submodule_links: handle urls that don't end with .git
  Add help regarding vue resource and where to include it
  Append .json to ajax endpoint to prevent browser to display raw json
  Fixed the preview keyboard shortcut focusing wrong tab
  Fix broken link
  Added new discussions docs
  Started on resolvable discussions docs
  ...
2017-04-22 21:01:50 +02:00
Filipa Lacerda b67bb566b3 Improves support for long build traces: 2017-04-18 12:27:10 +00:00
Lin Jen-Shin fb60c6187d Use &. because rubocop. Seriously I don't think this makes sense 2017-04-18 17:33:17 +08:00
Lin Jen-Shin b07da07c82 Just enforce the output encoding for Ansi2html
Fixes https://sentry.gitlap.com/gitlab/gitlabcom/issues/27545/
2017-04-18 17:12:06 +08:00
Lin Jen-Shin 9350b9064c Set the encoding in c'tor and explain why it's fine 2017-04-17 17:52:15 +08:00
Lin Jen-Shin e7d3fe44f6 Only set the encoding before passing to Ansi2html 2017-04-17 17:10:41 +08:00
Lin Jen-Shin dac23fa233 Don't try to read if there's no trace 2017-04-17 16:29:47 +08:00
Lin Jen-Shin c26b126502 Make sure @stream.each_line would tag Encoding.default_external 2017-04-17 15:53:09 +08:00
Lin Jen-Shin ee3b0c3a9a Make sure we're giving Encoding.default_external 2017-04-17 14:30:42 +08:00
Lin Jen-Shin b07b8a5f3e Don't seek at all if the log is small anyway
then it's fine to skip the first line because
it won't be very noticeable
2017-04-13 22:07:37 +08:00
Lin Jen-Shin faa5dffbcc After Trace#limit, we seek to the next line in case
of breaking ANSI sequence or Unicode
2017-04-13 21:44:26 +08:00
Grzegorz Bizon a8231ea1be Merge branch 'master' into feature/gb/manual-actions-protected-branches-permissions
* master: (641 commits)
  Revert "Fix registry for projects with uppercases in path"
  Fix registry for projects with uppercases in path
  Move event icons into events_helper
  Reset New branch button when issue state changes
  Add link to environments on kubernetes.md
  Indent system notes on desktop screens
  Improve webpack-dev-server compatibility with non-localhost setups.
  Add changelog entry
  Fix recent searches icon alignment in Safari
  Use preload to avoid Rails using JOIN
  Fix NUMBER_OF_TRUNCATED_DIFF_LINES re-definition error
  Prepare for zero downtime migrations
  Fix filtered search input width for IE
  Fix the `gitlab:gitlab_shell:check` task
  Fixed random failures with Poll spec
  Include CONTRIBUTING.md file when importing .gitlab-ci.yml templates
  Let uses hide verbose output by default
  Separate examples for each other
  Collapse similar sibling scenarios
  Use empty_project for resources that are independent of the repo
  ...

Conflicts:
	app/views/projects/ci/builds/_build.html.haml
2017-04-13 15:08:52 +02:00
Grzegorz Bizon 2aa211fa69 Use build policy to determine if user can play build 2017-04-12 13:48:43 +02:00
Z.J. van de Weg 23fbbe0c92 Return nil as coverage instead of a File object
Given a valid pipeline job, and a regex which wouldn't match to a jobs
trace, the stream of the trace would return the File object. This was
not the case when it matched a value, as that would have been return
from the block.

Now the `extract_coverage` method returns `nil` if no match was found.
2017-04-12 12:03:39 +02:00
Kamil Trzciński 1815d44a7f Merge branch '2989-run-cicd-pipelines-on-a-schedule-idea1-basic-backend-implementation' into 'master'
Resolve "Run CI/CD pipelines on a schedule" - "Basic backend implementation"

See merge request !10133
2017-04-06 18:55:34 +00:00
Kamil Trzciński 828d81ee1f Optimise trace handling code to use streaming instead of full read 2017-04-06 16:20:27 +00:00
Grzegorz Bizon 5b6202cce1 Do not show play action if user not allowed to run it 2017-04-06 17:15:15 +02:00
Shinya Maeda cb082ae291 Improve instantiate recursion in cron_parser.rb 2017-04-06 23:46:59 +09:00
Shinya Maeda 31bd3962d7 Add empty line in cron_parser.rb 2017-04-06 23:46:59 +09:00
Shinya Maeda 4688eb47c6 Rename cron_time_zone to cron_timezone. Separate add_concurrent_foreign_key. 2017-04-06 23:46:59 +09:00
Shinya Maeda 0c153af73d Ommit begin block in try_parse_cron 2017-04-06 23:46:59 +09:00
Shinya Maeda 4949e2b291 Separate cron_valid? and cron_time_zone_valid? 2017-04-06 23:46:59 +09:00
Shinya Maeda 3d3df09713 Dry up next_time_from. Move cron_parser_spec to appropriate location. 2017-04-06 23:46:59 +09:00
Shinya Maeda 914bef671f Move Ci::CronParser to Gitlab::Ci::CronParser 2017-04-06 23:46:58 +09:00
Kamil Trzciński 8391fa37f0 Merge branch '12818-expose-simple-cicd-status-endpoints-with-status-serializer-gitlab-ci-status-for-pipeline-job-and-merge-request' into 'master'
Expose CI/CD status API endpoints with Gitlab::Ci::Status facility on pipeline, job and merge request for favicon

See merge request !9561
2017-03-27 12:21:22 +00:00
Tomasz Maczukin 3878a774f1
Fix after_script processing for Runners APIv4 2017-03-23 16:10:06 +01:00
Shinya Maeda 448c695c2a Revert adding favicon to extended statuses. Change extended statues specs to use core status 2017-03-23 17:11:49 +09:00
Shinya Maeda 74f13e0ddf Fix unchanged structure. Add favicon for 'failed_allowed' and 'success_warning' because it'll be used. 2017-03-23 17:11:49 +09:00
Shinya Maeda 49f9ab9064 Add spec for spec/lib/gitlab/ci/status 2017-03-23 17:11:49 +09:00
Shinya Maeda 21e62c9ef9 Roolback unneccesary changes 2017-03-23 17:11:49 +09:00
Shinya Maeda 04b1741cd1 Remove def favicon from extended status 2017-03-23 17:11:48 +09:00
Shinya Maeda 6d6127f665 change favicon name 2017-03-23 17:11:48 +09:00
Shinya Maeda ba27f1b954 Expose only status. ci_cd_status to status. Support abstract class. 2017-03-23 17:11:48 +09:00
Shinya Maeda 0e06cfc059 Add api points for ci cd status. Add favicon. 2017-03-23 17:11:48 +09:00
Grzegorz Bizon 7319460c18 Verbosify blocked pipeline status description 2017-03-08 09:10:20 +01:00
Kamil Trzciński fb4a486605 Merge branch 'feature/runner-jobs-v4-api' into 'master'
Feature/runner jobs v4 api

Closes #28513

See merge request !9273
2017-03-07 13:53:26 +00:00
Tomasz Maczukin 32b09b8847
Add minor refactoring 2017-03-07 12:30:34 +01:00
Lin Jen-Shin fb167787f2 Merge remote-tracking branch 'upstream/master' into set-default-cache-key-for-jobs
* upstream/master: (289 commits)
  re-add Assign to Me link on new MR/Issue forms
  thinner bottom header border
  make header match old 16px padding of body contents
  Update font-awesome-rails to 4.7.0.1
  Relax font-awesome-rails dependency to ~> 4.7
  Restore keyboard shortcuts for "Activity" and "Charts"
  fix border radius bottom for header
  match padding for mr-widget sections
  Update changelog
  Fix project-last-commit alignment
  Docs: update GL Pages IP on GL.com
  Fix up @DouweM review
  Remove readme-only project view preference
  Add `uploads` to known models for Import/Export spec
  Add `has_many` associations for models that can have Upload records
  Handle relative and absolute Upload paths in the Uploaders
  Change the default CarrierWave root path for tests
  Fix Projects::UploadService spec
  Add a Project::UploadsController spec to ensure an Upload is created
  Add `RecordsUploads` module to record Upload records via callbacks
  ...
2017-03-07 16:55:03 +08:00
Grzegorz Bizon bb2460c1ea Improve specs for detailed statuses with manual actions 2017-03-06 14:08:55 +01:00
Grzegorz Bizon 66dd209661 Ignore job by default if it is a manual action
This makes it possible to maintain backwards compatibility with configs
created when manual actions were non-blocking.

From now manual actions are blocking if configured with `allow_failure:
false`, otherwise manual actions are optional, and their status is
ignored.
2017-03-06 12:01:33 +01:00
Grzegorz Bizon ac5bd3b73c Reinstitute a core `manual` status for manual actions 2017-03-06 10:04:04 +01:00
Grzegorz Bizon 14351f9767 Introduce core status for blocked manual actions 2017-03-06 10:04:04 +01:00
Grzegorz Bizon 79ea01bfaf Refactor code related to pipeline blocking actions 2017-03-06 10:04:04 +01:00
Kamil Trzcinski be039d22d7 Make manual actions blocking 2017-03-06 10:04:04 +01:00
Lin Jen-Shin 0fe0b044e4 No need to set cache:key if no path was specified
Feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9666/diffs#note_24607518
2017-03-03 22:21:46 +08:00
Lin Jen-Shin a00520b15d Restore Unspecified and we could discuss later
Also feedback in:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9666/diffs#note_24608283
2017-03-03 16:55:01 +08:00
Tomasz Maczukin 5c1aa5fb65
Add some fixes and refactoring after review 2017-03-02 17:48:00 +01:00
Tomasz Maczukin 1bbf2c2cd1
Fix rubocop offenses 2017-03-02 17:45:46 +01:00
Tomasz Maczukin fb8210ad19
Update step data naming 2017-03-02 17:45:45 +01:00
Tomasz Maczukin bbf5bb7070
Fix rubocop offenses 2017-03-02 17:45:45 +01:00
Tomasz Maczukin 3eafffcef0
Refactor JobRequest response structure 2017-03-02 17:45:45 +01:00
Lin Jen-Shin dc3a41f405 Fix tests for added default cache key 2017-03-03 00:30:22 +08:00
Lin Jen-Shin 6e032d7ba0 Set default cache key for jobs, detail:
* Replace Unspecified with a field so that it's less surprising
* Define inspect for Node for easy debugging (and avoid building
  a very huge string potentially from built-in inspect)
* Set default cache key to 'default'
2017-03-02 22:12:15 +08:00
Sean McGivern 811e598f60 Enable and autocorrect the CustomErrorClass cop 2017-03-01 15:28:10 +00:00
Douwe Maan f88ff0cc0c Stylistic tweaks 2017-02-23 09:33:20 -06:00
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00
Douwe Maan 1fe7501b49 Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
2017-02-23 09:33:05 -06:00
Douwe Maan e2bbbb1a9a Fix new offenses 2017-02-23 09:32:42 -06:00
Douwe Maan 75f5fa997d Enable Rails/Delegate 2017-02-23 09:32:42 -06:00