Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1af107e
Fix bug where objects and arrays marked as secret weren't being masked
nmaludy Jul 10, 2018
70cb585
Added comments to code about object/array secret masking
nmaludy Jul 10, 2018
7ccafe0
Added a ton more tests for nested secrets objects and arrays
nmaludy Jul 10, 2018
6f0a3f0
Fix flake8 for unit tests
nmaludy Jul 10, 2018
2ccff02
Update changelog.
Kami Jul 11, 2018
6568600
Allow user to force terminal size used by the st2 CLI formattes.
Kami Jul 13, 2018
03e9598
Also use a more reasonable default terminal size.
Kami Jul 13, 2018
02b4e69
200 -> 150..
Kami Jul 13, 2018
4cfe2eb
Make sure we cast it to int.
Kami Jul 13, 2018
d75d500
Truncate extra whitespace.
Kami Jul 13, 2018
2aba4e9
Add a note.
Kami Jul 13, 2018
8816589
Add tests for get_terminal_size.
Kami Jul 13, 2018
d2dc4e6
Number the various fallbacks.
Kami Jul 13, 2018
82edde6
Replace get_terminal_size with get_terminal_size_columns.
Kami Jul 13, 2018
5e017e6
Update changelog.
Kami Jul 16, 2018
27227b5
swap yaml.load with yaml.safe_load
tonybaloney Jul 3, 2018
2017b2e
Make setup requirements consistent
LindsayHill Jun 28, 2018
a1bbddc
Update st2client setup.py file to dynamically load requirements from
Kami Jun 28, 2018
173cc64
Allow user to pass minimum supported pip version to the function as an
Kami Jun 28, 2018
09aefc3
Update fetch_requirements function so it also works with older versions
Kami Jun 28, 2018
018ffa0
Re-generate dist_utils.py files.
Kami Jun 28, 2018
3389d1a
st2client doesn't require logshipper package to work.
Kami Jul 3, 2018
1d10c30
st2client also depends on jsonschema.
Kami Jul 3, 2018
68ebc0f
Make trigger example more complete and also add payload_schema attribute
Kami Jul 3, 2018
31e7b27
Add changelog entry.
Kami Jul 16, 2018
6c4abc3
Pull runners in-requirements.txt change from
Kami Jul 16, 2018
84ae753
Re-generate runner requirements.txt files.
Kami Jul 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
Changelog
=========

in development
--------------
2.8.1 - TBD
-----------

Added
-----

* Update ``st2`` CLI to inspect ``COLUMNS`` environment variable first when determining the
terminal size. Previously this environment variable was checked second last (after trying to
retrieve terminal size using various OS specific methods and before falling back to the default
value).

This approach is more performant and allows user to easily overwrite the default value or value
returned by the operating system checks - e.g. by running ``COLUMNS=200 st2 action list``.
(improvement) #4242

Changed
-------

* Update ``st2client/setup.py`` file to dynamically load requirements from
``st2client/requirements.txt`` file. The code works with pip >= 6.0.0, although using pip 9.0.0
or higher is strongly recommended. (improvement) #4209
* Update ``st2`` CLI to use a more sensible default terminal size for table formatting purposes if
we are unable to retrieve terminal size using various system-specific approaches.

Previously we would fall back to a very unfriendly default of 20 columns for a total terminal
width. This would cause every table column to wrap and make output impossible / hard to read.
(improvement) #4242

Fixed
~~~~~

* Fixed a bug where ``secret: true`` was not applying to full object and array trees. (bugfix) #4234
Reported by @jjm

Contributed by Nick Maludy (Encore Technologies).

2.8.0 - July 10, 2018
---------------------
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ requirements: virtualenv .sdist-requirements
$(VIRTUALENV_DIR)/bin/pip install --upgrade "virtualenv==15.1.0" # Required for packs.install in dev envs.

# Generate all requirements to support current CI pipeline.
$(VIRTUALENV_DIR)/bin/python scripts/fixate-requirements.py --skip=virtualenv -s st2*/in-requirements.txt -f fixed-requirements.txt -o requirements.txt
$(VIRTUALENV_DIR)/bin/python scripts/fixate-requirements.py --skip=virtualenv -s st2*/in-requirements.txt contrib/runners/*/in-requirements.txt -f fixed-requirements.txt -o requirements.txt

# Generate finall requirements.txt file for each component
@for component in $(COMPONENTS); do\
@for component in $(COMPONENTS_WITH_RUNNERS); do\
echo "==========================================================="; \
echo "Generating requirements.txt for" $$component; \
echo "==========================================================="; \
Expand Down
7 changes: 7 additions & 0 deletions contrib/examples/triggers/sample-trigger.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
name: sample_trigger
description: Sample trigger
payload_schema:
type: "object"
properties:
executed_at:
type: "string"
format: "date-time"
default: "2014-07-30 05:04:24.578325"
2 changes: 1 addition & 1 deletion contrib/packs/actions/pack_mgmt/get_installed.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ def run(self, pack):

def _parse_yaml_file(self, file_path):
with open(file_path) as data_file:
details = yaml.load(data_file)
details = yaml.safe_load(data_file)
return details
16 changes: 10 additions & 6 deletions contrib/runners/action_chain_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/action_chain_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/announcement_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/announcement_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/cloudslang_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/cloudslang_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/http_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/http_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/inquirer_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/inquirer_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/local_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/local_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/mistral_v2/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/mistral_v2/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/noop_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
Empty file.
2 changes: 2 additions & 0 deletions contrib/runners/noop_runner/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't edit this file. It's generated automatically!

16 changes: 10 additions & 6 deletions contrib/runners/orchestra_runner/dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
]


def check_pip_version():
def check_pip_version(min_version='6.0.0'):
"""
Ensure that a minimum supported version of pip is installed.
"""
if StrictVersion(pip.__version__) < StrictVersion('6.0.0'):
print("Upgrade pip, your version `{0}' "
"is outdated:\n{1}".format(pip.__version__, GET_PIP))
if StrictVersion(pip.__version__) < StrictVersion(min_version):
print("Upgrade pip, your version '{0}' "
"is outdated. Minimum required version is '{1}':\n{2}".format(pip.__version__,
min_version,
GET_PIP))
sys.exit(1)


Expand All @@ -71,8 +73,10 @@ def fetch_requirements(requirements_file_path):
links = []
reqs = []
for req in parse_requirements(requirements_file_path, session=False):
if req.link:
links.append(str(req.link))
# Note: req.url was used before 9.0.0 and req.link is used in all the recent versions
link = getattr(req, 'link', getattr(req, 'url', None))
if link:
links.append(str(link))
reqs.append(str(req.req))
return (reqs, links)

Expand Down
1 change: 1 addition & 0 deletions contrib/runners/orchestra_runner/in-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git+https://github.com/StackStorm/orchestra.git#egg=orchestra
Loading