(PUP-3512) Use new Profiler API

Change the `profile` function in PuppetDB to use the new Puppet
Profiler API in preparation for removing the old API from Puppet.
Modify all calls to the `profile` function in PuppetDB to pass in
a metric ID.
Merge pull request #1157 from fpringvaldsen/PUP-3512-new-profiler-api

(PUP-3512) Use new Profiler API
(PDB-1029) Provide an arity detection for backwards compatibility for profiling

This patch fixes the arity problem on the oldest version of Puppet we support
by adding a compatibility layer that uses the correct argument list based
on the methods arity available.

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-1017) Fix node tests hiding failures

There were several tests that were failing in v4 that were being hidden
by skipping over the assertions when the resulset was nil/empty. This
commit adds an explicit result count check and fixes the tests that were broken.
Merge pull request #1161 from senior/ticket/master/pdb-1017-node-tests-broken

(PDB-1017) Fix node tests hiding failures
Merge pull request #1160 from kbarber/ticket/stable/pdb-1029-fix-profile-compat

(PDB-1029) Provide an arity detection for backwards compatibility for profiling
PuppetDB: broken links in connect_puppet_master

Fixed /api/query/v3/events.html
and /api/query/v3/events.html
PuppetDB: broken links in connect_puppet_master

Fixed /api/query/v3/events.html
and /api/query/v3/events.html
(docs) Using an extract is now possible at the top-level

So we now allow an extract at the top level, this patches the documentation to remove the
strict statement about this not being allowed. The docs for the subquery elements still make
sense.
Merge branch 'stable'

* stable:
  PuppetDB: broken links in connect_puppet_master
  (PDB-1017) Fix node tests hiding failures
  (PDB-1029) Provide an arity detection for backwards compatibility for profiling
  (PUP-3512) Use new Profiler API

Conflicts:
	puppet/lib/puppet/indirector/facts/puppetdb.rb
	puppet/lib/puppet/indirector/resource/puppetdb.rb
	puppet/lib/puppet/util/puppetdb/command.rb
	src/puppetlabs/puppetdb/query_eng/engine.clj
	test/puppetlabs/puppetdb/http/nodes_test.clj
(maint) Repair tests from last merge-up

I missed a couple of failing tests last merge-up, this fixes that issue.

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-1038) Include a new namespace for ezbake to use for service startup

This provides a new namespace: puppetlabs.puppetdb.main that will be used to
startup the PuppetDB service. This avoids the need to include the sub-command
'services' in the ezbake configuration templates, avoiding the need for
a new parameter to be added to ezbake to support this 1 edge case.

The new namespace contains a single function -main, that effectively wraps
the sub-command 'services'.

We also noticed that the core.clj file had a gen-class declaration, since
we don't use AOT this is not needed and is being removed.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1167 from kbarber/pdb-1038-ezbake-entrypoint

(PDB-1038) Include a new namespace for ezbake to use for service startup
Ensure we use our own vendored directory for gems

We were using the global gemset which is a bad thing, this patch fixes that.

This was causing issues when a fog-core gem that was bad had been permanently
'cached' due to the use of a global gemset. This will slow the build down
and create another potential place of failure, but it is more correct.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #1168 from kbarber/maint/master/tests-use-vendor-path-for-gems

Ensure we use our own vendored directory for gems
Fixes needed for running tests against puppet's master branch

Specifically this commit

 - Adds specific checks for puppet 3 when loading storeconfig code
   storeconfig does not work against current master and will be removed
   as part of Puppet 4.0.0. We want to maintain backward compatibility,
   so the code supports both

 - Removes references to Puppet[:trusted_node_data] when on Puppet
   4 (essentially assuming it is always true on 4). Like above we will
   look for it when on Puppet 3.y.z and ignore it (assuming true) when
   on Puppet 4.y.z
Merge pull request #1163 from senior/maint/stable/puppet-4-compiler-change

Fixes needed for running tests against puppet's master branch
(PDB-722) Added validation for in/extract fields in that are passed in vector form. Covered with tests.
Merge pull request #1165 from DemonShi/pdb-722

(PDB-722) Added missing validation for fields in vector forms for 'in' and 'extract' operators in API v4
(PDB-863) Remove com. from jmx and mq endpoints

This commit removes the com. from the jmx and mq endpoints so that these
endpoints use the new puppetlabs.puppetdb namespace. In order to change
all the outstanding references to the old namespace, this commit also
updates the dashboard index.html to reference the v4 metrics api.