Skip to content

Commit

Permalink
bug-1908543: remove s3_ prefix from keys in crash verify response (#6670
Browse files Browse the repository at this point in the history
)
  • Loading branch information
relud authored Jul 18, 2024
1 parent fd9a519 commit d280199
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
24 changes: 12 additions & 12 deletions webapp/crashstats/api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,9 @@ def test_elastcsearch_has_crash(self, storage_helper, client):
assert data == {
"uuid": uuid,
"elasticsearch_crash": True,
"s3_raw_crash": False,
"s3_processed_crash": False,
"s3_telemetry_crash": False,
"raw_crash": False,
"processed_crash": False,
"telemetry_crash": False,
}

def test_raw_crash_has_crash(self, storage_helper, client):
Expand All @@ -655,10 +655,10 @@ def test_raw_crash_has_crash(self, storage_helper, client):

assert data == {
"uuid": uuid,
"s3_raw_crash": True,
"s3_processed_crash": False,
"raw_crash": True,
"processed_crash": False,
"elasticsearch_crash": False,
"s3_telemetry_crash": False,
"telemetry_crash": False,
}

def test_processed_has_crash(self, storage_helper, client):
Expand Down Expand Up @@ -687,10 +687,10 @@ def test_processed_has_crash(self, storage_helper, client):

assert data == {
"uuid": uuid,
"s3_processed_crash": True,
"s3_raw_crash": False,
"processed_crash": True,
"raw_crash": False,
"elasticsearch_crash": False,
"s3_telemetry_crash": False,
"telemetry_crash": False,
}

def test_telemetry_has_crash(self, storage_helper, client):
Expand Down Expand Up @@ -719,9 +719,9 @@ def test_telemetry_has_crash(self, storage_helper, client):

assert data == {
"uuid": uuid,
"s3_telemetry_crash": True,
"s3_raw_crash": False,
"s3_processed_crash": False,
"telemetry_crash": True,
"raw_crash": False,
"processed_crash": False,
"elasticsearch_crash": False,
}

Expand Down
20 changes: 10 additions & 10 deletions webapp/crashstats/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,22 +476,22 @@ def crash_verify(request):

data = {"uuid": crash_id}

# Check S3 crash bucket for raw and processed crash data
# Check crash bucket for raw and processed crash data
raw_api = models.RawCrash()
try:
raw_api.get(crash_id=crash_id, dont_cache=True, refresh_cache=True)
has_raw_crash = True
except CrashIDNotFound:
has_raw_crash = False
data["s3_raw_crash"] = has_raw_crash
data["raw_crash"] = has_raw_crash

processed_api = models.ProcessedCrash()
try:
processed_api.get(crash_id=crash_id, dont_cache=True, refresh_cache=True)
has_processed_crash = True
except CrashIDNotFound:
has_processed_crash = False
data["s3_processed_crash"] = has_processed_crash
data["processed_crash"] = has_processed_crash

# Check Elasticsearch for crash data
supersearch_api = supersearch_models.SuperSearch()
Expand All @@ -507,14 +507,14 @@ def crash_verify(request):
results["total"] == 1 and results["hits"][0]["uuid"] == crash_id
)

# Check S3 telemetry bucket for crash data
# Check telemetry bucket for crash data
telemetry_api = models.TelemetryCrash()
try:
telemetry_api.get(crash_id=crash_id, dont_cache=True, refresh_cache=True)
has_telemetry_crash = True
except CrashIDNotFound:
has_telemetry_crash = False
data["s3_telemetry_crash"] = has_telemetry_crash
data["telemetry_crash"] = has_telemetry_crash

return http.JsonResponse(data, status=200)

Expand Down Expand Up @@ -661,22 +661,22 @@ def get(self, request):

data = {"uuid": crash_id}

# Check S3 crash bucket for raw and processed crash data
# Check crash bucket for raw and processed crash data
raw_api = models.RawCrash()
try:
raw_api.get(crash_id=crash_id, dont_cache=True, refresh_cache=True)
has_raw_crash = True
except CrashIDNotFound:
has_raw_crash = False
data["s3_raw_crash"] = has_raw_crash
data["raw_crash"] = has_raw_crash

processed_api = models.ProcessedCrash()
try:
processed_api.get(crash_id=crash_id, dont_cache=True, refresh_cache=True)
has_processed_crash = True
except CrashIDNotFound:
has_processed_crash = False
data["s3_processed_crash"] = has_processed_crash
data["processed_crash"] = has_processed_crash

# Check Elasticsearch for crash data
supersearch_api = supersearch_models.SuperSearch()
Expand All @@ -692,14 +692,14 @@ def get(self, request):
results["total"] == 1 and results["hits"][0]["uuid"] == crash_id
)

# Check S3 telemetry bucket for crash data
# Check telemetry bucket for crash data
telemetry_api = models.TelemetryCrash()
try:
telemetry_api.get(crash_id=crash_id, dont_cache=True, refresh_cache=True)
has_telemetry_crash = True
except CrashIDNotFound:
has_telemetry_crash = False
data["s3_telemetry_crash"] = has_telemetry_crash
data["telemetry_crash"] = has_telemetry_crash

return Response(data)

Expand Down

0 comments on commit d280199

Please sign in to comment.