Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds feature to track garden information on Requests #440

Merged
merged 1 commit into from
Jan 8, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Brewtils Changelog
TBD

- Fixed self reference bug that was returning back output instead of Request object.
- Added Source/Target Garden labels on Request model

3.23.0
------
Expand Down
4 changes: 4 additions & 0 deletions brewtils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@ def __init__(
status_updated_at=None,
has_parent=None,
requester=None,
source_garden=None,
target_garden=None,
):
super(Request, self).__init__(
system=system,
Expand All @@ -681,6 +683,8 @@ def __init__(
self.error_class = error_class
self.has_parent = has_parent
self.requester = requester
self.source_garden = source_garden
self.target_garden = target_garden

@classmethod
def from_template(cls, template, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions brewtils/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ class RequestSchema(RequestTemplateSchema):
)
has_parent = fields.Bool(allow_none=True)
requester = fields.String(allow_none=True)
source_garden = fields.String(allow_none=True)
target_garden = fields.String(allow_none=True)


class StatusInfoSchema(BaseSchema):
Expand Down
6 changes: 6 additions & 0 deletions brewtils/test/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ def child_request_dict(ts_epoch):
"metadata": {"child": "stuff"},
"has_parent": True,
"requester": "user",
"source_garden": "parent",
"target_garden": "child",
}


Expand Down Expand Up @@ -345,6 +347,8 @@ def parent_request_dict(ts_epoch):
"metadata": {"parent": "stuff"},
"has_parent": False,
"requester": "user",
"source_garden": "parent",
"target_garden": "child",
}


Expand Down Expand Up @@ -408,6 +412,8 @@ def request_dict(parent_request_dict, child_request_dict, ts_epoch):
"metadata": {"request": "stuff"},
"has_parent": True,
"requester": "user",
"source_garden": "parent",
"target_garden": "child",
}


Expand Down
Loading