Skip to content

Commit

Permalink
Merge branch 'master' into disable-recursively-evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
guzzijones authored Sep 20, 2024
2 parents 160a8dd + 5ba1467 commit 91b348f
Show file tree
Hide file tree
Showing 27 changed files with 241 additions and 112 deletions.
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ exclude_lines =
if __name__ == .__main__.:

ignore_errors = True
omit = orquesta/tests/*

omit =
tests/*
14 changes: 7 additions & 7 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ on:

jobs:
tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
pip install -r requirements-ci.txt
make clean reqs schemas
- name: "Run tox for ${{ matrix.python-version }}"
run: |
tox
run: make check
7 changes: 1 addition & 6 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
[MESSAGES CONTROL]
# C0111 Missing docstring
# I0011 Warning locally suppressed using disable-msg
# I0012 Warning locally suppressed using disable-msg
# W0704 Except doesn't do anything Used when an except clause does nothing but "pass" and there is no "else" clause
# W0142 Used * or * magic* Used when a function or method is called using *args or **kwargs to dispatch arguments.
# W0212 Access to a protected member %s of a client class
# W0232 Class has no __init__ method Used when a class has no __init__ method, neither its parent classes.
# W0613 Unused argument %r Used when a function or method argument is not used.
# W0702 No exception's type specified Used when an except clause doesn't specify exceptions type to catch.
# R0201 Method could be a function
# W0614 Unused import XYZ from wildcard import
# R0914 Too many local variables
# R0912 Too many branches
# R0915 Too many statements
# R0913 Too many arguments
# R0904 Too many public methods
# E0211: Method has no argument
disable=C0103,C0111,I0011,I0012,W0704,W0142,W0212,W0232,W0613,W0702,R0201,W0614,R0914,R0912,R0915,R0913,R0904,R0801
disable=C0103,C0111,I0011,W0212,W0613,W0702,W0614,R0914,R0912,R0915,R0913,R0904,R0801

[TYPECHECK]
# Note: This modules are manipulated during the runtime so we can't detect all the properties during
Expand Down
39 changes: 38 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Changelog
=========

1.5.1
-----
Added
~~~~~
Expand All @@ -10,6 +9,44 @@ Added
Contributed by @moradf90


Unreleased
----------

Changed
~~~~~~~
* Dropped python3.6 support.
Contributed by @nzlosh
* Use pip 24.0 in virtualenv
Contributed by @nzlosh
* Aligned pinned dependencies with St2 core.
Contributed by @nzlosh

Fixed
~~~~~


1.6.0
-----

Changed
~~~~~~~

* Update deprecated `collections` imports to `collections.abc` to be forward-compatible with Python3.10
Contributed by @AndroxxTraxxon
* Migrate from `nosetest` to `pytest` for Python test runner.
Contributed by @AndroxxTraxxon
* Add Python versions 3.9, 3.10, and 3.11 to the test matrix
Contributed by @AndroxxTraxxon

Fixed
~~~~~

* Update networkx >=2.6 for Python 3.8 to fix insecure deserialization #255 (security fix)
Contributed by @Stealthii
* Update jsonschema requirements to allow 3.2 (security fix)
Contributed by @james-bellamy


1.5.0
-----

Expand Down
45 changes: 30 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020-2024 StackStorm contributors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -10,7 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

PY3 := $(shell which python3)
PY3 := python3
SYS_PY3 := $(shell which $(PY3))
PIP_VERSION = 24.0

# Virtual Environment
VENV_DIR ?= .venv
Expand All @@ -21,47 +26,59 @@ TOX_DIR ?= .tox
# Sphinx Document Options
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXAUTO = sphinx-autobuild
SPHINXAUTO = sphinx-autobuild
SPHINXPROJ = Orquesta
SOURCEDIR = docs/source
BUILDDIR = docs/build
EGGDIR = orquesta.egg-info

# Packaging Options
PKGDISTDIR = dist
PKGBUILDDIR = build


.PHONY: all
all: clean reqs schemas check package

.PHONY: clean
clean:
rm -rf $(VENV_DIR)
rm -rf $(TOX_DIR)
rm -rf $(BUILDDIR)
rm -rf $(PKGDISTDIR)
rm -rf $(PKGBUILDDIR)
rm -rf $(EGGDIR)

.PHONY: venv
venv:
test -d $(VENV_DIR) || virtualenv -p $(PY3) $(VENV_DIR)
test -d $(VENV_DIR) || $(SYS_PY3) -m venv $(VENV_DIR)

.PHONY: reqs
reqs: venv
$(VENV_DIR)/bin/pip install --upgrade "pip==20.3.3"
reqs: venv check_virtualenv
echo Install pip version $(PIP_VERSION) to match st2 core.
$(VENV_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
$(VENV_DIR)/bin/pip install -r requirements.txt
$(VENV_DIR)/bin/pip install -r requirements-test.txt
$(VENV_DIR)/bin/pip install -r requirements-docs.txt
$(VENV_DIR)/bin/pip install -r requirements-ci.txt
$(VENV_DIR)/bin/python setup.py develop
echo

.PHONY: check_virtualenv
check_virtualenv:
test -d $(VENV_DIR) || exit 1

.PHONY: schemas
schemas: reqs
$(VENV_DIR)/bin/python bin/orquesta-generate-schemas
schemas: check_virtualenv
$(VENV_DIR)/bin/$(PY3) bin/orquesta-generate-schemas

.PHONY: format
format:
format: check_virtualenv
$(VENV_DIR)/bin/black orquesta bin setup.py -l 100

.PHONY: check
check:
tox
check: check_virtualenv
$(VENV_DIR)/bin/tox

.PHONY: docs
docs: reqs
Expand All @@ -74,14 +91,12 @@ livedocs: reqs
. $(VENV_DIR)/bin/activate; $(SPHINXAUTO) -H 0.0.0.0 -b html $(SOURCEDIR) $(BUILDDIR)/html

.PHONY: package
package:
package: check_virtualenv
rm -rf $(PKGDISTDIR)
rm -rf $(PKGBUILDDIR)
$(VENV_DIR)/bin/python setup.py sdist bdist_wheel
$(VENV_DIR)/bin/$(PY3) setup.py sdist bdist_wheel

.PHONY: publish
publish: package
$(VENV_DIR)/bin/python -m twine upload dist/*
$(VENV_DIR)/bin/$(PY3) -m twine upload dist/*

.PHONY: all
all: clean reqs schemas check package
51 changes: 25 additions & 26 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

# -- Project information -----------------------------------------------------

project = u'StackStorm Orquesta'
copyright = u'2018, StackStorm'
author = u'StackStorm'
project = "StackStorm Orquesta"
copyright = "2018-2023, StackStorm"
author = "StackStorm"

# The short X.Y version
version = u''
version = ""
# The full version, including alpha/beta/rc tags
release = u''
release = ""


# -- General configuration ---------------------------------------------------
Expand All @@ -40,43 +40,43 @@
# ones.
extensions = [
# Add theme as extension so sitemap.xml is generated
'sphinx_rtd_theme'
"sphinx_rtd_theme"
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -87,7 +87,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -103,7 +103,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Orquestadoc'
htmlhelp_basename = "Orquestadoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -112,15 +112,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -130,19 +127,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Orquesta.tex', u'Orquesta Documentation',
u'StackStorm', 'manual'),
(master_doc, "Orquesta.tex", "Orquesta Documentation", "StackStorm", "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'orquesta', u'Orquesta Documentation',
[author], 1)
]
man_pages = [(master_doc, "orquesta", "Orquesta Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -151,7 +144,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Orquesta', u'Orquesta Documentation',
author, 'Orquesta', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Orquesta",
"Orquesta Documentation",
author,
"Orquesta",
"One line description of project.",
"Miscellaneous",
),
]
3 changes: 2 additions & 1 deletion orquesta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "1.5.1"
__version__ = "1.6.0"

4 changes: 3 additions & 1 deletion orquesta/conducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ def log_entry(
result=None,
data=None,
):

# Check entry type.
if entry_type not in ["info", "warn", "error"]:
raise exc.WorkflowLogEntryError('The log entry type "%s" is not valid.' % entry_type)
Expand Down Expand Up @@ -629,6 +628,9 @@ def _evaluate_task_actions(self, task):
active_items = list(filter(lambda x: x[1]["status"] in statuses.ACTIVE_STATUSES, all_items))

if task["concurrency"] is not None:
# Concurrency below 1 prevents scheduling of tasks.
if task["concurrency"] <= 0:
task["concurrency"] = 1
availability = task["concurrency"] - len(active_items)
candidates = list(zip(*notrun_items[:availability]))
task["actions"] = list(candidates[0]) if candidates and availability > 0 else []
Expand Down
Loading

0 comments on commit 91b348f

Please sign in to comment.