Skip to content

ref(lint): Address new S035 violations from master - #131503

Closed
leeandher wants to merge 3 commits into
masterfrom
leanderrodrigues/iswf-3679-get-or-none-supabase
Closed

leeandher wants to merge 3 commits into
masterfrom
leanderrodrigues/iswf-3679-get-or-none-supabase

Conversation

@leeandher

@leeandher leeandher commented Nov 17, 2026 •

Copy link
Copy Markdown
Member
AI Commentary

Addresses the S035 violations that landed on master after the earlier get_or_none() and noqa PRs. Without this, these files would fail the new S035 lint rule (#130924) the next time someone edits them.

  • src/sentry/integrations/supabase/client.py: four Integration.objects.filter(id=...).first() calls become .get_or_none(...), keeping the same filters. Each filters on id, the primary key, so at most one row can match. This drops the implicit ORDER BY pk that .first() adds. The same script used for the earlier swaps confirmed all four, and the Supabase tests pass.
  • src/sentry/seer/autofix/pr_iteration/run_markers.py: get_seer_run(), added by feat(seer): Comment on the PR when the PR iteration setting skips feedback #131321, gets # noqa: S035. SeerRun.seer_run_state_id is unique but nullable, the case the noqa PRs leave for a person to check, so it isn't swapped here.

The third new violation, in .agents/skills/verify-sentry/scripts/sentry_dev.py, is handled in #130924, which exempts .agents/ from S035.

Refs ISWF-3679

Replace four Integration.objects.filter(id=...).first() calls with
get_or_none(). Each filters on the primary key, so at most one row matches,
and this drops the implicit ORDER BY pk that .first() adds.

Refs ISWF-3679
@linear-code

linear-code Bot commented Nov 17, 2026

Copy link
Copy Markdown

ISWF-3679

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 17, 2026
leeandher added a commit that referenced this pull request Nov 17, 2026
Master's #131321 replaced the per-file SeerRun lookup helpers in
seer/autofix/pr_iteration (emit.py, missing_permissions.py, out_of_credits.py,
pause.py) with a shared get_seer_run() in run_markers.py. Take master's side
in all five conflicts, which drops the # noqa: S035 comments on the deleted
lines. The PR stays comment-only.

New S035 violations from master are not marked here:
- run_markers.py get_seer_run() and four Supabase Integration lookups are
  handled in #131503.
- .agents/skills/verify-sentry/scripts/sentry_dev.py is exempted in #130924.

Refs ISWF-3679
Address a new S035 violation that landed on master after the noqa PRs:
#131321 added get_seer_run() in seer/autofix/pr_iteration/run_markers.py with
an unordered SeerRun .first(). SeerRun.seer_run_state_id is unique but
nullable, the case the noqa PRs leave for a person to check, so mark it
instead of switching to get_or_none().

Refs ISWF-3679
@leeandher leeandher changed the title ref(integrations): Use get_or_none() for Supabase integration lookups ref(lint): Address new S035 violations from master Nov 17, 2026
@leeandher
leeandher marked this pull request as ready for review November 17, 2026 20:34
@leeandher
leeandher requested review from a team as code owners November 17, 2026 20:34
@leeandher
leeandher requested a review from a team November 17, 2026 20:34
@leeandher

Copy link
Copy Markdown
Member Author

AI Commentary

Closing in favor of the head of the S035 stack, #130924. Both commits from this PR are now part of it in a65a9f0: the four Supabase get_or_none() swaps and the # noqa: S035 on get_seer_run().

@leeandher leeandher closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants