Commit Graph
3397 Commits
Author SHA1 Message Date
Robert SpeicherandRobert Speicher 1d92669cb0 Merge branch 'backup-database-timeout-fix' into 'master'
Fix timeout issue for rake task gitlab:backup:create

This is a fix for a database timeout which can occur when the backup
create task is taking very long (1-2 hours).
It seems that ActiveRecord is loosing the connection after a hour
idleness and need to be reconnected before use.

See merge request !2757
2016-02-09 12:25:37 -05:00
Kamil Trzcinski 447f1e30db Limit guest access builds
This solves https://dev.gitlab.org/gitlab/gitlabhq/issues/2646

1. This MR simplifies CI permission model:
    - read_build: allows to read a list of builds, artifacts and trace
    - update_build: allows to cancel and retry builds
    - admin_build: allows to manage triggers, runners and variables
    - read_commit_status: allows to read a list of commit statuses (including the status of a build, but doesn't allow to see a build details)
    - create_commit_status: allows to create a new commit status using API

2. I do make sure that the proper permissions are used in all places where the CI can be shown.

3. Add the `read_build` ability if user is anonymous or guest and allow_guest_to_access_builds is enabled.

4. Add CI setting: public_builds.

5. The artifacts specific permission are removed, since they are covered by `*_build`.
2016-02-08 20:27:24 +01:00
Robert SpeicherandRobert Speicher 3d687ec316 Merge branch 'highlight-blame' into 'master'
Fix highlighting in blame view.

See merge request !2630
2016-01-31 19:26:59 -05:00
Robert SpeicherandRobert Speicher 026885eeb1 Merge branch 'fix-ci-runners-version-update' into 'master'
Fix CI runner version not being properly updated when asked for a build

Due to broken implementation of attribute_for_keys the runner information was not updated correctly.

This MR adds test to check that such scenario will never happen again.

See merge request !2618
2016-01-27 17:47:23 -05:00
Douglas Barbosa AlexandreandRobert Speicher 6881ba0e79 Merge branch 'instrumentation-signature' into 'master'
Correct arity for instrumented methods w/o args

This should fix the problem of imports not working. See https://gitlab.com/gitlab-org/gitlab-ce/issues/12450#note_3380730 for the details/context of these changes.

See merge request !2602
2016-01-25 16:10:20 -08:00
Robert SpeicherandRobert Speicher d6dd80d097 Merge branch 'fix-diff-comments' into 'master'
More highlighted diff fixes

See merge request !2545
2016-01-21 23:39:54 -08:00
Robert SpeicherandRobert Speicher 13a7808242 Merge branch 'unescaped-diffs' into 'master'
Make sure non-highlighted diffs are still escaped

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

See merge request !2544
2016-01-21 17:37:49 -08:00
Robert SpeicherandRobert Speicher 83b7ac6499 Merge branch 'ci/recursive-artifacts-entries' into 'master'
Add method to calculate total size of artifacts in subpath

See merge request !2500
2016-01-21 15:23:26 -08:00
Douwe MaanandRobert Speicher e7a875cc79 Merge branch 'ci/cache-key' into 'master'
Added cache:key to .gitlab-ci.yml allowing to fine tune the caching

The `cache:key` allows you to define the affinity mask of caching, allowing to have single cache for all jobs, or cache per-job, or per-branch, or any other way you would need:

1. Cache per-build for all branches:

```
cache:
    key: "$CI_BUILD_NAME"
    untracked: true
```

2. Cache per-branch for all jobs:

```
cache:
    key: "$CI_BUILD_REF"
    untracked: true
```



/cc @DouweM @grzesiek @axil


See merge request !2436
2016-01-21 15:01:36 -08:00
Robert SpeicherandRobert Speicher fd106c7fdd Merge branch 'workhorse-path' into 'master'
Init script changes for gitlab-workhorse in 8.4

Goes with https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/31

Also bumps gitlab-workhorse to 0.6.1.

[ci skip]

See merge request !2529
2016-01-21 11:09:09 -05:00
Douwe MaanandRobert Speicher ef3bccac7e Merge branch 'fix-github-wiki-import' into 'master'
Fix import of GitHub's wiki when the repository has not been created

Fixes #12503 

See merge request !2533
2016-01-21 11:04:54 -05:00
Robert SpeicherandRobert Speicher 960d873989 Merge branch 'fix-github-pull-requests-import' into 'master'
Fix cross projects detection when importing GitHub pull requests

Fixes #12456

See merge request !2523
2016-01-20 17:13:55 -05:00
Robert SpeicherandRobert Speicher eebb691cb6 Merge branch 'issue_3945' into 'master'
Add syntax highlighting to diff view

Closes #3945

See merge request !2109
2016-01-20 16:56:13 -05:00
Robert Speicher 6a5cd3ca41 Merge branch 'feature/check-against-rbl-only' into 'master'
Split from !2455

References #9092

See merge request !2515
2016-01-20 14:25:40 -05:00
Robert SpeicherandRobert Speicher 96f12f57fc Merge branch 'fix-error-500-with-invalid-utf8' into 'master'
Gracefully handle invalid UTF-8 sequences in Markdown links

Closes #6077

See merge request !2382
2016-01-20 14:03:58 -05:00
Robert SpeicherandRobert Speicher 74a6b4b633 Merge branch 'add_email_headers' into 'master'
Added X-GitLab-... headers to emails from CI and Email On Push services

Fixes #2098

This adds the 'X-GitLab-Project', 'X-GitLab-Project-Id' and
'X-GitLab-Project-Path' headers to emails from CI and Email On Push in a way
that it is done currently for merge requests and issues emails.

Additionally, CI emails will have 'X-GitLab-Build-Status' header with either
'fail' or 'success'.

Emails from Email On Push will include 'X-Gitlab-Author' header containing the
username of user who did the push.

See merge request !2159
2016-01-19 16:25:21 -05:00
Robert SpeicherandRobert Speicher a3a008f6b2 Merge branch 'user-ldap-email' into 'master'
Allow LDAP users to change their email if it was not set by the LDAP
server

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

See merge request !2502
2016-01-19 14:15:52 -05:00
Robert SpeicherandRobert Speicher 1c233ff5fe Merge branch 'rs-silence-statemachine-in-cron' into 'master'
Prevent StateMachine warnings from outputting during a cron task

[ci skip]

Closes #5931

See merge request !2458
2016-01-15 17:50:10 -05:00
Douwe Maan c19795dff5 Merge branch 'ci/build_dependencies' into 'master'
Let the CI runner know about builds that this build depends on

This allows us to implement artifacts passing: runner will download artifacts from all prior builds. It will happen automatically, and always, as long as artifacts are enabled.

## The changes:

This MR exposes list of prior builds in CI::API::Builds.

**The API response when asking for builds**

```json
{
  "id": 48584,
  "ref": "0.1.1",
  "tag": true,
  "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
  "status": "success",
  "name": "pages",
  "token": "9dd60b4f1a439d1765357446c1084c",
  "stage": "test",
  "project_id": 479,
  "project_name": "test",
  "commands": "echo commands",
  "repo_url": "http://gitlab-ci-token:token@gitlab.example/group/test.git",
  "before_sha": "0000000000000000000000000000000000000000",
  "allow_git_fetch": false,
  "options": {
    "image": "docker:image",
    "artifacts": {
      "paths": [
        "public"
      ]
    },
    "cache": {
      "paths": [
        "vendor"
      ]
    }
  },
  "timeout": 3600,
  "variables": [
    {
      "key": "CI_BUILD_TAG",
      "value": "0.1.1",
      "public": true
    }
  ],
  "dependencies": {
    "builds": [
      {
        "id": 48584,
        "ref": "0.1.1",
        "tag": true,
        "sha": "d63117656af6ff57d99e50cc270f854691f335ad",
        "status": "success",
        "name": "build",
        "token": "9dd60b4f1a439d1765357446c1084c",
        "stage": "build",
        "project_id": 479,
        "project_name": "test",
        "artifacts_file": {
          "filename": "artifacts.zip",
          "size": 0
        }
      }
    ]
  }
}
```

## How it will work?

**Example:**
```
build:
  type: build
  script:
  - echo TEST > test_file
  artifacts:
    untracked: true

rspec:
  type: test
  script:
  - test-my-project

staging:
  type: deploy
  script:
  - scp test_file root@server.com:
```

**The flow:**
1. We run `build`. The `build` creates a file `test_file`. This file gets archived and send us build artifacts.
2. We run `rspec`. The `rspec` downloads build artifacts from `build`. Uses the `test_file`.
3. We run `staging`. The `staging` downloads build artifacts from `build` and `rspec`, but since the `rspec` doesn't have build artifacts we skip that build. Deploys the `test_file`.

This partially implements the https://gitlab.com/gitlab-org/gitlab-ce/issues/3423.

In the next release we will introduce option to configure what artifacts are received.

/cc @grzesiek @DouweM @sytse @rspeicher


See merge request !2437
2016-01-15 15:54:35 +00:00
Kamil Trzcinski 1ce766367e Change dependencies.builds to depends_on_builds 2016-01-15 15:35:33 +01:00
Steffen Köhler 2444c04055 Fix signup for some OAuth providers
some OAuth providers (kerberos for example) only provide a username and an email, but no name. Therefore
a signup fails because the name is empty. Best guess for the name is
probably the username, therefore use it as name.
2016-01-15 14:55:52 +01:00
Tomasz Maczukin 768721dc58 Merge branch 'master' into ci/api-triggers
* master: (150 commits)
  fixes margin and padding
  Update mailroom/postfix documentation [ci skip]
  Fix css mess around git clone panel. Align it properly
  Fix missing padding for user/group pages
  Fix parse_gollum_tags matcher
  Update documentation on Banzai::Filter::GollumTagsFilter
  Add tests for the wiki pipeline
  Refactoring Banzai::Filter::GollumTagsFilter
  Make sure the .git is at the end on Gitlab::GithubImport::WikiFormatter
  Remove GollumTagsPipeline
  Refactoring Gitlab::GithubImport::Importer
  Remove unnecessary brackets on WIKI_SLUG_ID route constraints
  Move js function to removing accents to vendor/assets/javascripts
  Update CHANGELOG
  Use the WikiPipeline when rendering the wiki markdown content
  Add Banzai::Filter::GollumTagsFilter for parsing Gollum's tags in HTML
  Relax constraints for wiki slug
  Import GitHub wiki into GitLab
  Move Ci::Build#available_statuses to AVAILABLE_STATUSES constant in CommitStatus
  Revert changes to how the notes are paginated in the API
  ...

Conflicts:
	doc/api/README.md
	lib/api/entities.rb
2016-01-14 21:58:17 +01:00
Robert Speicher 17d4b39806 Merge branch 'diff-parse-first-commit' into 'master'
Properly generate diff of orphan commits, like the first commit in a
repository

Fixes gitlab-org/gitlab_git#14

See merge request !2427
2016-01-14 14:29:08 -05:00
Kamil Trzcinski ac652d82f1 Let the CI runner know about builds that this build depends on
This allows us to implement artifacts passing: runner will download artifacts from all prior builds
2016-01-14 19:45:55 +01:00
Robert Speicher 65eae647a6 Merge branch 'backport-ee' into 'master'
Backport two commits from EE

Backport part of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/110

See merge request !2424
2016-01-14 18:39:49 +00:00
Douwe Maan ba42b03348 Merge branch 'ci/api-builds' into 'master'
Add builds API

References #4264

See merge request !2207
2016-01-14 16:29:15 +00:00
Dmitriy Zaporozhets 0eef82761f Merge branch 'add-pagination-headers-to-api' into 'master'
Add pagination headers to already paginated API resources

Following #3045, I've added pagination headers using already available Kaminari methods.

## Pagination headers in action

![Screen_Shot_2016-01-14_at_12.14.53](/uploads/88807f754dd9aafbb24da85f6bdf9521/Screen_Shot_2016-01-14_at_12.14.53.png)

---

I've also added a shared example to test paginated API resources.

A possible next step would be to paginate all the API resources that return an array.

See merge request !2426
2016-01-14 15:20:16 +00:00
Douglas Barbosa Alexandre ac2c86055e Update documentation on Banzai::Filter::GollumTagsFilter 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre 765a2c7327 Refactoring Banzai::Filter::GollumTagsFilter 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre 89e8b82b63 Make sure the .git is at the end on Gitlab::GithubImport::WikiFormatter 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre ca87bb652a Remove GollumTagsPipeline 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre 60f8434a9d Refactoring Gitlab::GithubImport::Importer 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre 4872b319c8 Use the WikiPipeline when rendering the wiki markdown content 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre a6a5990ee5 Add Banzai::Filter::GollumTagsFilter for parsing Gollum's tags in HTML 2016-01-14 12:09:31 -02:00
Douglas Barbosa Alexandre 78f5eb94fb Import GitHub wiki into GitLab 2016-01-14 12:09:31 -02:00
Tomasz Maczukin 2c7d9cfa7d Move Ci::Build#available_statuses to AVAILABLE_STATUSES constant in CommitStatus 2016-01-14 14:59:04 +01:00
Rémy Coutable 1b08cd811a Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into add-pagination-headers-to-api 2016-01-14 14:23:42 +01:00
Rémy Coutable c31d777c8f Revert changes to how the notes are paginated in the API 2016-01-14 14:20:21 +01:00
Grzegorz Bizon f03da18e3a Merge branch 'ci/view-build-artifacts' into 'master'
Add browser for build artifacts

Discussion in #3426, closes #3426.

See merge request !2123
2016-01-14 12:57:33 +00:00
Tomasz Maczukin 405b82af23 Merge branch 'master' into ci/api-builds
* master: (51 commits)
  Fix version
  Fix specs and rubocop warnings
  Improve the consistency of commit titles, branch names, tag names, issue/MR titles, on their respective project pages
  fixed LDAP activation on login to use new ldap_blocked state
  Fix Admin/Users view to position buttons without spacing magic
  Update to Go 1.5.3
  Fix the undefinded variable error in Project's safe_import_url method
  Update CHANGELOG [ci skip]
  Add some cosmetic changes to variables API documentation [ci skip]
  Fix misaligned edit button in milestone collection partial
  Update button styles for Milestones#show
  Modify builds API documentation style [ci skip]
  Modify :ci_variable factory
  Ensure the API doesn't return notes that the current user shouldn't see
  Add 'Build' prefix to Variables entry name in API docs index
  Fix some typos
  Add spec for Note#cross_reference_not_visible_for?
  Remove (invalid) timestamp formatting
  Move `BroadcastMessage#status` to a helper since it's presentational
  Update CHANGELOG
  ...

Conflicts:
	doc/api/README.md
	lib/api/api.rb
	lib/api/entities.rb
2016-01-14 13:30:18 +01:00
Douwe Maan 6b000bee8c Merge branch 'master' into diff-parse-first-commit 2016-01-14 13:11:12 +01:00
Tomasz Maczukin af3b97cdde Merge branch 'master' into ci/api-triggers
* master:
  Fix version
  Improve the consistency of commit titles, branch names, tag names, issue/MR titles, on their respective project pages
  Update CHANGELOG [ci skip]
  Add some cosmetic changes to variables API documentation [ci skip]
  Modify builds API documentation style [ci skip]
  Modify :ci_variable factory
  Add 'Build' prefix to Variables entry name in API docs index
  Fix some typos
  Add some fixes after review
  Remove blank line
  Update ./doc/api
  Change :variable_id to :key as resource ID in API
  Fix a typo in method description
  Add create feature to variables API
  Add missing 'not_found' checks in variables API
  Add delete feature to variables API
  Add update feature for variables API
  Add features for list and show details of variables in API

Conflicts:
	doc/api/README.md
	lib/api/entities.rb
2016-01-14 13:09:54 +01:00
Douwe Maan 05187f0fc6 Properly generate diff of orphan commits, like the first commit in a repository 2016-01-14 13:09:36 +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 154b8ceba4 Refactor build artifacts upload API endpoint 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