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

LITE-28161 Add user id and name to Configuration events #42

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

Hairash
Copy link
Contributor

@Hairash Hairash commented Jul 24, 2023

No description provided.

@@ -61,7 +62,7 @@ class ConnectExtensionXvsWebApplication(WebApplicationBase):

@router.get(
'/deployments/requests',
summary='List all request accross deployments',
summary='List all requests across deployments',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just typos

@@ -238,7 +240,7 @@ def add_configuration(
mime_type=file_data.mime_type,
)
db.add(file_instance)
db.commit()
db.flush()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for transaction because db.commit() ends transaction

@@ -108,6 +108,12 @@ def test_post_configuration(
'mime_type': media_response['mime_type'],
},
},
headers={
"connect-auth": (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For tests it is better to generate the test signature based on human-readable input. Otherwise hard to understand what is inside and what should be expected in the tests

updated_at = db.Column(db.DateTime(), default=datetime.utcnow)
updated_by = db.Column(db.String(20))
updated_by = db.Column(db.JSON)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly speaking, I don't like the idea of storing it as JSON here, cause of:

  1. What id the name of the user changed?
  2. Filtering, rql or other filters doesn't support JSON fields filters for now

Let's have it as is for now, but I'll put it as the gap

@@ -72,7 +72,7 @@ class ConfigurationSchema(NonNullSchema):
id: str
file: FileSchema
state: ConfigurationStateChoices
events: Dict[str, Dict[str, Union[datetime, str]]]
events: Dict[str, Dict[str, Union[datetime, Dict[str, str]]]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future --> TypeAliases will help you

@d3rky d3rky merged commit b6773e2 into master Jul 24, 2023
8 checks passed
@d3rky d3rky deleted the LITE-28161-add-user-info branch July 25, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants