Skip to content

Commit 157181a

Browse files
committed
fix(submitter): dry runs no longer require credentials
A dry run is a preview: it still passes rate-limit and dedup checks but must not demand a forge token. Credentials.get has always run before the dry_run branch (this predates the PR), so dry-run submissions failed with {:error, :no_credentials} in any credential-less environment — visible for the first time now that the Test gate actually executes (3 CI failures on a suite that is green locally only because the sandbox has ambient GH_TOKEN). Verified 272/272 both with and without GITHUB_TOKEN/GH_TOKEN in the environment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017LDhR8gtnittEWSafunnrq
1 parent 80b944d commit 157181a

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

elixir-mcp/lib/feedback_a_tron/submitter.ex

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,29 @@ defmodule FeedbackATron.Submitter do
9797
platforms
9898
|> Enum.map(fn platform ->
9999
with :ok <- RateLimiter.check(platform),
100-
:ok <- maybe_dedupe(dedupe, platform, issue),
101-
{:ok, cred} <- Credentials.get(state.credentials, platform) do
100+
:ok <- maybe_dedupe(dedupe, platform, issue) do
101+
# A dry run is a preview: it still passes rate-limit and dedup
102+
# checks above, but must not require credentials.
102103
if dry_run do
103104
{:ok, %{platform: platform, status: :dry_run, would_submit: issue}}
104105
else
105-
result = Retry.with_backoff(fn -> do_submit(platform, issue, cred, opts) end)
106-
107-
# Record only real successes: never dry runs (which
108-
# short-circuit above), never errors. Recording feeds the
109-
# deduplicator so recurring themes are recognized as recurring.
110-
case result do
111-
{:ok, submission_result} ->
112-
RateLimiter.record(platform)
113-
Deduplicator.record(issue, platform, submission_result)
114-
115-
_ ->
116-
:ok
106+
with {:ok, cred} <- Credentials.get(state.credentials, platform) do
107+
result = Retry.with_backoff(fn -> do_submit(platform, issue, cred, opts) end)
108+
109+
# Record only real successes: never dry runs (which
110+
# short-circuit above), never errors. Recording feeds the
111+
# deduplicator so recurring themes are recognized as recurring.
112+
case result do
113+
{:ok, submission_result} ->
114+
RateLimiter.record(platform)
115+
Deduplicator.record(issue, platform, submission_result)
116+
117+
_ ->
118+
:ok
119+
end
120+
121+
result
117122
end
118-
119-
result
120123
end
121124
end
122125
end)

0 commit comments

Comments
 (0)