Skip to content

Commit 85c36c0

Browse files
authored
Merge branch 'master' into ldap_integration
2 parents c47a088 + b1d71c5 commit 85c36c0

File tree

95 files changed

+1276
-1097
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1276
-1097
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,4 @@ experimental:
276276

277277
notify:
278278
webhooks:
279-
- url: https://ci-webhooks.stackstorm.net/webhooks/build/events
279+
- url: https://ci-webhooks.stackstorm.com/webhooks/build/events

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
# scripts/travis/run-nightly-make-task-if-exists.sh
3939
- name: "Unit Tests (Python 2.7 MongoDB 4.0)"
4040
python: 2.7
41-
env: TASK=ci-unit CACHE_NAME=py2 COMMAND_THRESHOLD=700
41+
env: TASK=ci-unit CACHE_NAME=py2 PYTHON_VERSION=python2.7 COMMAND_THRESHOLD=700
4242

4343
- name: "Integration Tests (Python 2.7)"
4444
python: 2.7
45-
env: TASK=ci-integration CACHE_NAME=py2 COMMAND_THRESHOLD=700
45+
env: TASK=ci-integration CACHE_NAME=py2 PYTHON_VERSION=python2.7 COMMAND_THRESHOLD=700
4646

47-
- name: "Lint Checks, Packs Tests (Python 2.7)"
48-
python: 2.7
49-
env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py2 COMMAND_THRESHOLD=430
47+
- name: "Lint Checks, Packs Tests (Python 3.6)"
48+
python: 3.6
49+
env: TASK="ci-checks ci-packs-tests" CACHE_NAME=py3 PYTHON_VERSION=python3.6 COMMAND_THRESHOLD=430
5050

5151
- name: "Unit Tests, Pack Tests (Python 3.6)"
5252
python: 3.6

CHANGELOG.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ Changelog
44
in development
55
--------------
66

7+
Changed
8+
~~~~~~~~~
9+
* Improve the st2-self-check script to echo to stderr and exit if it isn't run with a
10+
ST2_AUTH_TOKEN or ST2_API_KEY environment variable. (improvement) #5068
11+
12+
3.3.0 - October 06, 2020
13+
------------------------
14+
715
Added
816
~~~~~
917
* Added st2-auth-ldap pip requirements for Ldap integartion. (new feature) #5082
@@ -32,6 +40,9 @@ Added
3240
Python 2. (new feature) #5043
3341

3442
Contributed by @amanda11
43+
* Added deprecation warning to st2ctl, if st2 python version is Python 2. (new feature) #5044
44+
45+
Contributed by @amanda11
3546

3647

3748
Changed
@@ -47,6 +58,14 @@ Changed
4758
Contributed by Justin Sostre (@saucetray)
4859
* The built-in ``st2.action.file_writen`` trigger has been renamed to ``st2.action.file_written``
4960
to fix the typo (bug fix) #4992
61+
* Renamed reference to the RBAC backend/plugin from ``enterprise`` to ``default``. Updated st2api
62+
validation to use the new value when checking RBAC configuration. Removed other references to
63+
enterprise for RBAC related contents. (improvement)
64+
* Remove authentication headers ``St2-Api-Key``, ``X-Auth-Token`` and ``Cookie`` from webhook payloads to
65+
prevent them from being stored in the database. (security bug fix) #4983
66+
67+
Contributed by @potato and @knagy
68+
* Updated orquesta to version v1.2.0.
5069

5170
Fixed
5271
~~~~~
@@ -89,6 +108,21 @@ Fixed
89108
* Fixed a regression in the ``linux.dig`` action on Python 3. (bug fix) #4993
90109

91110
Contributed by @blag
111+
* Fixed a bug in pack installation logging code where unicode strings were not being
112+
interpolated properly. (bug fix)
113+
114+
Contributed by @misterpah
115+
* Fixed a compatibility issue with the latest version of the ``logging`` library API
116+
where the ``find_caller()`` function introduced some new variables. (bug fix) #4923
117+
118+
Contributed by @Dahfizz9897
119+
* Fixed another logging compatibility issue with the ``logging`` API in Python 3.
120+
The return from the ``logging.findCaller()`` implementation now expects a 4-element
121+
tuple. Also, in Python 3 there are new arguments that are passed in and needs to be
122+
acted upon, specificall ``stack_info`` that determines the new 4th element in the returned
123+
tuple. (bug fix) #5057
124+
125+
Contributed by Nick Maludy (@nmaludy Encore Technologies)
92126

93127
Removed
94128
~~~~~~~

Makefile

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ else
1515
VIRTUALENV_COMPONENTS_DIR ?= virtualenv-components
1616
endif
1717

18-
PYTHON_VERSION ?= python2.7
18+
PYTHON_VERSION ?= $(shell if [ -z "`which python3.6`" ]; then echo "python2.7"; else echo "python3.6"; fi)
1919

2020
BINARIES := bin
2121

@@ -50,7 +50,12 @@ COMPONENTS_TEST_MODULES_COMMA := $(subst $(space_char),$(comma),$(COMPONENTS_TES
5050
COVERAGE_GLOBS := .coverage.unit.* .coverage.integration.*
5151
COVERAGE_GLOBS_QUOTED := $(foreach glob,$(COVERAGE_GLOBS),'$(glob)')
5252

53-
REQUIREMENTS := test-requirements.txt requirements.txt
53+
ifeq ($(PYTHON_VERSION),python2.7)
54+
REQUIREMENTS := test-requirements-py27.txt requirements.txt
55+
else
56+
REQUIREMENTS := test-requirements.txt requirements.txt
57+
endif
58+
5459
# Pin common pip version here across all the targets
5560
# Note! Periodic maintenance pip upgrades are required to be up-to-date with the latest pip security fixes and updates
5661
PIP_VERSION ?= 20.0.2
@@ -107,6 +112,8 @@ all: requirements configgen check tests
107112
# Target for debugging Makefile variable assembly
108113
.PHONY: play
109114
play:
115+
@echo PYTHON_VERSION=$(PYTHON_VERSION)
116+
@echo
110117
@echo COVERAGE_GLOBS=$(COVERAGE_GLOBS_QUOTED)
111118
@echo
112119
@echo COMPONENTS=$(COMPONENTS)
@@ -226,8 +233,7 @@ check-python-packages:
226233
@echo ""
227234
@echo "================== CHECK PYTHON PACKAGES ===================="
228235
@echo ""
229-
230-
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_COMPONENTS_DIR) --no-download
236+
test -f $(VIRTUALENV_COMPONENTS_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_COMPONENTS_DIR) --no-download --system-site-packages
231237
@for component in $(COMPONENTS_WITHOUT_ST2TESTS); do \
232238
echo "==========================================================="; \
233239
echo "Checking component:" $$component; \
@@ -263,7 +269,7 @@ checklogs:
263269
@echo
264270
@echo "================== LOG WATCHER ===================="
265271
@echo
266-
. $(VIRTUALENV_DIR)/bin/activate; ./tools/log_watcher.py 10
272+
. $(VIRTUALENV_DIR)/bin/activate; python ./tools/log_watcher.py 10
267273

268274
.PHONY: pylint
269275
pylint: requirements .pylint
@@ -329,7 +335,7 @@ lint-api-spec: requirements .lint-api-spec
329335
@echo
330336
@echo "================== Lint API spec ===================="
331337
@echo
332-
. $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-validate-api-spec --config-file conf/st2.dev.conf
338+
. $(VIRTUALENV_DIR)/bin/activate; python st2common/bin/st2-validate-api-spec --config-file conf/st2.dev.conf
333339

334340
.PHONY: generate-api-spec
335341
generate-api-spec: requirements .generate-api-spec
@@ -343,14 +349,14 @@ generate-api-spec: requirements .generate-api-spec
343349
echo "# Edit st2common/st2common/openapi.yaml.j2 and then run" >> st2common/st2common/openapi.yaml
344350
echo "# make .generate-api-spec" >> st2common/st2common/openapi.yaml
345351
echo "# to generate the final spec file" >> st2common/st2common/openapi.yaml
346-
. $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-generate-api-spec --config-file conf/st2.dev.conf >> st2common/st2common/openapi.yaml
352+
. $(VIRTUALENV_DIR)/bin/activate; python st2common/bin/st2-generate-api-spec --config-file conf/st2.dev.conf >> st2common/st2common/openapi.yaml
347353

348354
.PHONY: circle-lint-api-spec
349355
circle-lint-api-spec:
350356
@echo
351357
@echo "================== Lint API spec ===================="
352358
@echo
353-
. $(VIRTUALENV_DIR)/bin/activate; st2common/bin/st2-validate-api-spec --config-file conf/st2.dev.conf || echo "Open API spec lint failed."
359+
. $(VIRTUALENV_DIR)/bin/activate; python st2common/bin/st2-validate-api-spec --config-file conf/st2.dev.conf || echo "Open API spec lint failed."
354360

355361
.PHONY: flake8
356362
flake8: requirements .flake8
@@ -375,7 +381,7 @@ flake8: requirements .flake8
375381
@echo
376382
@echo "==================== st2client install check ===================="
377383
@echo
378-
test -f $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_ST2CLIENT_DIR) --no-download
384+
test -f $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate || virtualenv --python=$(PYTHON_VERSION) $(VIRTUALENV_ST2CLIENT_DIR) --no-download --system-site-packages
379385

380386
# Setup PYTHONPATH in bash activate script...
381387
# Delete existing entries (if any)
@@ -389,11 +395,12 @@ flake8: requirements .flake8
389395
touch $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate
390396
chmod +x $(VIRTUALENV_ST2CLIENT_DIR)/bin/activate
391397

392-
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
393398
# NOTE We need to upgrade setuptools to avoid bug with dependency resolving in old versions
394399
# Setuptools 42 added support for python_requires, which is used by the configparser package,
395400
# which is required by the importlib-metadata package
401+
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
396402
$(VIRTUALENV_ST2CLIENT_DIR)/bin/pip install --upgrade "setuptools==44.1.0"
403+
397404
$(VIRTUALENV_ST2CLIENT_DIR)/bin/activate; cd st2client ; ../$(VIRTUALENV_ST2CLIENT_DIR)/bin/python setup.py install ; cd ..
398405
$(VIRTUALENV_ST2CLIENT_DIR)/bin/st2 --version
399406
$(VIRTUALENV_ST2CLIENT_DIR)/bin/python -c "import st2client"
@@ -541,10 +548,9 @@ requirements: virtualenv .requirements .sdist-requirements install-runners insta
541548
fi
542549

543550
# Install requirements
544-
#
545551
for req in $(REQUIREMENTS); do \
546-
echo "Installing $$req..." ; \
547-
$(VIRTUALENV_DIR)/bin/pip install $(PIP_OPTIONS) -r $$req ; \
552+
echo "Installing $$req..." ; \
553+
$(VIRTUALENV_DIR)/bin/pip install $(PIP_OPTIONS) -r $$req ; \
548554
done
549555

550556
# Install st2common package to load drivers defined in st2common setup.py
@@ -626,7 +632,7 @@ endif
626632
tests: pytests
627633

628634
.PHONY: pytests
629-
pytests: compile requirements .flake8 .pylint .pytests-coverage
635+
pytests: compilepy3 requirements .flake8 .pylint .pytests-coverage
630636

631637
.PHONY: .pytests
632638
.pytests: compile .configgen .generate-api-spec .unit-tests clean
@@ -963,7 +969,7 @@ debs:
963969
ci: ci-checks ci-unit ci-integration ci-packs-tests
964970

965971
.PHONY: ci-checks
966-
ci-checks: compile .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages
972+
ci-checks: compilepy3 .generated-files-check .pylint .flake8 check-requirements check-sdist-requirements .st2client-dependencies-check .st2common-circular-dependencies-check circle-lint-api-spec .rst-check .st2client-install-check check-python-packages
967973

968974
.PHONY: ci-py3-unit
969975
ci-py3-unit:

0 commit comments

Comments
 (0)