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
  • !4736

Merged
Created 11 years ago by Administrator@rootOwner

Create a wiki when wiki_enabled:true

  • Overview 28
  • Commits 4
  • Changes 2

Created by: karlhungus

If I create a project via the api using the wiki_enabled: true, and attempt to push to that project without first visiting the wiki page, the repo will not exist, and my push will fail. This PR creates the wiki if wiki_enabled == true, and adds tests for that.

  • 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
Compare
  • master (base)

and
  • latest version
    0cd28156
    4 commits, 5 years ago

2 files
+ 32
- 1

    Preferences

    File browser
    Compare changes

There are merge conflicts

The comparison view may be inaccurate due to merge conflicts.

Resolve these conflicts or ask someone with write access to this repository to merge it locally.

app/ob‎servers‎
project_o‎bserver.rb‎ +5 -0
spec/ob‎servers‎
users_project_o‎bserver_spec.rb‎ +27 -1
app/observers/project_observer.rb
+ 5
- 0
  • View file @ 0cd28156

  • Edit in single-file editor

  • Edit in Web IDE


Show all unchanged lines Show 20 lines
log_info("#{project.owner.name} created a new project \"#{project.name_with_namespace}\"")
end
if project.wiki_enabled?
# force the creation of a wiki,
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: dzaporozhets

      add space after comment sign

      bad:

      #force the..

      good:

      # force the..

      By Administrator on 2013-10-10T13:17:54 (imported from GitLab project)

      • Please register or sign in to reply
Please register or sign in to reply
GollumWiki.new(project, project.owner).wiki
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: karlhungus

      indentation

      By Administrator on 2013-10-10T13:17:54 (imported from GitLab project)

      • Please register or sign in to reply
Please register or sign in to reply
end
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: karlhungus

      remove space below

      By Administrator on 2013-10-10T13:17:54 (imported from GitLab project)

      • Please register or sign in to reply
Please register or sign in to reply
end
def after_update(project)
Show 20 lines Show all unchanged lines
spec/observers/users_project_observer_spec.rb
+ 27
- 1
  • View file @ 0cd28156

  • Edit in single-file editor

  • Edit in Web IDE


Show all unchanged lines Show 20 lines
@users_project.destroy
end
end
end
describe "#after_create" do
context 'wiki_enabled creates repository directory' do
context 'wiki_enabled true creates wiki repository directory' do
before do
@project = create(:project, wiki_enabled: true)
@path = GollumWiki.new(@project, user).send(:path_to_repo)
end
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: dzaporozhets

      separate before, after blocks with newline

      By Administrator on 2013-10-10T13:17:54 (imported from GitLab project)

      • Please register or sign in to reply
Please register or sign in to reply
after do
FileUtils.rm_rf(@path)
end
it { File.exists?(@path).should be_true }
end
context 'wiki_enabled false does not create wiki repository directory' do
before do
@project = create(:project, wiki_enabled: false)
    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: dzaporozhets

      newline please

      By Administrator on 2013-10-10T13:17:54 (imported from GitLab project)

      • Please register or sign in to reply
Please register or sign in to reply
@path = GollumWiki.new(@project, user).send(:path_to_repo)
end
it { File.exists?(@path).should be_false }
end
end
end
end
\ No newline at end of file
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Milestone
No milestone
None
None
Time tracking
No estimate or time spent
0
Labels
None
Assign labels
  • No matching results
  • Manage project labels
Lock merge request
Unlocked
1
1 participant
user avatar
Reference: gpt/large_projects/gitlabhq1!4736
Source branch: github/fork/karlhungus/feature-create-wiki-repo-on-repo-enabled

    0 pending comments

Menu

Projects Groups Snippets
Help