Commitf5703d390replaced the fmt.Sprintf URL construction with url.JoinPath, which calls path.Join and therefore strips a trailing slash unless the final element carries one. Sentry's API only routes slashed paths and answers 404 without redirecting, so every ListAccounts call failed on its first request and no access-review campaign targeting Sentry could fetch a single account. The failure was invisible for two reasons. queryMembers maps 404 to errSentryOrgNotAccessible, so a routing bug surfaced to users as "reconnect the connector with the correct organization" -- advice that could never help, because the slug was never wrong. And commit74ce2bc5dedited the recorded request URL in testdata/sentry.yaml to match the new construction instead of re-recording the cassette, which kept CI green; that cassette still carries Sentry's own Link header with the trailing slash, contradicting its own request line. Pass the slash on the final JoinPath element in both the members endpoint and the organization name resolver, revert the cassette to the URL Sentry actually served, and add a regression test that drives the driver against a server which 404s unslashed paths, so the URL shape is pinned independently of the cassette matcher. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
5.0 KiB
5.0 KiB