Skip to content

Commit

Permalink
Merge branch 'master' into ogi/feat/on-demand-alerts-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
obostjancic committed Jul 18, 2023
2 parents 1eb6e1d + 54a1d8f commit 854d407
Show file tree
Hide file tree
Showing 272 changed files with 5,897 additions and 2,090 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ jobs:
fail-fast: false
matrix:
# XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL.
instance: [0, 1, 2, 3, 4, 5]
instance: [0, 1, 2, 3, 4, 5, 6]
pg-version: ['14']

env:
# XXX: `MATRIX_INSTANCE_TOTAL` must be hardcoded to the length of `strategy.matrix.instance`.
# If this increases, make sure to also increase `flags.backend.after_n_builds` in `codecov.yml`.
MATRIX_INSTANCE_TOTAL: 6
MATRIX_INSTANCE_TOTAL: 7

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
Expand Down
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"recommendations": [
"esbenp.prettier-vscode",
"ms-python.python",
"ms-python.black-formatter",
"dbaeumer.vscode-eslint",
"lextudio.restructuredtext",
"ziyasal.vscode-open-in-github",
"timonwong.shellcheck"
"timonwong.shellcheck",
"tyriar.sort-lines",
]
}
50 changes: 50 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
23.7.0
------

### Escalating Issues V2 (EA) (ongoing)

This is a placeholder milestone for tracking post-v1 work for escalating issues.
See the RFC: https://github.com/getsentry/rfcs/blob/main/text/0078-escalating-issues.md
There's also discussions about escalation in here:
https://github.com/getsentry/sentry/discussions/43039

V2 will focus on moving ongoing issues (upcoming) into the state archived-until-escalating after an issue being in the `ongoing` state for 14 days.


By: @snigdhas (#52360)

### Search Shortcuts (ongoing)

Make common searches more accessible and discoverable for users. [notion page](https://www.notion.so/sentry/Search-Shortcuts-fka-Assignee-Filter-on-Issue-Stream-648954e782d04805bc64f1983e5cbd16?pvs=4)

By: @scttcper (#52414, #52348)

### Various fixes & improvements

- test(hybrid-cloud): Stabilizes sentry app install tests (#53004) by @GabeVillalobos
- ref(saved search): Migrate betterPriority to priority (#52909) by @ceorourke
- ref(sort): Change betterPriority to priority (#52910) by @ceorourke
- feat(crons): Use timeout_at for timed out check-ins (#52570) by @rjo100
- ref(event_manager): Fix typing issues for event_manager (#52974) by @armenzg
- test(backup): Add more model tests (#52923) by @azaslavsky
- fix(replays): fix bin/mock-replays script (#52927) by @michellewzhang
- ref(crons): Change to uuid validator for trace (#52561) by @rjo100
- fix(crons): Properly checks for environment name lengths (#52820) by @rjo100
- feat(grouping): Add metrics for issue merging and unmerging (#52919) by @lobsterkatie
- chore(starfish): Adding referrers to starfish (#52749) by @wmak
- chore(starfish): Add starfish referrers to the backend (#52754) by @wmak
- ref(tsc): usageChart utils to tsx (#52935) by @IanWoodard
- chore(hybrid-cloud): Add tags to debug Identity service (#52997) by @dashed
- feat(starfish): Add unit and types for rates (#52991) by @wmak
- ref(replay): Refactor the "Next Breadcrumb" button to use *Frame types (#52931) by @ryan953
- fix(group-attributes): log metric when post_save.send(update_fields=["status", "subs"]) is called for group (#52996) by @barkbarkimashark
- fix(releases): Use query parameter when switching filters (#52937) by @scttcper
- fix(discord): Change log level from error to info for unauthorized interactions (#52946) by @spalmurray
- ref: fix typing for sentry.models.__init__ (#52992) by @asottile-sentry
- feat(replay): Render the replay currentTime & hoverTime inside the performance waterfall (#52890) by @ryan953
- feat(perf): Hide timing metrics on http (#52993) by @k-fish
- fix(issue-details): Fix react warning (#52907) by @roggenkemper
- fix(hybrid-cloud): Fixes tests for split DB mode app installs using transaction routing and silo annotations (#52932) by @GabeVillalobos

_Plus 434 more_

23.6.2
------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that you d
error-reporting or application monitoring features of the
Licensed Work.

Change Date: 2026-07-06
Change Date: 2026-07-17

Change License: Apache License, Version 2.0

Expand Down
97 changes: 80 additions & 17 deletions bin/mock-replay
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
#!/usr/bin/env python
from io import BytesIO
from zlib import compress

from sentry.runner import configure
from sentry.utils.json import dumps_htmlsafe

configure()
import datetime
import pathlib
import uuid
from datetime import datetime, timedelta

import click
import requests
from django.conf import settings

from sentry.models import File, Organization, Project
from sentry.models import File, Organization, Project, Team
from sentry.replays.models import ReplayRecordingSegment
from sentry.replays.testutils import mock_replay
from sentry.replays.testutils import (
mock_replay,
mock_rrweb_div_helloworld,
mock_segment_click,
mock_segment_console,
mock_segment_fullsnapshot,
mock_segment_init,
mock_segment_nagivation,
mock_segment_rageclick,
)


def store_replay(replay):
Expand All @@ -22,16 +35,53 @@ def store_replay(replay):
assert response.status_code == 200


def create_recording_segment(replay_id, project_id, filename, segment_id):
with open(filename, "rb") as f:
file = File.objects.create(name=filename, type="application/octet-stream")
file.putfile(f)

def create_recording(replay_id, project_id, timestamp):
segments = [
mock_segment_init(timestamp),
mock_segment_fullsnapshot(timestamp, [mock_rrweb_div_helloworld()]),
mock_segment_console(timestamp),
mock_segment_nagivation(timestamp + timedelta(seconds=1), hrefFrom="/", hrefTo="/home/"),
mock_segment_nagivation(
timestamp + timedelta(seconds=2), hrefFrom="/home/", hrefTo="/profile/"
),
mock_segment_rageclick(
timestamp + timedelta(seconds=2),
"nav.app-65yvxw.e1upz5ks6[aria-label='Primary Navigation'] > div.app-1v175cc.e1upz5ks4",
"sidebar-item-performance",
"a",
24,
),
mock_segment_click(
timestamp + timedelta(seconds=2),
"nav.app-65yvxw.e1upz5ks6[aria-label='Primary Navigation'] > div.app-1v175cc.e1upz5ks4",
"sidebar-item-performance",
"a",
),
mock_segment_nagivation(
timestamp + timedelta(seconds=6),
hrefFrom="/profile/",
hrefTo="/performance/",
),
mock_segment_rageclick(
timestamp + timedelta(seconds=6),
"nav.app-65yvxw.e1upz5ks6[aria-label='Primary Navigation'] > div.app-1v175cc.e1upz5ks4",
"sidebar-item-performance",
"a",
24,
),
]
for (segment_id, segment) in enumerate(segments):
store_replay_segments(replay_id, project_id, segment_id, segment)


def store_replay_segments(replay_id: str, project_id: str, segment_id: int, segment):
f = File.objects.create(name="rr:{segment_id}", type="replay.recording")
f.putfile(BytesIO(compress(dumps_htmlsafe(segment).encode())))
ReplayRecordingSegment.objects.create(
replay_id=replay_id.replace("-", ""),
replay_id=replay_id,
project_id=project_id,
segment_id=segment_id,
file_id=file.id,
file_id=f.id,
)


Expand All @@ -41,7 +91,13 @@ def make_filename(filename: str) -> str:


def main():
project_name = "Replay Test"
project_name = "Replay Test Project"

if not settings.SENTRY_FEATURES["organizations:session-replay"]:
click.echo(
'Session Replays is currently turned off! \nTo enable, add the following line to your local sentry.conf.py file: \nSENTRY_FEATURES["organizations:session-replay"] = True'
)
exit()

if settings.SENTRY_SINGLE_ORGANIZATION:
org = Organization.get_default()
Expand All @@ -51,25 +107,32 @@ def main():
org, _ = Organization.objects.get_or_create(slug="default")

click.echo(f" > Mocking project {project_name}")

team, _ = Team.objects.get_or_create(
organization=org, slug="sentry", defaults={"name": "Sentry"}
)

project, _ = Project.objects.get_or_create(
name=project_name,
defaults={
"organization": org,
"flags": Project.flags.has_replays,
},
platform="javascript",
)

project.add_team(team)

replay_id = uuid.uuid4().hex
seq1_timestamp = datetime.datetime.now() - datetime.timedelta(seconds=22)
seq2_timestamp = datetime.datetime.now() - datetime.timedelta(seconds=5)
seq1_timestamp = datetime.now() - timedelta(seconds=15)
seq2_timestamp = datetime.now() - timedelta(seconds=5)

click.echo("Creating Clickhouse entries...")
click.echo("Creating Replay events entries...")
store_replay(mock_replay(seq1_timestamp, project.id, replay_id, segment_id=0))
store_replay(mock_replay(seq2_timestamp, project.id, replay_id, segment_id=1))

click.echo("Creating Postgres entries...")
create_recording_segment(replay_id, project.id, make_filename("rrweb-1658770770892.json"), 0)
create_recording_segment(replay_id, project.id, make_filename("rrweb-1658770772903.json"), 1)
click.echo("Creating Replay recording entries...")
create_recording(replay_id, project.id, seq1_timestamp)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ flags:
- "src/sentry/**/*.py"
carryforward: true
# Do not send any status checks until N coverage reports are uploaded
after_n_builds: 17
after_n_builds: 18

# Read more here: https://docs.codecov.com/docs/pull-request-comments
comment:
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion fixtures/js-stubs/span.js → fixtures/js-stubs/span.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
export function Span(params = {}) {
import type {RawSpanType} from 'sentry/components/events/interfaces/spans/types';

export function Span(params = {}): RawSpanType {
return {
timestamp: 1657201239.51,
start_timestamp: 1657201239.503,
op: 'ui.load',
span_id: 'a385d9fd52e0c4bc',
parent_span_id: 'bdf1a9fae2062311',
trace_id: '4d5c2e2102234a7d94102b4f1e41c2bb',
data: {},
...params,
};
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function Subscriptions(params = []) {
import type {Subscription} from 'sentry/views/settings/account/accountSubscriptions';

export function Subscriptions(params = []): Subscription[] {
return [
{
subscribedDate: '2018-01-08T05:14:59.102Z',
Expand Down
16 changes: 14 additions & 2 deletions fixtures/js-stubs/tags.js → fixtures/js-stubs/tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function Tags(params = []) {
import type {TagWithTopValues} from 'sentry/types';

export function Tags(params = []): TagWithTopValues[] {
return [
{
topValues: [
Expand Down Expand Up @@ -60,11 +62,21 @@ export function Tags(params = []) {
canDelete: true,
},
{
topValues: [{name: 'prod', value: 'prod', key: 'environment', count: 100}],
topValues: [
{
name: 'prod',
value: 'prod',
key: 'environment',
count: 100,
lastSeen: '2018-12-20T23:32:25Z',
firstSeen: '2018-05-06T03:48:28.825Z',
},
],
key: 'environment',
name: 'Environment',
canDelete: false,
totalValues: 100,
uniqueValues: 1,
},
{
topValues: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export function TagValues(params = []) {
import type {TagValue} from 'sentry/types';

export function TagValues(params = []): TagValue[] {
return [
{
username: 'david',
hash: '172522ec1028ab781d9dfd17eaca4427',
dateCreated: '2018-10-03T03:39:51.223Z',
lastSeen: '2018-12-20T23:32:25Z',
query: 'user.username:david',
id: '10799',
Expand All @@ -13,10 +13,10 @@ export function TagValues(params = []) {
avatarUrl:
'https://secure.gravatar.com/avatar/d66694bbc7619203377bd9c9b7b9f14a?s=32&d=mm',
value: 'username:david',
tagValue: 'username:david',
identifier: null,
identifier: undefined,
ipAddress: '128.126.232.84',
email: 'david@example.com',
ip_address: '0.0.0.0',
},
...params,
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function TeamAlertsTriggered() {
import type {AlertsTriggered} from 'sentry/views/organizationStats/teamInsights/teamAlertsTriggered';

export function TeamAlertsTriggered(): AlertsTriggered {
return {
'2021-08-20T00:00:00Z': 3,
'2021-08-21T00:00:00Z': 2,
Expand Down
Loading

0 comments on commit 854d407

Please sign in to comment.