Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !8168

Merged
Created 10 years ago by Administrator@rootOwner

Create dev fixture projects with fixed visibility

  • Overview 9
  • Commits 1
  • Changes 5

Created by: cirosantilli

Creates 3 new projects: one public, one private and one internal. For each project create a new user which is it's owner.

Really helpful to test cases things where visibility matters

Factor out Sidekiq::Testing.inline! do into the Seeder with 04_projects.

Create a fixtures_development_helper.rb helper file because I am pretty sure that will be reused afterwards.

Loading
Loading

  • Administrator
    Administrator @root · 10 years ago
    Owner

    Created by: TeatroIO

    I've prepared a stage. Click to open.

    By Administrator on 2014-10-26T10:32:42 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit a9fadce3 10 years ago
    db/fixtures/development/04_project.rb
    47 puts project.errors.full_messages
    48 print 'F'
    49 end
    1 Gitlab::Seeder.quiet do
    2 project_urls = [
    3 'https://github.com/documentcloud/underscore.git',
    4 'https://gitlab.com/gitlab-org/gitlab-ce.git',
    5 'https://gitlab.com/gitlab-org/gitlab-ci.git',
    6 'https://gitlab.com/gitlab-org/gitlab-shell.git',
    7 'https://gitlab.com/gitlab-org/gitlab-test.git',
    8 'https://github.com/twitter/flight.git',
    9 'https://github.com/twitter/typeahead.js.git',
    10 'https://github.com/h5bp/html5-boilerplate.git',
    11 ]
    12
    13 project_urls.each do |url|
    • Administrator
      Administrator @root · 10 years ago
      Owner

      Created by: houndci-bot

      Unused block argument - i. If it's necessary, use _ or _i as an argument name to indicate that it won't be used.

      By Administrator on 2014-10-26T10:34:56 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit a9fadce3 10 years ago
    db/fixtures/development/04_project.rb
    14 group_path, project_path = url.split('/')[-2..-1]
    15
    16 group = Group.find_by(path: group_path)
    17
    18 unless group
    19 group = Group.new(
    20 name: group_path.titleize,
    21 path: group_path
    22 )
    23 group.description = Faker::Lorem.sentence
    24 group.save
    25
    26 group.add_owner(User.first)
    27 end
    28
    29 project_path.gsub!('.git', '')
    • Administrator
      Administrator @root · 10 years ago
      Owner

      Created by: houndci-bot

      Prefer single-quoted strings when you don't need string interpolation or special symbols.

      By Administrator on 2014-10-26T10:34:56 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit a9fadce3 10 years ago
    db/fixtures/development/07_projects_visibility.rb
    15
    16 # import_url does not work for local paths,
    17 # so we just copy the template repository in.
    18 unless Project.find_with_namespace("#{user.namespace.id}/"\
    19 "#{visibility_label_downcase}")
    20 params = {
    21 name: "#{visibility_label} Project",
    22 description: "#{visibility_label} Project description",
    23 namespace_id: user.namespace.id,
    24 visibility_level: visibility_value,
    25 }
    26 project = Projects::CreateService.new(user, params).execute
    27 new_path = project.repository.path
    28 FileUtils.rm_rf(new_path)
    29 FileUtils.cp_r(FixturesDevelopmentHelper.template_project.repository.path,
    30 new_path)
    • Administrator
      Administrator @root · 10 years ago
      Owner

      Created by: houndci-bot

      Align the parameters of a method call if they span more than one line.

      By Administrator on 2014-10-26T10:34:56 (imported from GitLab project)

  • Administrator
    Administrator @root · 10 years ago
    Owner

    Created by: maxlazio

    Thanks

    By Administrator on 2014-11-07T14:27:22 (imported from GitLab project)

  • Administrator
    Administrator @root started a thread on commit a9fadce3 10 years ago
    lib/gitlab/seeder.rb
    1 require 'sidekiq/testing'
    • Administrator
      Administrator @root · 10 years ago
      Owner

      Created by: dzaporozhets

      This is a bad idea. lib is auto loaded in any environment.

      By Administrator on 2014-11-10T14:20:35 (imported from GitLab project)

  • Administrator
    Administrator @root · 10 years ago
    Owner

    Created by: dzaporozhets

    I reverted this PR since it breaks everything sidekiq-related in application

    By Administrator on 2014-11-10T14:20:55 (imported from GitLab project)

  • Administrator
    Administrator @root · 10 years ago
    Owner

    Created by: cirosantilli

    @randx sorry for having caused this problem, I have removed the cause of the problem at: https://github.com/gitlabhq/gitlabhq/pull/8285

    By Administrator on 2014-11-10T14:41:35 (imported from GitLab project)

  • Administrator
    Administrator @root · 10 years ago
    Owner

    Created by: dzaporozhets

    @cirosantilli cool. Thank you

    By Administrator on 2014-11-10T14:42:40 (imported from GitLab project)

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Milestone
No milestone
None
None
Time tracking
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/cirosantilli/dev-fixtures-visibility

    0 pending comments

Menu

Projects Groups Snippets
Help