Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Python 3.6 is no longer supported; Stackstorm requires at least Python 3.8.

Fixed
~~~~~
* Fixed #6021 and #5327 by adding max_page_size to api_opts and added limit and offset to list_values() methods of
both action_service and sensor_service
* Fix `packs.get` action. Assumed `master` is primary branch on all packs. #6225
* Restore Pack integration testing (it was inadvertently skipped) and stop testing against `bionic` and `el7`. #6135
* Fix Popen.pid typo in st2tests. #6184
Expand All @@ -22,7 +24,7 @@ Changed
Contributed by (@philipphomberger Schwarz IT KG)
* Refactor `tools/launchdev.sh` to use `tmux` instead of `screen`. #6186 (by @nzlosh and @cognifloyd)
* Updated package build container environment to use py3.8 and mongo4.4 #6129
* Fic misc DeprecationWarnings to prepare for python 3.10 support. #6188 (by @nzlosh)
* Fix misc DeprecationWarnings to prepare for python 3.10 support. #6188 (by @nzlosh)
* Update st2client deps: editor and prompt-toolkit. #6189 (by @nzlosh)
* Updated dependency oslo.config to prepare for python 3.10 support. #6193 (by @nzlosh)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ def get_user_info(self):
# Methods for datastore management
##################################

def list_values(self, local=True, prefix=None):
return self.datastore_service.list_values(local=local, prefix=prefix)
def list_values(self, local=True, prefix=None, limit=None, offset=None):
return self.datastore_service.list_values(
local=local, prefix=prefix, limit=limit, offset=offset
)

def get_value(self, name, local=True, scope=SYSTEM_SCOPE, decrypt=False):
return self.datastore_service.get_value(
Expand Down
6 changes: 6 additions & 0 deletions st2common/st2common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ def register_opts(ignore_errors=False):
default=["http://127.0.0.1:3000"],
help="List of origins allowed for api, auth and stream",
),
cfg.IntOpt(
"max_page_size",
default=100,
help="Maximum limit (page size) argument which can be specified by the "
"user in a query string.",
),
cfg.BoolOpt(
"mask_secrets",
default=True,
Expand Down
6 changes: 4 additions & 2 deletions st2reactor/st2reactor/container/sensor_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ def dispatch_with_context(self, trigger, payload=None, trace_context=None):
# Methods for datastore management
##################################

def list_values(self, local=True, prefix=None):
return self.datastore_service.list_values(local=local, prefix=prefix)
def list_values(self, local=True, prefix=None, limit=None, offset=None):
return self.datastore_service.list_values(
local=local, prefix=prefix, limit=limit, offset=offset
)

def get_value(self, name, local=True, scope=SYSTEM_SCOPE, decrypt=False):
return self.datastore_service.get_value(
Expand Down
6 changes: 0 additions & 6 deletions st2tests/st2tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ def _register_api_opts():

api_opts = [
cfg.BoolOpt("debug", default=True),
cfg.IntOpt(
"max_page_size",
default=100,
help="Maximum limit (page size) argument which can be specified by the user in a query "
"string. If a larger value is provided, it will default to this value.",
),
]

_register_opts(api_opts, group="api")
Expand Down
2 changes: 1 addition & 1 deletion st2tests/st2tests/mocks/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_user_info(self):
# Methods for datastore management
##################################

def list_values(self, local=True, prefix=None):
def list_values(self, local=True, limit=None, prefix=None, offset=0):
"""
Return a list of all values stored in a dictionary which is local to this class.
"""
Expand Down