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

fix(server): Validate release and environment attrs in sessions #1018

Merged
merged 5 commits into from
Jun 11, 2021

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Jun 8, 2021

Validates the release and environment attributes in sessions. Invalid
releases drop the session, since releases are required. Invalid environments are
simply removed.

@jan-auer jan-auer requested a review from a team June 8, 2021 11:37
@@ -468,3 +468,25 @@ def test_session_auto_ip(mini_sentry, relay_with_processing, sessions_consumer):
# Can't test ip_address since it's not posted to Kafka. Just test that it is accepted.
session = sessions_consumer.get_session()
assert session


def test_session_invalid_release(mini_sentry, relay_with_processing, sessions_consumer):
Copy link
Contributor

@ahmedetefy ahmedetefy Jun 8, 2021

Choose a reason for hiding this comment

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

I would add a test_session_invalid_environment test here too

"sid": "8333339f-5675-4f89-a9a0-1c935255ab58",
"timestamp": timestamp.isoformat(),
"started": timestamp.isoformat(),
"attrs": {"release": "latest"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Could do, but since this is in integration tests, I see little point in testing sentry-release-parser.

@jan-auer jan-auer merged commit 9d0d2dc into master Jun 11, 2021
@jan-auer jan-auer deleted the fix/validate-session-release branch June 11, 2021 09:47
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.

3 participants