Commit Graph

16 Commits

Author SHA1 Message Date
Zuul d479d6b969 Merge "Validate existence of "deployment-version" during create configdocs" 2019-05-13 15:39:38 +00:00
Carter, Matthew (mc981n) c25a78fef4 Update yaml.load to yaml.safe_load in Shipyard unit tests
In all honesty, the warnings that were output about unsafe yaml.load
while running unit tests in Shipyard were just kind of annoying.
They always made me think there was a unit test failure for a split
second. This patch set updates yaml.load to yaml.safe_load in the
configdocs helper unit tests. The unit tests themselves are
effectively unchanged, but now there are no warnings returned.

Change-Id: I65a5d55fbe9eb690ad534a5b7df882762bf5a9fb
2019-05-09 10:34:52 -05:00
Carter, Matthew (mc981n) 0761099337 Validate existence of "deployment-version" during create configdocs
This PS adds funtionality to Shipyard to validate the existence of
the Pegleg-generated "deployment-version" document (Pegleg change id:
I7919b02d70c9797f689cdad85066d3953b978901) when a user runs create
configdocs. This validation only checks the presence of the document
(by name and schema) and does not care about the document's other
contents.
The severity of a failed validation is configurable through the
"validations" config section in shipyard.conf. The default severity
is "Skip", meaning the validation is not ran at all.

Note that with the default configuration of new validation, Shipyard
functionality should be unchanged.

Change-Id: I754617de81f628a24232e890b12b157ba6731c25
2019-05-09 08:33:52 -05:00
Bryan Strassner 667a538330 Support clearing collections of configdocs
Adds an option to create configdocs as an empty colleciton. This is done
as an explicit flag (--empty-collection) on the command as opposed to
using empty files to prevent accidental emtpy file loads leading to
frustration.

Since this introduced a new flag value for the CLI, the CLIs using flag
values were updated to use the standard is_flag=True instead of the
flag_value=True or some other value when a boolean flag is expected.

Minor updates to CLI tests due to moving to responses 0.10.2

Depends-On: https://review.openstack.org/#/c/614421/

Change-Id: I489b0e1183335cbfbaa2014c1458a84dadf6bb0b
2018-11-30 13:36:14 -06:00
Zuul 7f3286b523 Merge "Expects Redacted Raw Documents" 2018-11-06 21:57:46 +00:00
lvxianguo ad6445c3bf trivial: modify spelling error of test
Change-Id: I79d71d4596b3fd5ec625d5c2b749e8a9a0f7264e
2018-10-31 19:33:40 +08:00
Aaron Sheffield d62f15123d Expects Redacted Raw Documents
- Adds a query parameter 'cleartext-secrets' to get full raw documents.
- Adds CLI flag to get full raw documents.

Change-Id: If38974c8433c8360cc47ae1273720ad76e87a6fd
2018-10-23 11:12:56 -05:00
Drew Walters 6f8b9f858a Refactor validations retrieval for performance
The goal of this commit is to reduce the average time spent retrieving
validations from Deckhand. Currently, wait times when committing
configdocs can be significant due to unnecessary API calls. This change
reduces the number of API calls during this process by utilizing the
`/revisions/{{revision_id}}/validations/detail` endpoint exposed by
Deckhand. During testing, this introduced a 71% decrease in cumulative
time for committing configdocs. Note, this commit does not introduce
usage of the official Deckhand client, which will be addressed in a
future change.

Change-Id: I3c86fca6bae1a5a2f74963a87b2198c1705cf3a6
2018-10-05 13:57:27 +00:00
Andrey Volkov 65b8f3b46a Fix check_intermidiate_commit logic
Before this change check_intermidiate_commit return False if revision
has site-action-failure tag only.

Co-Authored-by: Bryan Strassner <bryan.strassner@gmail.com>
Co-Authored-by: Serge Kovaleff <sk607s@att.com>

Change-Id: I8524f599741dab743df9e1a2638b25e04c87da7c
2018-09-07 08:19:06 -07:00
Bryan Strassner cf9684377a Refactor to use unittest.mock instead of mock
Simple refactor to eliminate use of mock library and instead use the
built-in library.

Change-Id: Id2c176c9c67a9043ea5f54d62044423518a3446b
2018-07-25 10:41:16 -05:00
Bryan Strassner bd2a686dbf Make validation process failures more obvious
Adds better info to the error returne when retreiving the validations
from another Airship component. Adds tests to cover the success and
failure flows of this same logic

Change-Id: Id7fb389a3905f3e0659d4a7eec0e0658e00f3f28
2018-07-16 16:59:39 -05:00
Anthony Lin 89a61d168a Refactor get_configdocs_status Method
This is a follow-up patch set for [0] to address the comments
to break up the get_configdocs_status method into smaller
methods.

Also made a minor update to the check_reformat_versions method
based on comments in [0]

[0] https://review.gerrithub.io/#/c/att-comdev/shipyard/+/409839/

Change-Id: Id13fcaa25e48cc2f4267a08db1ccb4561b260197
2018-05-10 17:16:26 +00:00
Bryan Strassner 23fd081ece Add deployment group validation to shipyard
Adds the validation of the existence of a deployment
configuration and a deployment strategy document to
the checks before submitting a site action for
processing.

Change-Id: I61bf67759bd919dcc31208370cb1be5a777baf54
2018-05-09 09:18:16 -05:00
Anthony Lin afc2ea501d Update Configdoc Status
Allows comparison between Deckhand revisions with valid revision tags,
i.e. buffer, committed, last-site-action and successful-site-action.

This patch set updates the relevant Shipyard API, API client, CLI as
well as document.

Change-Id: Ia9a519d82fe8bf80f89945e678a0b02f6ec43baa
2018-05-08 15:08:55 +00:00
Anthony Lin c0f8fc4359 Add 'last-site-action' & 'successful-site-action' Option
Shipyard retrieval of configdocs and renderedconfigdocs to
support two new revisions, i.e. 'last-site-action' and
'successful-site-action'.

1) --last-site-action for the documents associated with the last
   'successful or failed site action

2) --successful-site-action for the documents associated with the
   last successful site action

This patch set updates the relevant Shipyard API, API client, CLI
as well as document for the new options.

Change-Id: I60fefa25147ad8e367bc3d1c8d45d4d08a5ee3f1
2018-05-02 15:22:14 +00:00
Bryan Strassner 769d0ded47 Refactor shipyard to UCP target layout
Refactor Shipyard to be better able to leverage common
packages and conform with the target UCP standard layout.

This change supports the same tox entrypoints at
the root level, but the preferred approach is to use make
targets defined in the Makefile such as 'make tests' and
'make lint'

The previous tox.ini has moved and been
tailored to the specifics of each subproject at
src/bin/*/tox.ini

Autotmatic generation of the policy and configuration
files has been removed from the sphinx build for now
but these files will be automatically generated locally
into the docs source by using a 'make docs' command.
This may need to be revisited later to re-enable the
automatic generation of these files such that readthedocs
would still support the project layout.

Change-Id: Ifdc1cd4cf35fb3c5923414c677b781a60a9bae42
2018-04-24 16:47:13 -05:00