Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5570

puppet module build parses .gitignore files unexpectedly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PMT
    • Labels:
      None
    • Environment:

      Example below can be reproduced in the module repo https://github.com/rnelson0/local_user

    • Template:
    • Team:
      Puppet Developer Experience

      Description

      A common .gitignore file for a puppet module skeleton can be found in the ever-popular puppet-module-skeleton and looks like this:

      .*.sw?
      /pkg
      /spec/fixtures
      /.rspec_system
      /.vagrant
      /.bundle
      /vendor
      /Gemfile.lock
      /junit
      /log
      .yardoc
      coverage
      

      Git will ignore those files, specifically the vendor path that many people use for bundler gems. puppet module build is supposed to use a .gitignore file if it is present, which it does, but it unexpectedly parses the paths in it differently. When that .gitignore is present and a user builds the module, the bundled gems are included, making for an extraordinarly large module package (70+M for most of my modules) which the forge sanely rejects. Instead, the format vendor/ must be used:

      # Ignore files:
      [rnelson0@build02 local_user:master]$ cat .gitignore
      .*.sw?
      /pkg
      /spec/fixtures
      /.rspec_system
      /.vagrant
      /.bundle
      /vendor
      /Gemfile.lock
      /junit
      /log
      .yardoc
      coverage
      [rnelson0@build02 local_user:master]$ cat .pmtignore
      vendor/
      

      # Build with the .pmtignore file
      [rnelson0@build02 local_user:master]$ be rake build
      [rnelson0@build02 local_user:master]$ ls -lh pkg
      total 24K
      drwxrwxr-x. 5 rnelson0 rnelson0 4.0K Dec  1 00:35 rnelson0-local_user-1.0.3
      -rw-rw-r--. 1 rnelson0 rnelson0 7.1K Dec  1 00:35 rnelson0-local_user-1.0.3.tar.gz
      drwxrwxr-x. 5 rnelson0 rnelson0 4.0K Dec  3 01:13 rnelson0-local_user-1.0.4
      -rw-rw-r--. 1 rnelson0 rnelson0 7.1K Dec  3 01:13 rnelson0-local_user-1.0.4.tar.gz
      

      # Build without the .pmtignore
      [rnelson0@build02 local_user:master]$ rm .pmtignore
      [rnelson0@build02 local_user:masterĀ±]$ be rake build
      [rnelson0@build02 local_user:masterĀ±]$ ls -lh pkg
      total 21M
      drwxrwxr-x. 5 rnelson0 rnelson0 4.0K Dec  1 00:35 rnelson0-local_user-1.0.3
      -rw-rw-r--. 1 rnelson0 rnelson0 7.1K Dec  1 00:35 rnelson0-local_user-1.0.3.tar.gz
      drwxrwxr-x. 6 rnelson0 rnelson0 4.0K Dec  3 01:16 rnelson0-local_user-1.0.4
      -rw-rw-r--. 1 rnelson0 rnelson0  21M Dec  3 01:16 rnelson0-local_user-1.0.4.tar.gz
      

      My understanding of the code is pretty naive but I believe either a change here to handle leading slashes or adding vendors to Puppet::ModuleTool::ARTIFACTS would address this and remove the need for .pmtignore files for most people.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  rnelson0@gmail.com Rob Nelson
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support