Commit Graph

741 Commits

Author SHA1 Message Date
digitalMoksha 30a9fc33f3 static-analysis fix 2017-11-25 15:20:24 +01:00
digitalMoksha 3bb103f282 refactored the hashed repository name 2017-11-25 14:23:41 +01:00
digitalMoksha 17069a9547 ignore hashed repositories when doing rake gitlab:cleanup:dirs 2017-11-24 19:29:25 +01:00
Gabriel Mazetto d0a08ab888 Improve storage migration rake task 2017-11-23 14:19:36 +01:00
Jacob Vosmaer (GitLab) 571f1dda17 Add FetchSourceBranch Gitaly call 2017-11-22 10:19:42 +00: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
Brett Walker 5e861a0525 ignore hashed repos (for now) when using `rake gitlab:cleanup:repos` 2017-11-21 20:26:53 +00:00
Alejandro Rodríguez c33ca9d807 Use `make install` for Gitaly setups in non-test environments 2017-11-21 17:45:36 +00:00
Jacob Vosmaer (GitLab) 6f1e9f7ef7 Fix slow gitaly dev test bundle 2017-11-21 12:28:02 +00:00
digitalMoksha d8dee231bf remove the rake task `gitlab:sidekiq:drop_post_receive`
This task is no longer being used and is not documented.
2017-11-20 17:23:12 +01: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
James Lopez 1c8af321dd Improve GitLab Import rake task to work with Hashed Storage and Subgroups 2017-11-07 19:11:42 +00:00
digitalMoksha 734fab8a6b show better message when deciding not to continue 2017-11-07 16:10:57 +01:00
digitalMoksha 52bacf96b1 Make warning message more explicit 2017-11-07 15:29:04 +01: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
Douwe Maan cd3b4ba4ab Remove gitlab:users:clear_all_authentication_tokens rake task 2017-11-02 11:39:02 +01:00
Rémy Coutable b2373e3d6c
Ensure the ee-compat-check uses the correct patch URL for forks
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-31 17:44:07 +01:00
Rémy Coutable a5cc1c2613 Improve the gitlab:dev:ee_compat_check task to pass a repo URL without credentials
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-18 15:10:31 +02:00
Rémy Coutable c2efb6b193
Fix the ee_compat_check task for forks
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-06 12:20:03 +02:00
Zeger-Jan van de Weg 4656283c5c
Gitaly namespace service enabled for GitLab 2017-10-05 14:11:32 +02:00
Tim Zallmann 412571a4df Load only the currently needed JS locale file 2017-10-04 11:23:52 +00:00
Jacob Vosmaer e5fecc3a37 Create repositories via Gitaly 2017-09-29 18:27:06 +02:00
Gabriel Mazetto f4de14d71f
Add support to migrate existing projects to Hashed Storage async 2017-09-28 16:32:14 +01: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
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
Lin Jen-Shin 6be736a7d2 Enable ee_compat_check for forks, but not EE
We exclude known EE projects, and check the project directory
name for EE forks.
2017-09-15 02:06:48 +08:00
Gabriel Mazetto 2c489f8289 Refactor on namespace and repository checks and added specs 2017-09-12 06:57:22 +02:00
Gabriel Mazetto cc28abeafd Detect orphaned repositories and namespaces in any storage 2017-09-12 04:06:00 +02:00
Yorick Peterse 235b105c91
Finish migration to the new events setup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.

While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
2017-09-06 16:40:31 +02:00
Sean McGivern 446c7fc6f1 Merge branch 'system-checks-incoming-email' into 'master'
Move Incoming Email checks to System Checks

See merge request !14028
2017-09-06 09:02:47 +00:00
Nick Thomas 48115be509 Add a system check for the git user's custom SSH configuration 2017-09-04 18:16:31 +01:00
Gabriel Mazetto 71000b394b Refactored Incoming Email checks to use SystemCheck library 2017-09-04 04:25:58 +02:00
Lin Jen-Shin c5553ce772 Use `git update-ref --stdin -z` to delete refs 2017-08-30 22:01:23 +08:00
Maxim Rydkin 6a56bec735 replace `is_gitlab_user?` with `gitlab_user?` 2017-08-29 11:14:41 +03:00
Bob Van Landuyt d8d2b73b9f Improve bare repository import
- Allow imports into nested groups
- Make sure it sets the correct visibility level when creating new
  groups

While doing this, I moved the import into a testable class, that made
it easier to improve.
2017-08-23 13:36:37 +02:00
Gabriel Mazetto 78823675b2 Prevent using gitlab import task when hashed storage is enabled 2017-08-22 06:33:20 +02:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Z.J. van de Weg 6391406774
Add two more project templates
Related to !13108. Mostly this is just running the rake task and
changing the task a bit to catch cases like the project already existing
or so. The rake task moves archives to the vendor/project_template
directory, which are checked in too.
2017-08-15 12:55:54 +02:00
Jacob Vosmaer fab0c1eb80 Use existing BUNDLE_PATH for gitaly in local tests 2017-08-11 15:49:50 +02:00
Robert Speicher 420d835e5f Merge branch '36003-do-not-include-to-kernel' into 'master'
Don't include anything to Kernel only because of tasks

Closes #36003

See merge request !13380
2017-08-09 16:35:33 +00:00
Lin Jen-Shin 5d963fccab We shouldn't include utility methods everywhere 2017-08-08 23:14:29 +08:00
Lin Jen-Shin e26acdb11b Just extend main, rather than include to Kernel
Unfortunately rake doesn't have nested context,
everything just runs on a main rake object.
This is probably due to compatibility issue,
but anyway, we could just extend the object.
2017-08-08 22:20:16 +08:00
Jacob Vosmaer 5684528081 Unset BUNDLE_GEMFILE when installing Gitaly 2017-08-08 15:34:29 +02:00
Rémy Coutable feb8974cc8 Merge branch '35941-fix-testing-issue-following-gitaly-install-fix' into 'master'
Unset the `RUBYOPT` env variable before installing `gitaly-ruby`

Closes #35941 and #35967

See merge request !13313
2017-08-08 09:39:49 +00:00
Sean McGivern 4c8b666893 Merge branch 'zj-project-templates' into 'master'
Allow projects to be started from a template

Closes #32420

See merge request !13108
2017-08-07 19:24:14 +00:00
Z.J. van de Weg db65499e26
Fix last feature test for project templates 2017-08-07 15:32:43 +02:00
Z.J. van de Weg 2e6aa4f25e
After merge cleanup 2017-08-07 15:09:14 +02:00
Filipa Lacerda 3b9012871d Merge branch 'master' into zj-project-templates
* master: (623 commits)
  Fix issues with pdf-js dependencies
  fix missing changelog entries for security release on 2017-01-23
  Update top bar issues icon
  Fix pipeline icon in contextual nav for projects
  Since mysql is not a priority anymore, test it less
  Fix order of CI lint ace editor loading
  Add container registry and spam logs icons
  Fix different Markdown styles
  Backport to CE for:
  Make new dropdown dividers full width
  Fix spec
  Fix spec
  Fix spec
  Bump GITLAB_SHELL_VERSION and GITALY_VERSION to support unhiding refs
  Add changelog
  Install yarn via apt in update guides
  Use long curl options
  fix
  Add a spec for concurrent process
  Remove monkey-patched Array.prototype.first() and last() methods
  ...
2017-08-07 11:09:50 +01:00
Rémy Coutable 21937a157d
Print the setup steps and duration and fix an issue resulting in re-setuping GitLab Shell on each test run
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-04 17:27:50 +02:00
Rémy Coutable 201ce2cb55
Unset the RUBYOPT env variable before installing gitaly-ruby
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-04 16:10:52 +02:00
Rémy Coutable 805a28e6a1 Revert "Merge branch 'fix-gitaly-install' into 'master'"
This reverts commit 23c502b434, reversing
changes made to 1018ab0516.
2017-08-04 15:59:30 +02:00
Kim "BKC" Carlbäcker a92ccbcb9e Have raketask tell gitaly where to find shell 2017-08-04 13:54:41 +02:00
Rémy Coutable 6a29d3a487 Ensure we run installation Rake tasks in a clean env in TestEnv
If we call `system('rake', 'taks_name')`, `ENV['RUBYOPT']` is set to
`'-rbundler/setup'` but some tasks (e.g. `gitlab:gitaly:install` need
a clean env since they install their own Gem bundle.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-02 19:02:01 +02:00
Sean McGivern 90cb2aab38 Merge branch '28283-legacy-storage-format' into 'master'
[CE] Added Legacy Storage format

See merge request !13149
2017-08-01 12:24:24 +00:00
Z.J. van de Weg 09974de3e3
Create rake task to create project templates
First iteration, and some stuff is missing. But basically this rake task
does a clone of a project we've pointed it to. Than creates a project on
the GDK, which should be running in the background. This project is
exported, after which we move that archive to the location we need it.
We clean up by removing the generated project.

The first idea was to export the project on .com too, however than we
might run into ImportExport versions mismatch. This could've been
circumvented by checkout out an older commit locally. This however is
not needed yet, so we opted to not go this route yet, instead we will
iterate on what we got.
2017-08-01 13:00:51 +02:00
Jacob Vosmaer e99564568b CI fixes for gitaly-ruby 2017-08-01 10:48:46 +02:00
Gabriel Mazetto fb06a4d8fe Rename more path_with_namespace -> full_path or disk_path 2017-08-01 07:28:13 +02:00
Jacob Vosmaer 1631ad02fd Support the fact that Gitaly uses bundler 2017-07-27 16:35:40 +02:00
Phil Hughes 3256f6f404 Compile JS lang files before webpack compile
Closes #35615
2017-07-27 08:41:47 +01:00
Alejandro Rodríguez c9c0606297 Improve version handling on component install tasks
Fixes an issue where, when using branch versions, the component wouldn't
be updated after the first branch checkout. We also save one step, since
checking out the FETCH_HEAD with `-f` already does what `reset --hard`
did.
2017-07-20 17:30:29 -04:00
Timothy Andrew 8fa08ea3cd Implement review comments for !11963 from @adamniedzielski.
- Change double quotes to single quotes.
- Why is `OmniAuth.config.full_host` being reassigned in the integration test?
- Use `map` over `map!` to avoid `dup` in the `gitlab:info` rake task
- Other minor changes
2017-07-06 06:30:07 +00:00
Timothy Andrew 56754848dd Don't allow the `gitlab:env:info` rake task to mutate the list of omniauth providers.
- The test for `rake gitlab:env:info` executed the rake task, which mutated the
  list of omniauth providers, breaking subsequent tests relying on this list.

- I've changed the rake task to duplicate the providers list before modifying it.
2017-07-06 06:30:07 +00:00
Jacob Vosmaer 218da88e1a Enable gitaly token auth when testing 2017-06-20 17:42:54 +02:00
Alejandro Rodríguez 58821ebbb4 Stop using deprecated `path` field on Gitaly messages
This revealed an error in our configuration generation in
gitlab:gitaly:install rake task. The fix is included
2017-06-14 19:33:43 -04:00
Douwe Maan f1e4376fb9 Don't check if MailRoom is running on Omnibus 2017-06-09 10:58:11 -05:00
Nick Thomas b2800ee0c7 Add a Rake task to aid in rotating otp_key_base 2017-06-05 22:17:52 +01:00
Gabriel Mazetto d219f9a691 Fix BasicExecutor specs 2017-05-31 14:33:03 +02:00
Gabriel Mazetto 3f187751d4 Fixed and improved some existing checks and SystemCheck library 2017-05-31 14:33:03 +02:00
Gabriel Mazetto ecdbde3d95 Improve Specs and some fixes 2017-05-31 14:33:03 +02:00
Gabriel Mazetto 27e632758f Add ActiveUsers Check 2017-05-31 14:33:03 +02:00
Gabriel Mazetto 13e88c9395 Refactor gitlab:app:checks to use SystemCheck 2017-05-31 14:33:03 +02:00
Gabriel Mazetto 500e5227a0 WIP SystemCheck library for executing checks from a rake task 2017-05-31 14:33:03 +02:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Ahmad Sherif b03179b4a6 Print Go version in rake gitlab:env:info 2017-05-10 15:35:02 +02:00
Jacob Vosmaer 3960d974c3 Compile gitlab-shell go executables 2017-05-04 11:21:51 +02:00
Nick Thomas 1a168dc7a5 Fix caching large snippet HTML content on MySQL databases 2017-05-03 15:27:45 +01:00
Mike Ricketts 923d242890 #31560 Add repo parameter to gitaly:install and workhorse:install 2017-05-02 16:58:37 +00:00
Zeger-Jan van de Weg df85a7c004 Submodule Dockerfile templates 2017-04-26 15:57:44 +00:00
Rémy Coutable a9a1f7a61a Merge branch 'gitaly-testing-toml' into 'master'
Gitaly testing toml

Closes gitaly#182

See merge request !10605
2017-04-25 08:21:06 +00:00
Alejandro Rodríguez 476037b05b Configure Gitaly through settings file instead of ENV vars 2017-04-18 22:43:41 -03:00
Rémy Coutable e33606556f Merge branch 'branch-versions' into 'master'
Expand components version specification format to allow branches

Closes gitaly#183

See merge request !10610
2017-04-14 08:29:47 +00:00
Alejandro Rodríguez e61325ff43 Expand components version specification format to allow branches
Currently we specify versions for Gitlab-Shell, Workhorse and Gitaly
using version strings, to which we prepend 'v' and assume are tags.
These changes allow branches or tags with other name formats to be
specified by prepending '=' to the version string (á la govendor).

We also simplify the process to reset to the given version (now a
branch or tag): Right now there's a check to supposedly try to avoid
fetching from the remote the version if it already exist locally. But
the previous logic already clones if the directory doesn't exist or
fetches if it does, so this check is pointless. We can safely assume the
version exists once we get to the reset stage.
2017-04-13 17:32:00 -03:00
Rémy Coutable 755325c827 Fix the `gitlab:gitlab_shell:check` task
Make the `gitlab:gitlab_shell:check` task check that the repositories storage
path are owned by the `root` group

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-12 17:40:19 +02:00
Adam Niedzielski 7dfeaabb5a Include CONTRIBUTING.md file when importing .gitlab-ci.yml templates 2017-04-12 14:38:59 +02:00
Ahmad Sherif 62521f20e4 Add rake task that prints TOML storage configuration
Closes gitaly#173
2017-04-04 19:35:35 +02:00
Sebastian Reitenbach d8569440b5 There might be ps utilities out there, that assume 80chars instead
of unlimited width if they cannot detect terminal size, therefore
force unlimited terminal size when checking processes via ps.
2017-03-28 23:15:17 +02:00
Robert Speicher fc830c6ff5 Merge branch 'gitaly-install-rake' into 'master'
Docs and scripts to install Gitaly from source

Closes gitaly#136 and #28446

See merge request !9941
2017-03-21 15:32:58 +00:00
Mike Greiling 2d46a5722f Resolve "Circular dependency detected" (duplicate) 2017-03-21 14:40:34 +00:00
Jacob Vosmaer 49a9c2fbef Print command output when a task failed
This helps you understand why the command failed.
2017-03-21 14:55:41 +01:00
Jacob Vosmaer 3883a5f906 Rake task that can install gitaly at a tag version 2017-03-21 14:55:41 +01:00
Z.J. van de Weg 3ebd29b538 Futher rename the CI variables 2017-03-16 08:49:01 +01:00
Douwe Maan e4551749c0 Only check new migrations in 'rake down_timecheck' 2017-03-08 17:33:53 -06:00
Sean McGivern a5db7f5425 Merge branch '28447-hybrid-repository-storages' into 'master'
Update storage settings to allow extra values per shard

See merge request !9597
2017-03-07 16:55:03 +00:00
Alejandro Rodríguez 0b9d56f960 Update storage settings to allow extra values per shard
This will be necessary when adding gitaly settings. This version
doesn't make any functional changes, but allows us to include this
breaking change in 9.0 and add the needed extra settings in the future
with backwards compatibility
2017-03-03 12:13:30 -03:00
Semyon Pupkov e73b68a742 Add git version to gitlab:env:info
https://gitlab.com/gitlab-org/gitlab-ce/issues/25376
2017-02-28 20:42:13 +05:00
Douwe Maan f88ff0cc0c Stylistic tweaks 2017-02-23 09:33:20 -06:00
Douwe Maan 87c9df29ce Don’t exclude some file in lib from rubocop 2017-02-23 09:32:42 -06:00
Gabriel Mazetto 649a1fcf15 Fix incomming email check task to use same patch we did in mail_room 2017-02-21 18:50:28 +01:00
Mike Greiling e652987947 ensure rake tasks produce helpful error messages for node dependency issues 2017-02-15 23:46:29 -06:00
Connor Shea b39421bded Fixed backup.rake colorize method following Pages -> CE
Cherry-picked 'Remove colorize methods that weren't in CE.'
2017-02-07 14:43:32 +00:00
James Edwards-Jones b988faaf85 Merge branch 'master' into 'jej-pages-to-ce'
# Conflicts:
#   db/schema.rb
2017-02-06 15:12:27 +00:00
Mike Greiling 04dc2b76d7 Merge branch 'master' into go-go-gadget-webpack
* master: (181 commits)
  Fixed adding to list bug
  Remove unnecessary queries for .atom and .json in Dashboard::ProjectsController#index
  Fixed modal lists dropdown not updating when list is deleted
  Fixed remove btn error after creating new issue in list
  Removed duplicated test
  Removed Masonry, instead uses groups of data
  Uses mixins for repeated functions
  Fixed up specs
  Props use objects with required & type values
  Removes labels instead of closing issue when clicking remove button
  Fixed JS lint errors
  Fixed issue card spec
  Added webkit CSS properties
  Fixed bug with empty state showing after search Fixed users href path being incorrect
  Fixed bug where 2 un-selected issues would stay on selected tab
  Fixed DB schema Changed how components are added in objects
  Added remove button
  Add optional id property to the issue schema
  Fixed issue link href
  Disabled add issues button if no lists exist
  ...
2017-02-03 13:17:03 -06:00
James Edwards-Jones 1af3f3b673 Merge branch 'master' into jej-pages-picked-from-ee 2017-02-03 17:25:26 +00:00
Dmitriy Zaporozhets 7dc8b6b204 Merge branch 'fwn-to-find-by-full-path' into 'master'
replace `find_with_namespace` with `find_by_full_path`

See merge request !8949
2017-02-03 11:23:21 +00:00
Adam Pahlevi a0586dbc16 replace `find_with_namespace` with `find_by_full_path`
add complete changelog for !8949
2017-02-03 07:14:04 +07:00
Kamil Trzcinski 120f9abaa1 Add GitLab Pages
- The pages are created when build artifacts for `pages` job are uploaded
- Pages serve the content under: http://group.pages.domain.com/project
- Pages can be used to serve the group page, special project named as host: group.pages.domain.com
- User can provide own 403 and 404 error pages by creating 403.html and 404.html in group page project
- Pages can be explicitly removed from the project by clicking Remove Pages in Project Settings
- The size of pages is limited by Application Setting: max pages size, which limits the maximum size of unpacked archive (default: 100MB)
- The public/ is extracted from artifacts and content is served as static pages
- Pages asynchronous worker use `dd` to limit the unpacked tar size
- Pages needs to be explicitly enabled and domain needs to be specified in gitlab.yml
- Pages are part of backups
- Pages notify the deployment status using Commit Status API
- Pages use a new sidekiq queue: pages
- Pages use a separate nginx config which needs to be explicitly added
2017-01-31 22:50:39 +00:00
Rémy Coutable 89a2438ab4
Fix wrong call to ProjectCacheWorker.perform
It's either ProjectCacheWorker#perform or
ProjectCacheWorker.perform_async!

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-31 17:42:33 +01:00
Mike Greiling abb122a44f update rake tasks 2017-01-28 11:42:48 -06:00
Mike Greiling c454dec170 Merge branch 'master' into go-go-gadget-webpack
* master: (33 commits)
  Improved code style on the issue_sidebar_spec.rb
  add CHAGELOG.md entry for !8831
  remove assets:compile step from relative_url docs
  update scripts and docs to reference the newly namespaced rake task
  namespace assets rake tasks to gitlab:assets:*
  correct gzip files if they exist as well
  automatically correct CSS urls on assets:precompile
  remove hard-coded assets path for ace editor modules
  Fixed cancel button in the services form not redirecting back to the integrations settings view
  Fix search bar search param encoding
  Fix a transient failure in the `Explore::ProjectsController` spec
  Fix filtering with multiple words
  Fix project name label's for reference in project settings
  Fixed merge request tabs extra margin
  Don't call `#uniq` on a relation
  Move Gitlab::Shell and Gitlab::ShellAdapter files to lib/
  Move ApplicationSetting DEFAULTS to `.defaults` instead
  Move a begin/rescue clause to ApplicationSetting.expire
  Use badge partial as single source of truth instead of having 2 partials doing the same
  Changes after review
  ...
2017-01-28 11:25:15 -06:00
Mike Greiling 69e4072f89 Merge branch 'master' into go-go-gadget-webpack
* master: (389 commits)
  Document "No gems fetched from git repositories" policy [ci skip]
  Typos
  Small gramatical tweaks
  Typos
  Added PHP & NPM doc
  Use `:empty_project` where possible in request specs
  Add caching of droplab ajax requests
  Use `:empty_project` where possible in model specs
  Revert 3f17f29a
  Remove unused js response from refs controller
  Add MR id to changelog entry
  fixed small mini pipeline graph line glitch
  Prevent form to be submitted twice
  Fix Error 500 when repositories contain annotated tags pointing to blobs
  Fix /explore sorting (trending)
  Simplify wording in "adding an image" docs
  Remove "official merge window" from CONTRIBUTING.md [ci skip]
  Update repository check documentation
  Fixed flexbox and wrap issues
  Update two_factor_authentication.md
  ...
2017-01-27 19:33:58 -06:00
Mike Greiling 336d780d95 namespace assets rake tasks to gitlab:assets:* 2017-01-27 15:21:30 -06:00
Stan Hu 1e2a960467 Merge branch 'mrchrisw/rake-redis' into 'master'
Add redis version to info rake task

See merge request !8283
2017-01-25 04:12:12 +00:00
Chris Wilson 05a5ae2ff2 Add redis version to info rake task 2017-01-24 18:55:59 -06:00
Phil Hughes 639bca4362 Merge branch 'master' into go-go-gadget-webpack 2017-01-13 10:30:40 -05:00
Douwe Maan 3eebca7b5c Merge branch 'use-configured-git' into 'master'
Use configured git rather thans system git

See merge request !8460
2017-01-12 18:27:33 +00:00
Mike Greiling 0e4aaa06d3 remove remaining vestiges of teaspoon test runner 2017-01-10 12:30:41 -06:00
Luke "Jared" Bennett 7c47cc94c5 Swapped out teaspoon for karma 2017-01-10 12:30:40 -06:00
Adam Niedzielski fc6b9a1014 Do not remove "autodeploy" directory when fetching CI templates 2017-01-10 17:49:50 +01:00
Robert Schilling 22a34c81aa Use configured git rather than system git 2017-01-05 13:46:26 +01:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
Markus Koller 6fd58ee48d
Remove rake task update_commit_count 2016-12-21 16:36:53 +01:00
Drew Blessing e0eb86ee80 Add LDAP task to rename a provider
Sometimes admins will change the LDAP configuration, not realizing
that problems will occur if the user's LDAP identities are not
also updated to use the new provider name. This task will give
admins a single command to run to update identities and will
prevent having to run multiple Rails console queries.
2016-12-16 09:57:05 -06:00
Rémy Coutable 2c0bcefdc6
Don't allow to specify a repo or version when installing Workhorse
The task will use the canonical repo and the required version.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-01 19:22:46 +01:00
Rémy Coutable b193e84974
Move task helpers to a module
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-30 12:20:21 +01:00
Rémy Coutable a9c250eadd Add #run_command! to task helpers to raise a TaskFailedError if status is not 0
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-30 10:35:17 +01:00
Rémy Coutable fbbf177e3b New `gitlab:workhorse:install` rake task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-30 10:34:59 +01:00
Kamil Trzciński e4c86bc887 Merge branch 'zj-rake-task-remove-faulty-deployment-refs' into 'master'
Fix faulty deployment refs

In the 8.13 RC cycle, so before the release, there was a time in which
references in git where stored by id instead of iid. This could be fixed
by time, if the iid catches up with the id, it overwrites it. But in the
mean time we have wrong refs in the folder.

This commit fixes that. For all projects we have deployments we'll find
the ones where the ref has a higher number than the iid is now and calls
`#create_ref` on the corresponding deployment.

Fixes gitlab-com/infrastructure#683

cc @ayufan 

One worry: I tested this locally, couldn't find a way to do automate this.

See merge request !7352
2016-11-19 10:59:31 +00:00
Z.J. van de Weg f20eadcbbe Fix faulty deployment refs
In the 8.13 RC cycle, so before the release, there was a time in which
references in git where stored by id instead of iid. This could be fixed
by time, if the iid catches up with the id, it overwrites it. But in the
mean time we have wrong refs in the folder.

This commit fixes that. For all projects we have deployments we'll find
the ones where the ref has a higher number than the iid is now and calls
`#create_ref` on the corresponding deployment.
2016-11-18 15:47:20 +01:00
Rémy Coutable 8bacdfb243
Use the public CE repo URL instead of the one used in the runner
This will prevent the task to advertise using
https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.com/gitlab-org/gitlab-ce.git
when https://gitlab.com/gitlab-org/gitlab-ce.git is enough

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-17 18:39:55 +01:00
Rémy Coutable 88edbd11a9
Improve EeCompatCheck, cache EE repo and keep artifacts for the ee_compat_check task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-10 10:40:47 +01:00
Drew Blessing dc30783057 Introduce better credential and error checking to `rake gitlab:ldap:check`
It was previously possible for invalid credential errors to go unnoticed
in this task. Users would believe everything was configured correctly and
then sign in would fail with 'invalid credentials'. This adds a specific
bind check, plus catches errors connecting to the server. Also, specs :)
2016-11-08 15:46:10 -06:00
Robert Speicher 4ba789cd40 Remove unused `gitlab:generate_docs` Rake task
This was the only thing using the `sdoc` gem, which was blocking another
gem from updating.
2016-11-03 17:25:58 +00:00
Drew Blessing af5322e90b Add Rake task to create/repair GitLab Shell hooks symlinks 2016-11-01 14:52:59 -05:00
Rémy Coutable af669cbea3
Change the approach to check if patches apply cleanly
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-21 19:16:56 +02:00
Valery Sizov 0c0caede85 Fix: Backup restore doesn't clear cache 2016-10-20 17:33:12 +03:00
Rémy Coutable 2650d5f895 Improve the branch existence and merge checks
Also add a safeguard for non-CI env.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-13 17:42:06 +02:00
Rémy Coutable 069f2d3475 Draft a quick CE->EE merge check rake task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-13 17:42:05 +02:00
Achilleas Pipinellis 38978fa53f Merge branch 'docs/refactor-reply-by-email' into 'master'
Move reply by email docs to a new location

## What does this MR do?

Move reply by email docs to a new location.

Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/3349

## Moving docs to a new location?

See the guidelines: http://docs.gitlab.com/ce/development/doc_styleguide.html#changing-document-location

- [ ] Make sure the old link is not removed and has its contents replaced with a link to the new location.
- [ ] Make sure internal links pointing to the document in question are not broken.
- [ ] Search and replace any links referring to old docs in GitLab Rails app, specifically under the `app/views/` directory.
- [ ] If working on CE, submit an MR to EE with the changes as well.

See merge request !6517
2016-10-11 13:27:23 +00:00
Rémy Coutable ebba491493
Add a new gitlab:users:clear_all_authentication_tokens task
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-11 10:21:18 +02:00
Justin DiPierro fe46e4eb35 Load Github::Shell's secret token from file on initialization instead of every request. 2016-10-06 11:22:37 -04:00
Achilleas Pipinellis dffd33252f Move reply by email docs to a new location
[ci skip]
2016-09-25 11:55:14 +02:00
bogdanvlviv 96ebc8c4f7 Use `File::exist?` instead of `File::exists?`
Since version ruby-2.2.0, method `File::exists?` is deprecated.
2016-08-11 13:54:45 +03:00
Robert Speicher 12e93d6f4b Rename `run` task helper method to prevent conflict with StateMachine
This prevents the following message from appearing whenever running a
Rake task:

    Instance method "run" is already defined in Object, use generic
    helper instead or set StateMachines::Machine.ignore_method_conflicts
    = true.
2016-08-09 18:31:51 -05:00
Herminio Torres f15ed5f0a5
Fix Rename `add_users_into_project` and `projects_ids`
We never add things `into` projects, we just add them `to` projects. So how about we rename this to `add_users_to_project`.

Rename `projects_ids` to `project_ids` by following the convention of rails.
2016-08-04 08:55:50 -03:00
Stan Hu 8a62f4e7d4 Update the gitlab-shell version in the tmp/tests directory to the right version
Previously the gitlab-shell version would never be updated if the directory
existed via the `gitlab🐚install` Rake task. This could lead to
incompatibility issues or random errors.
2016-08-03 11:39:19 -07:00
Drew Blessing cfd103dbb5 Disable MySQL foreign key checks before dropping all tables 2016-07-25 21:16:54 -05:00
Robert Speicher cf6de7dae9 Merge branch 'migration-downtime-tags' into 'master'
Added checks for migration downtime

This adds a set of checks that check/list which migrations require downtime (or not). It also comes with a CI task that fails should a migration not be tagged properly.

Fixes #14545

See merge request !4911
2016-07-20 17:03:04 +00:00
M. Ricketts 6d324f082e Use limit parameter rather than hardcoded value 2016-07-20 16:37:40 +02:00
Yorick Peterse a8bfe20d0d
Added checks for migration downtime
These new checks can be used to check if migrations require downtime or
not (as tagged by their authors). In CI this compares the current branch
with master so migrations added by merge requests are automatically
verified.

To check the migrations added since a Git reference simply run:

    bundle exec rake gitlab:db:downtime_check[GIT_REF]
2016-07-20 12:41:56 +02:00
Yorick Peterse 499cdf1d19
Added Rake task for tracking deployments
This simply inserts the current GitLab version in the "deployments"
measurement.

Fixes gitlab-com/infrastructure#98
2016-07-19 13:21:09 +02:00
Rémy Coutable 0144dce7ee Merge branch 'fix_restore_warning' into 'master'
Fix restore warning message

## What does this MR do?

Fix the restore Rake task so it properly outputs the database warning. This is a pretty important warning and it was not even being output. After this fix, the output looks like the screenshot below.

![Screen_Shot_2016-06-28_at_3.53.46_PM](/uploads/d250189d39fcacd0c8ec0aacf9cd930d/Screen_Shot_2016-06-28_at_3.53.46_PM.png)

See merge request !4980
2016-06-30 17:07:52 +00:00
Alejandro Rodríguez 20b9bb2029 Create (if necessary) and link the gitlab-shell secret file on the rake install task 2016-06-29 22:30:33 -04:00
Alejandro Rodríguez 86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Drew Blessing 3ce174c370 Fix restore warning message 2016-06-28 15:54:40 -05:00
James Lopez 3a7eb38a78 added nice to have - rake task and some changes to docs 2016-06-21 19:23:21 +02:00
Z.J. van de Weg bbfd62bc34 fixup! override content method 2016-06-20 14:48:28 -05:00
Z.J. van de Weg 483dc62eaa Incorporate review 2016-06-20 14:48:28 -05:00
Z.J. van de Weg 96ae6099dd Run rake gitlab:update_templates 2016-06-20 14:48:28 -05:00
Z.J. van de Weg 620d014aef Implement backend gitlab ci dropdown
This commit builds on the groundwork in
ee008e300b1ec0abcc90e6a30816ec0754cea0dd, which refactored the backend
so the same code could be used for new dropdowns. In this commit its
used for templates for the `.gitlab-ci.yml` files.
2016-06-20 14:48:28 -05:00
ZJ van de Weg 27bf7ae59e Refactor Gitlab::Gitignores 2016-06-20 14:48:28 -05:00
Stan Hu bf92ea687f Properly quote table name in Rake task for MySQL and PostgreSQL compatibility
!4318 broke the gitlab:db:drop_tables functionality for PostgreSQL.

Closes #15259
2016-06-09 15:06:19 -07:00
Stan Hu 4fbb284cfd Merge branch 'fix_issue_15259' into 'master'
Fix bug with SQL syntax error during backup restoration

## What does this MR do?
It properly escapes the table name in the `DROP TABLE IF EXISTS ...` statement used during restore of a backup.

## Are there points in the code the reviewer needs to double check?
Please check compatibility with PostgreSQL

## Why was this MR needed?
Fix an issue with backups can not be restored if MySQL is used as database for GitLab.

## What are the relevant issue numbers?
#15259 

## Screenshots (if relevant)
-

See merge request !4318
2016-06-09 21:44:10 +00:00
Connor Shea efb7da68e6
Fix missed colorize methods. 2016-06-06 15:32:36 -06:00
Connor Shea 903946c78a
Replace colorize gem with rainbow.
Colorize is a gem licensed under the GPLv2, so we can’t use it in GitLab without relicensing GitLab under the terms of the GPL. Rainbow is licensed under the MIT license and does the exact same thing as Colorize, so Rainbow was added in place of Colorize.

The syntax is slightly different for Rainbow vs. Colorize, and was updated in accordance.

The gem is still a dependency of Spinach, so it’s included in the development/test environments, but won’t be packaged with the actual product, and therefore doesn’t require we relicense the product.

An attempt at relicensing Colorize was made, but didn’t succeed as the library owner never responded.

Rainbow library: https://github.com/sickill/rainbow
Relevant issue regarding licensing in GitLab's gems: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3775
2016-06-03 10:37:09 -06:00
Daniel Beyer 97aecdeade Fix bug with SQL syntax error during backup restoration
closes #15259
2016-05-27 13:35:12 +02:00
DJ Mountney 1a7326ba9a Switch the gitlab:db:configure task to use tables.any? instead of looking specifically for the schema_migrations table 2016-05-25 10:47:09 -07:00
DJ Mountney 24632d2150 Update hash syntax and add changelog for the gitlab:db:configure rake task 2016-05-25 10:44:22 -07:00
DJ Mountney c6e7d826b2 Add a gitlab:db:configure rake task to handle conditionally seeding or migrating the database. 2016-05-25 10:44:22 -07:00
Kamil Trzcinski 12bd781031 Fix backups if registry is disabled 2016-05-23 14:18:39 -05:00
Zeger-Jan van de Weg 79620c501d Update API and fetching task 2016-05-20 15:58:36 -05:00
Zeger-Jan van de Weg e166a8022a Backend for a gitignores dropdown 2016-05-20 15:58:36 -05:00
Jazz 8eb1748ab2 Fixed advice on invalid permissions on upload path 2016-05-19 16:53:47 +02:00
Kamil Trzcinski 143cd58c39 Added backup of container registry 2016-05-16 17:25:38 -05:00
Drew Blessing 10d4d5842b Add if exists to drop command 2016-05-09 12:20:18 -05:00
Drew Blessing 50d18a1e1d Rake drop tables with cascade 2016-05-03 09:29:15 -05:00
Yorick Peterse a54af831ba
Use rake db:reset instead of db:setup
Using db:reset ensures existing tables are first dropped. This in turn
ensures that we can drop tables regardless of any foreign key
constraints. While CE currently doesn't have any foreign keys EE defines
the following relation:

    remote_mirrors.project_id -> projects.id

MySQL will complain whenever you try to drop the "projects" table first
even when using "DROP TABLE ... CASCADE".
2016-04-14 15:53:54 +02:00
Rémy Coutable 9f218fc184 Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature
A few things to note:
- The IncomingEmail feature is now enabled even without a
  correctly-formatted sub-address
- Message-ID for new thread mail are kept the same so that subsequent
  notifications to this thread are grouped in the thread by the email
  service that receives the notification
  (i.e. In-Reply-To of the answer == Message-ID of the first thread message)
- To maximize our chance to be able to retrieve the reply key, we look
  for it in the In-Reply-To header and the References header
- The pattern for the fallback reply message id is "reply-[key]@[gitlab_host]"
- Improve docs thanks to Axil
2016-03-25 13:05:15 +01:00
Drew Blessing 5516b6c47f Reload the schema before restoring a database backup 2016-03-21 21:16:34 -05:00
Douwe Maan 7ae573c75a Bump Git version requirement to 2.7.3 2016-03-15 23:22:05 +01:00
ashleys 4cd9a5208c web hooks to webhooks 2016-03-10 14:48:29 -05:00
Douwe Maan e1baa48584 Fix `gitlab:incoming_email:check` task. 2016-02-29 11:04:40 +01:00
Marin Jankovski f317d5fcb9 Merge branch 'uploads-700' into 'master'
Restrict permissions on public/uploads

Based on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/631

See merge request !2764
2016-02-23 15:12:20 +00:00
Achilleas Pipinellis e5f9c4460f Remove remaining sqlite method call 2016-02-17 20:34:54 +02:00
Achilleas Pipinellis f8036ec910 Remove sqlite check in raketask 2016-02-10 16:54:15 +02:00
Achilleas Pipinellis a1a6f3cc73 Simplify permissions creation
[ci skip]
2016-02-10 16:52:02 +02:00
Achilleas Pipinellis 751ae14081 Restrict permissions on public/uploads 2016-02-09 11:35:19 +02:00
Robert Speicher e8785ded1e Prevent StateMachine warnings from outputting during a cron task
[ci skip]

Closes #5931
2016-01-15 17:47:56 -05:00
Robert Speicher a43fd5ce6d Disable colorization if STDOUT is not a tty 2016-01-12 21:34:23 -05:00
Stan Hu e57b506222 Suggest prefacing find command with sudo when base permissions are wrong
Closes #5872
2016-01-05 05:30:01 -08:00
Robert Speicher 28a8d0b5db Merge branch 'add_user_repo_integrity_rake_task' into 'master'
Add user repository integrity check rake task

Corrupt repositories and stuck lock files can cause weird issues in
GitLab. Often we know which user is having these problems and then we
have to go hunt down which repository is causing it. Several times
recently that involved me running queries in the rails console to get
an array of projects and then writing a quick Ruby script to loop
through and run `git fsck`. This last time I also had to check for the
existence of `config.lock` and ref lock files. 

This rake task will eliminate all of those steps and allow an admin to
simply specify a username.

I also added the lock file checks to the existing `gitlab:repo:check`
task which goes through all projects. 

See merge request !2080
2015-12-15 18:36:28 +00:00
Drew Blessing f8bf6c4b2c [ci skip] Add user repository integrity check rake task 2015-12-14 15:27:14 -06:00
Stan Hu 9c5d8079a3 Bump Redis requirement to 2.8 for Sidekiq 4 requirements
Closes #3649

[ci skip]
2015-12-12 07:51:50 -08:00
Stan Hu 1d410ac96a Update project repository size and commit count during import:repos task
Closes #3848
2015-12-08 09:08:22 -08:00
Douwe Maan 033947de90 Merge branch 'sync-all-repos' into 'master'
Sync all repos

Scripts and documentation for moving repos, used on gitlab.com.

See merge request !1439
2015-12-08 16:13:59 +00:00
Jacob Vosmaer 23f383ef69 Detect project and namespace changes in list:repos 2015-12-08 16:06:06 +01:00
Jacob Vosmaer 6d2be0212c Merge branch 'master' into sync-all-repos 2015-12-08 12:35:54 +01:00
Zeger-Jan van de Weg 3da32ef7d8 Merge branch 'master' into rake-tasks-git 2015-12-07 12:06:20 +01:00