Skip to content

Fix the wrong column data size for bot_token in the built-in SQLAlchemy data model#1077

Merged
seratch merged 1 commit intoslackapi:mainfrom
geeorgey:main
Jul 29, 2021
Merged

Fix the wrong column data size for bot_token in the built-in SQLAlchemy data model#1077
seratch merged 1 commit intoslackapi:mainfrom
geeorgey:main

Conversation

@geeorgey
Copy link
Copy Markdown
Contributor

Change the character length of the slack_bots.bot_token column 32 to 200

Summary

The bot_token column should be set to 200 characters, but it was set to 32 characters.

Category (place an x in each of the [ ])

  • 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)
  • [x ] 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-src (Documents, have you run ./docs.sh?)
  • /docs-src-v2 (Documents, have you run ./docs-v2.sh?)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements (place an x in each [ ])

  • 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've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

Change the character length of the slack_bots.bot_token column 32 to 200
@gitwave gitwave bot added the untriaged label Jul 29, 2021
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 29, 2021

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 29, 2021

Codecov Report

Merging #1077 (b29c7e3) into main (553e3c1) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1077   +/-   ##
=======================================
  Coverage   84.15%   84.15%           
=======================================
  Files          99       99           
  Lines        9255     9255           
=======================================
  Hits         7789     7789           
  Misses       1466     1466           
Impacted Files Coverage Δ
...dk/oauth/installation_store/sqlalchemy/__init__.py 98.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 553e3c1...b29c7e3. Read the comment docs.

@seratch
Copy link
Copy Markdown
Contributor

seratch commented Jul 29, 2021

Hi @geeorgey, thanks for taking the time to make this pull request!

For context, refer to the convo in a commit: d361500#commitcomment-54122274

The pull request #1040 set the wrong column data size for the column bot_token in the bots table. The lack of enough data size causes a runtime error when inserting data. This issue has been affecting newly created tables using the data models since v3.8.0

After merging this PR, I will improve the corresponding unit tests to use more realistic data to detect similar regressions in the future. https://github.com/slackapi/python-slack-sdk/blob/553e3c1855586295096deb76c68aaf7d3c53ae86/tests/slack_sdk/oauth/installation_store/test_sqlalchemy.py

@seratch
Copy link
Copy Markdown
Contributor

seratch commented Jul 29, 2021

@geeorgey It seems that this is your first contribution to this project. Would you mind signing our CLA? https://cla-assistant.io/slackapi/python-slack-sdk?pullRequest=1077 Without having it, we are unable to have your contributions.

@geeorgey
Copy link
Copy Markdown
Contributor Author

I signed the CLA.

@seratch seratch changed the title Change the character length Fix the wrong column data size for bot_token in the built-in SQLAlchemy data model Jul 29, 2021
@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented oauth Version: 3x and removed untriaged labels Jul 29, 2021
@seratch seratch added this to the 3.9.0 milestone Jul 29, 2021
Copy link
Copy Markdown
Contributor

@seratch seratch left a comment

Choose a reason for hiding this comment

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

LGTM

@seratch seratch merged commit e69eace into slackapi:main Jul 29, 2021
@seratch
Copy link
Copy Markdown
Contributor

seratch commented Jul 29, 2021

After merging this PR, I will improve the corresponding unit tests to use more realistic data to detect similar regressions in the future. https://github.com/slackapi/python-slack-sdk/blob/553e3c1855586295096deb76c68aaf7d3c53ae86/tests/slack_sdk/oauth/installation_store/test_sqlalchemy.py

I found that SQLite accepts insertion even when a column data exceeds the column's maximum length. To detect this issue, we need to use other RDB in testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented oauth Version: 3x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants