Skip to content
Snippets Groups Projects

replaced system() calls with FileUtils.* methods

Merged gitlab-qa-bot requested to merge github/fork/koenpunt/system-to-fileutils into master

Created by: koenpunt

This also makes that mv: cannot stat '/ho.. is not shown in the test :)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Unable to load the diff
  • Created by: vsizov

    this won't work. Did you tested?

    By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

    By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: koenpunt

      Oh I see, probably because fileutils is included in the tests but not in the application. Will do that now.

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: dzaporozhets

      its because it will ignore your mode

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: vsizov

      please don't send PR unless you properly tested it in live application.

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: vsizov

      even now it won't work. Please make sure that new directory have appropriate mode.

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: koenpunt

      I actually tested it although in IRB, and not in Gitlab environment. And I thought the tests would cover its functionality. But what you are saying is that supplying the mode to FileUtils.mkdir doesn't work?

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: koenpunt

      vagrant:/vagrant/gitlabhq system-to-fileutils 
      → rails c  
      Loading development environment (Rails 3.2.9)
      1.9.3-p327 :001 > FileUtils.mkdir( '/tmp/mkdir_fileutils', :mode => 0770 )
       => ["/tmp/mkdir_fileutils"] 
      1.9.3-p327 :002 > exit
      
      vagrant:/vagrant/gitlabhq system-to-fileutils 
      stat /tmp/mkdir_fileutils
        File: `/tmp/mkdir_fileutils'
        Size: 4096        Blocks: 8          IO Block: 4096   directory
      Device: fc00h/64512d    Inode: 1048616     Links: 2
      Access: (0770/drwxrwx---)  Uid: ( 1000/ vagrant)   Gid: ( 1000/ vagrant)
      Access: 2012-12-07 10:37:06.269298460 +0000
      Modify: 2012-12-07 10:37:06.269298460 +0000
      Change: 2012-12-07 10:37:06.269298460 +0000
       Birth: -

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: koenpunt

      Ow and:

      FileUtils.mkdir('/tmp/somedir', :mode => 0770, :verbose => true, :noop => true)

      Logs: mkdir -m 770 /tmp/somedir

      And this is exactly how the code looks like in the system call, so if it's not working, please tell me why and not just 'this won't work', because that doesn't help anyone.

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: vsizov

      I don't know why. We had no time to find out why this happens. This one works in console but in live application not. I will be happy if you find the reason.

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:36 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: vsizov

      @randx can confirm this magical behavior

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: koenpunt

      Ok. that's something I can work with, thank you. Will look into that :)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: vsizov

      I'm sorry. We tried to use Dir.mkdir(..., 0700). This one doesn't work. Ok we will test your PR for Gitlab 4.1

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: dzaporozhets

      @koenpunt Tried one more time. seems like it works for me now. Sorry for noise :)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab)

  • gitlab-qa-bot
  • Unable to load the diff
    • Created by: koenpunt

      Ok, I'll revert the last commit, as FileUtils is already available in Rails

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab project)

      By Administrator on 2013-01-03T14:37:37 (imported from GitLab)

  • Created by: jirutka

    +1, but these commits should be squashed IMHO.

    By Administrator on 2013-01-02T02:13:45 (imported from GitLab project)

    By Administrator on 2013-01-02T02:13:45 (imported from GitLab)

  • Created by: dzaporozhets

    @koenpunt Can you squash commits please? I'd like to merge this one

    By Administrator on 2013-01-02T10:23:37 (imported from GitLab project)

    By Administrator on 2013-01-02T10:23:37 (imported from GitLab)

  • Created by: koenpunt

    Done

    By Administrator on 2013-01-03T14:38:26 (imported from GitLab project)

    By Administrator on 2013-01-03T14:38:26 (imported from GitLab)

  • Created by: dzaporozhets

    thank you

    By Administrator on 2013-01-05T18:03:18 (imported from GitLab project)

    By Administrator on 2013-01-05T18:03:18 (imported from GitLab)

  • Please register or sign in to reply
    Loading