(#8686) Handle concurrent DelayedJob workers importing for same node

If you didn't have any delayed job workers and submitted multiple
reports for the same node, when you started multiple workers they would
each try to create the same node.  There was no database constraint to
prevent this, and Rails validation was worthless since the workers were
running their own transactions.

By adding the database constraint the insert will fail for workers who
don't create the node first.  Rather than discard the reports and create
an error for those workers, we're retrying the report submission 3
times before putting in a DelayedJobFailure entry.

Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
Provide clearer error message when report host, kind and time are not unique

The previous error was just:

    Host has already been taken

The problem is that host by itself isn't unique, but the error message
would lead you to believe it is.  Instead, mention that the host, kind,
time combo needs to be unique.

Paired-with: Jacob Helwig <jacob@puppetlabs.com>
Merge branch 'ticket/1.2rc/8686' into 1.2rc

* ticket/1.2rc/8686:
  Provide clearer error message when report host, kind and time are not unique
  (#8686) Handle concurrent DelayedJob workers importing for same node
(#8691) Fix the order of changed and unchanged resources on the report summary
Merge branch 'ticket/1.2rc/8691' into 1.2rc

* ticket/1.2rc/8691:
  (#8691) Fix the order of changed and unchanged resources on the report summary
Updated CHANGELOG for 1.2rc4
Merge branch '1.2rc'
(#8745) Update gitignore to not exlucde tmp during tarball creation

When the tarball for the package is composed, the tmp directory is left
out due to gitignore settings. Now the project-level gitignore file does
not reference tmp.  A new gitignore file has been added in
$RAILS_ROOT/tmp to exclude everything below it.

Reviewed-by: Matthaus Litteken <matthaus@puppetlabs.com>
Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
Add document outlining preferred contribution methods

We have historically had the preferred contribution process on the
Redmine wiki, however this is not obvious to people that don't already
know it is there.  By adding this document to the repository itself,
it becomes much easier for new contributors to find what the preferred
contribution methods are.

By having the preferred contribution method in the repository also
means that it becomes a "curated" document, which must go through the
same submission/review process that other changes to the repositories
go through.

Reviewed-by: Nick Fagerlund <nick.fagerlund@puppetlabs.com>
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
Add document outlining preferred contribution methods

We have historically had the preferred contribution process on the
Redmine wiki, however this is not obvious to people that don't already
know it is there.  By adding this document to the repository itself,
it becomes much easier for new contributors to find what the preferred
contribution methods are.

By having the preferred contribution method in the repository also
means that it becomes a "curated" document, which must go through the
same submission/review process that other changes to the repositories
go through.

Reviewed-by: Nick Fagerlund <nick.fagerlund@puppetlabs.com>
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
(#8694) Add backtrace info to DelayedJobFailure

If reports fail to import with DelayedJob a failure entry is created
that has the error message, but did not have the backtrace, which often
is much more helpful for debugging.

This commit adds the backtrace to the UI in an expandable form so that
it doesn't look to spammy on the web page.

Reviewed-by: Pieter van de Bruggen <pieter@puppetlabs.com>
Merge branch 'ticket/1.2rc/8694-delayedjobfailure_backtrace' into 1.2rc

* ticket/1.2rc/8694-delayedjobfailure_backtrace:
  (#8694) Add backtrace info to DelayedJobFailure
(#8748) Upgrade vendored daemons gem to fix umask on pids

We had version 1.1.0 of the daemons gem because that's what the older
version of delayed_job says it depends on.  However, since that time,
newer versions of daemons have been release with bug fixes, including
setting better permissions on pids and logs and not changing the umask

From vendor/gems/daemons-1.1.4/Releases

== Release 1.1.4: June 17, 2011

* Do not change the umask to 0000 when daemonizing anymore, just leave
* it as it.
  was (thanks to Jon Botelho).

== Release 1.1.0: June 20, 2010

* Set log files mode to 0644 (mikehale).
* Set pid file permissions to 0644 (mikehale).

I tested processing a lot of reports with delayed_job and the newer
daemons gem, started and stopped a bunch of delayed job workers, and saw
no problems, so feel comfortable vendoring this newer version of the
gem.

Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Merge branch 'ticket/1.2rc/8748-pid_permissions' into 1.2rc

* ticket/1.2rc/8748-pid_permissions:
  (#8748) Upgrade vendored daemons gem to fix umask on pids
Allow setting of RUBY for the workers on redhat systems

While we are able to set an alternative RUBY path for the dashboard
server this is not possible for the workers.
We now include first the general dashboard sysconfig and afterwards
a (possible) dedicated workers sysconfig file, which could overwrite
the general dashboard settings.
This means that if you would adjust RUBY for the dashboard-server it
would also be used for the workers.
Merge branch 'ticket/1.2rc/8749-redhat_worker_init_script' into 1.2rc

* ticket/1.2rc/8749-redhat_worker_init_script:
  Allow setting of RUBY for the workers on redhat systems
(#8748) Fix my forgetting to add a vendored gem

Classic forgetting to add a file before commit - it worked on my
machine, died when I pushed it since I didn't add the directory.

The newer daemons gem is NOW vendored.

Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Merge branch 'ticket/1.2rc/8748-pid_permissions' into 1.2rc

* ticket/1.2rc/8748-pid_permissions:
  (#8748) Fix my forgetting to add a vendored gem
Updated CHANGELOG for 1.2rc5
Merge branch '1.2rc'