Skip to content

Commit 36b0d24

Browse files
dkamclaude
andcommitted
Make the test suite fully green; drop the migration review doc
Resolve the 4 pre-existing failures that predated this branch (broken auto-generated scaffold stubs + one test for an unimplemented feature): - DsnAuthenticationService: support GlitchTip's ?glitchtip_key= query param alongside Sentry's ?sentry_key= (the app targets Sentry/GlitchTip compat). The existing test now passes against a real implementation. - settings_controller_test: replace the scaffold stub (wrong *_url helpers) with real tests — index renders; update persists + redirects; invalid ntfy_url is rejected. Exercises the alerting settings added in #14. - oidc_logout_controller_test: replace the scaffold stub with a real test of the backchannel-logout endpoint rejecting a tokenless request. Suite is now 149 runs, 0 failures, 0 errors. Also remove SQLITE_MIGRATION_REVIEW.md — every item (#1#18) plus the duckdb-gem cleanup is done and committed, so the action list has served its purpose. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cbe88f4 commit 36b0d24

4 files changed

Lines changed: 28 additions & 207 deletions

File tree

SQLITE_MIGRATION_REVIEW.md

Lines changed: 0 additions & 198 deletions
This file was deleted.

app/services/dsn_authentication_service.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ def self.authenticate(request, project_id)
4444

4545
# Extract public key from various authentication sources
4646
def self.extract_public_key(request)
47-
# Method 1: Query parameter (highest priority for simplicity)
47+
# Method 1: Query parameter (highest priority for simplicity).
48+
# GlitchTip SDKs send ?glitchtip_key=; Sentry SDKs send ?sentry_key=.
4849
if request.GET.key?('sentry_key')
4950
return request.GET['sentry_key']
51+
elsif request.GET.key?('glitchtip_key')
52+
return request.GET['glitchtip_key']
5053
end
5154

5255
# Method 2: X-Sentry-Auth header
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
require "test_helper"
22

33
class OidcLogoutControllerTest < ActionDispatch::IntegrationTest
4-
test "should get logout" do
5-
get oidc_logout_logout_url
6-
assert_response :success
4+
# OIDC backchannel logout (POST /oidc/logout -> OidcAuth#backchannel_logout).
5+
# A real logout flow needs a signed logout_token from the provider; here we
6+
# assert the endpoint exists and rejects a request with no token.
7+
8+
test "rejects backchannel logout without a logout_token" do
9+
post oidc_logout_url
10+
assert_response :bad_request
11+
assert_match(/Missing logout_token/, @response.body)
712
end
813
end
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
require "test_helper"
22

33
class SettingsControllerTest < ActionDispatch::IntegrationTest
4-
test "should get index" do
5-
get settings_index_url
4+
# Auth is a no-op unless OIDC is configured (Authentication#require_authentication),
5+
# so these hit the real controller directly in the test env.
6+
7+
test "index renders" do
8+
get settings_url
69
assert_response :success
710
end
811

9-
test "should get update" do
10-
get settings_update_url
11-
assert_response :success
12+
test "update with valid params redirects and persists" do
13+
put settings_url, params: { setting: { burst_threshold: 2500 } }
14+
assert_redirected_to settings_path
15+
assert_equal "Settings updated successfully.", flash[:notice]
16+
assert_equal 2500, Setting.instance.reload.burst_threshold
17+
end
18+
19+
test "update rejects an invalid ntfy_url" do
20+
put settings_url, params: { setting: { ntfy_url: "not a url" } }
21+
assert_redirected_to settings_path
22+
assert_match(/Error updating settings/, flash[:alert])
1223
end
1324
end

0 commit comments

Comments
 (0)