@@ -50,7 +50,9 @@ def test_ai_autofix_get_endpoint_with_autofix(
50
50
assert "profile" not in response .data ["autofix" ]["request" ]
51
51
assert "issue_summary" not in response .data ["autofix" ]["request" ]
52
52
53
- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
53
+ mock_get_autofix_state .assert_called_once_with (
54
+ group_id = group .id , check_repo_access = True , is_user_fetching = False
55
+ )
54
56
55
57
@patch ("sentry.api.endpoints.group_ai_autofix.get_autofix_state" )
56
58
def test_ai_autofix_get_endpoint_without_autofix (
@@ -65,7 +67,9 @@ def test_ai_autofix_get_endpoint_without_autofix(
65
67
assert response .status_code == 200
66
68
assert response .data ["autofix" ] is None
67
69
68
- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
70
+ mock_get_autofix_state .assert_called_once_with (
71
+ group_id = group .id , check_repo_access = True , is_user_fetching = False
72
+ )
69
73
70
74
@patch ("sentry.api.endpoints.group_ai_autofix.get_autofix_state" )
71
75
@patch ("sentry.api.endpoints.group_ai_autofix.get_sorted_code_mapping_configs" )
@@ -650,7 +654,7 @@ def test_ai_autofix_get_endpoint_cache_miss(
650
654
# Verify cache behavior - cache miss should trigger repo access check
651
655
mock_cache .get .assert_called_once_with (f"autofix_access_check:{ self .group .id } " )
652
656
mock_get_autofix_state .assert_called_once_with (
653
- group_id = self .group .id , check_repo_access = True
657
+ group_id = self .group .id , check_repo_access = True , is_user_fetching = False
654
658
)
655
659
656
660
# Verify the cache was set with a 60-second timeout
@@ -681,7 +685,7 @@ def test_ai_autofix_get_endpoint_cache_hit(
681
685
# Verify cache behavior - cache hit should skip repo access check
682
686
mock_cache .get .assert_called_once_with (f"autofix_access_check:{ self .group .id } " )
683
687
mock_get_autofix_state .assert_called_once_with (
684
- group_id = self .group .id , check_repo_access = False
688
+ group_id = self .group .id , check_repo_access = False , is_user_fetching = False
685
689
)
686
690
687
691
# Verify the cache was not set again
@@ -713,7 +717,9 @@ def test_ai_autofix_get_endpoint_polling_behavior(
713
717
714
718
# Verify first request behavior
715
719
mock_cache .get .assert_called_once_with (f"autofix_access_check:{ group .id } " )
716
- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
720
+ mock_get_autofix_state .assert_called_once_with (
721
+ group_id = group .id , check_repo_access = True , is_user_fetching = False
722
+ )
717
723
mock_cache .set .assert_called_once_with (f"autofix_access_check:{ group .id } " , True , timeout = 60 )
718
724
719
725
# Reset mocks for second request
@@ -728,7 +734,9 @@ def test_ai_autofix_get_endpoint_polling_behavior(
728
734
729
735
# Verify second request behavior
730
736
mock_cache .get .assert_called_once_with (f"autofix_access_check:{ group .id } " )
731
- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = False )
737
+ mock_get_autofix_state .assert_called_once_with (
738
+ group_id = group .id , check_repo_access = False , is_user_fetching = False
739
+ )
732
740
mock_cache .set .assert_not_called ()
733
741
734
742
# Reset mocks for third request
@@ -743,5 +751,7 @@ def test_ai_autofix_get_endpoint_polling_behavior(
743
751
744
752
# Verify third request behavior - should be like the first request
745
753
mock_cache .get .assert_called_once_with (f"autofix_access_check:{ group .id } " )
746
- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
754
+ mock_get_autofix_state .assert_called_once_with (
755
+ group_id = group .id , check_repo_access = True , is_user_fetching = False
756
+ )
747
757
mock_cache .set .assert_called_once_with (f"autofix_access_check:{ group .id } " , True , timeout = 60 )
0 commit comments