Skip to content

refactor(oauth): drop the duplicate metadata argument in the sqlalchemy state store - #2087

Merged
WilliamBergamin merged 3 commits into
mainfrom
refactor/sqlalchemy-state-store-metadata
Nov 26, 2026
Merged

WilliamBergamin merged 3 commits into
mainfrom
refactor/sqlalchemy-state-store-metadata

Conversation

@WilliamBergamin

Copy link
Copy Markdown
Contributor

Summary

This pull request drops the duplicate metadata argument in build_oauth_states_table, sync and async.

  • Cause: Table(name, metadata, metadata, Column(...)) passes the same MetaData twice. The second lands in the schema items, where MetaData._set_parent is a no-op (SQLAlchemy 2.0.55, our floor, through 2.1).
  • The table, its DDL, constraints, indexes, and metadata.tables are identical with or without it.
  • The only observable difference: before_parent_attach / after_parent_attach fire once fewer on that MetaData, visible only to a listener on those events.

The classmethod signature is unchanged; the installation store has no duplicate.

Testing

Compare CreateTable(SQLAlchemyOAuthStateStore.build_oauth_states_table(MetaData(), "t")) on main and this branch: the DDL is the same. The existing sync and async state store tests build and use the table.

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I have signed the Salesforce CLA (required before your PR can be reviewed or merged).
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

🤖 Generated with Claude Code

…my state store

build_oauth_states_table passed the same MetaData to Table twice. The
second one lands in the schema items, where MetaData's _set_parent is a
no-op (SQLAlchemy 2.0.55 through 2.1), so the table, its DDL, and
metadata.tables are unchanged without it.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner November 26, 2026 17:25
@WilliamBergamin WilliamBergamin added this to the 3.48.1 milestone Nov 26, 2026
@WilliamBergamin WilliamBergamin added enhancement M-T: A feature request for new functionality semver:patch oauth labels Nov 26, 2026
@WilliamBergamin WilliamBergamin self-assigned this Nov 26, 2026
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.76%. Comparing base (d5492a5) to head (fc97188).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2087   +/-   ##
=======================================
  Coverage   84.76%   84.76%           
=======================================
  Files         118      118           
  Lines       14129    14129           
=======================================
  Hits        11977    11977           
  Misses       2152     2152           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Thanks @WilliamBergamin! Tidy cleanup, and the DDL check in the description made this an easy one to verify.

@WilliamBergamin
WilliamBergamin enabled auto-merge (squash) November 26, 2026 18:18
@WilliamBergamin
WilliamBergamin merged commit 61e25f5 into main Nov 26, 2026
19 checks passed
@WilliamBergamin
WilliamBergamin deleted the refactor/sqlalchemy-state-store-metadata branch November 26, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality oauth semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants