Don't use global schema validation

Prior to this commit, the `puppetdb.schema` namespace contained
a top-level call to primsatic's `set-fn-validation!` fn.  This
enabled strict schema validation for every occurence of a schema
annotation anywhere inside the JVM.

This behavior means that other libraries that use schemas lose
control over when strict validation occurs and when it does not,
which can cause unexpected behavior and potentially even bugs.

This commit removes the global toggle and instead prefers
explicit metadata to enforce validation on the various functions
that require it.
(packaging) Update top-level Rakefile's version and pe determination

Prior to the commit, the versioning in puppetdb would fail from a rake
perspective if the packaging repo wasn't present. This commit updates it to
fall back to git describe and if that fails to a hardcoded string, so that we
always have a version. We also set the @version variable to
Pkg::Config.version, which is how we access data provided by the packaging repo
in the new library-format.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) Update template task for new erb_file method

The packaging repo will have all utilities split out into different classes for
sanity's sake, and one of the tools that got an overhaul is erb. This commit
updates puppetdb to use the new utility.
(packaging) Fully qualify variables supplied by the packaging repo in templates

Part of the variable scoping overhaul within the packaging repo was ensuring
the data about builds lives inside module Pkg::Config. In other projects, we
only use variables set by the packaging repo in templates, which means we can
pass the binding of the packaging repo Pkg::Config class into the template
engine and keep using "@" variables like we always have. But in puppetdb, we
mix data supplied by the packaging repo and data supplied by puppetdb itself in
the same template, which means we can't use just the Pkg::Config scope. Since
there are far more variables supplied by puppetdb in the templates than the
packaging repo, we opt to use the puppetdb scope and fully qualify access to
the variables supplied by the packaging repo, by referencing them as
Pkg::Config wherever we use them.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) set project to pe-puppetdb when building pe-puppetdb

Until we split out the packaging of pe-puppetdb from puppetdb, with the new
packaging system we need to explicitly tell the automation that the project
we're building is called 'pe-puppetdb' instead of 'puppetdb.'

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) Evaluate rpm spec file just like debian templates

Prior to this commit, we evaluated all of the debian templates when creating a
tarball, resulting in a 'ext/debian' directory containing usable debian
artifacts. On the other hand, we didn't bother creating the redhat spec from
the corresponding template, leaving that as an exercise left to the reader.
This seems odd. All of our other projects have fully usable spec files in their
tarball, and puppetdb should to. This also has the added benefit of allowing us
to control the binding context like we do on debian, instead of letting the
packaging repo do it. This means we can still mix puppetdb-defined '@'
variables with 'Pkg::Config' accessors supplied by the packaging repo.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(packaging) Replace non-portable shell calls in spec and changelog with ruby

Prior to this commit, we shelled out to `hostname` and `date` in the redhat
spec template and the debian changelog, which is poor practice if we expect to
template that file anywhere else. This commit updates these calls to use their
most simpl ruby equivalents, though we risk that we may not get a FQDN for
hostname. This doesn't really matter a ton by rpm standards, so I'm fine with
it.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(PDB-238) - Remove v1 API - part 1

This commit starts some refactoring to the existing PuppetDB HTTP API to make
removing v1 portions of the API easier. This is being broken into two commits
as the 1.6.x branch will benefit from the refactor and master can build on this
and actually remove the v1 stuff (along with the docs etc). This commit contains:

- Moving v1 functions used by v2/v3 to api.clj
- Having v2/v3 call into api.clj from their routes
- Move former v1 tests into test/api.clj
- Changed the v1 tests to use the functions themselves (not going in through the top *app*)
- Add tests for the same api calls going through both v2 and v3 routes

Conflicts:
	src/com/puppetlabs/puppetdb/query.clj
	src/com/puppetlabs/puppetdb/query/nodes.clj
	test/com/puppetlabs/puppetdb/test/http/v1/command.clj
	test/com/puppetlabs/puppetdb/test/http/v1/deprecation.clj
	test/com/puppetlabs/puppetdb/test/http/v1/facts.clj
	test/com/puppetlabs/puppetdb/test/http/v1/metrics.clj
	test/com/puppetlabs/puppetdb/test/http/v1/node.clj
	test/com/puppetlabs/puppetdb/test/http/v1/resources.clj
	test/com/puppetlabs/puppetdb/test/http/v1/status.clj
	test/com/puppetlabs/puppetdb/test/http/v1/version.clj
	test/com/puppetlabs/puppetdb/test/query/facts.clj
Split metrics/version/command out of api.clj and into their own
namespaces
Updated the 1.6.2 release notes
Merge pull request #839 from senior/maint/1.6.x/1.6.2-release-notes

Updated the 1.6.2 release notes
Merge pull request #837 from senior/ticket/1.6.x/pdb-238-v1-refactor

v1 shared route refactor
Merge pull request #832 from cprice404/maint/1.6.x/dont-use-global-schema

Don't use global schema validation
(PDB-435) Travis no longer has bundler installed by default, now
installing it explicitly
Merge pull request #842 from senior/ticket/1.5.x/fix-travis-bundler-issue

(PDB-435) Travis no longer has bundler installed by default, now installing it explicitly
Merge remote-tracking branch 'upstream/1.5.x' into 1.6.x

* upstream/1.5.x:
  (PDB-435) Travis no longer has bundler installed by default, now installing it explicitly
Merge pull request #835 from MosesMendoza/packaging/1.5.x/update

Update packaging for new tooling (To be merged Monday 2/10)
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  (packaging) Replace non-portable shell calls in spec and changelog with ruby
  (packaging) Evaluate rpm spec file just like debian templates
  (packaging) set project to pe-puppetdb when building pe-puppetdb
  (packaging) Fully qualify variables supplied by the packaging repo in templates
  (packaging) Update template task for new erb_file method
  (packaging) Update top-level Rakefile's version and pe determination

Conflicts:
	Rakefile
	tasks/template.rake
PDB-437 Reduce API source code and version inconsistencies

The API code when split between different versions created an opportunity for
inconsistencies to grow. For example, some versioning inside the code supported
this file based way of abstracting versions, but other functions required
version specific handling.

The problem was that the version wasn't always filtered down properly due to a
lack of a structured way of handling versions.

Not only that, whenever a new version of the API is cut the amount of code that
is simply copied and pasted was quite large.

This patch collapses any version specific code into a single unit. For example
the end-points v2/facts and v3/facts can now be handled by the same application.

The way this is achieved is by passing a keyword of the version: :v1, :v2, :v3
from the top level ring app and pass that into any functions that require
'versioned' capabilities. This version can then be used in decision code (ie.
like a case statement) to execute differently dependant on version.

Because the version pattern is consistent, we should be able to ensure that
particular versioned behaviour is also called consistently no matter where in
the stack a function is executed. This should reduce cases like we've seen
before where v3 api end-points still exhibit v2 behavours on very specific
experessions.

For the query parts of the code, we've applied the same versioned pattern.
The tests now iterate across all supported versions for each tests as well
providing more coverage generally.

Signed-off-by: Ken Barber <ken@bob.sh>
Fixed an anonymizer test hidden behind a lazy seq

Since coll? doesn't force the seq, essentially the function
under test wasn't being ran. The test had a vector where
a map was expected which fails when the seq is forced.