Skip to content

Conversation

@aantn
Copy link
Contributor

@aantn aantn commented Jul 13, 2025

Fixes #373 and #408

@aantn aantn requested a review from arikalon1 July 13, 2025 14:14
@coderabbitai
Copy link

coderabbitai bot commented Jul 13, 2025

"""

Walkthrough

The changes update the Python version constraint in the project configuration, modify Slack file upload logic to use files_upload_v2 and a separate message post instead of the deprecated files_upload with channel parameter, and enhance the CLI help text for the Slack output option to specify required OAuth scopes and bot channel membership. No public API signatures were changed.

Changes

File(s) Change Summary
pyproject.toml Increased upper bound of supported Python version from <=3.12.3 to <=3.12.9.
robusta_krr/core/runner.py Replaced Slack file upload call from files_upload with channel parameter to files_upload_v2 plus separate chat_postMessage for posting file link.
robusta_krr/main.py Expanded CLI help text for --slackoutput option to specify required Slack bot OAuth scopes and channel membership.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Runner
    participant SlackAPI

    User->>CLI: Run with --slackoutput <channel>
    CLI->>Runner: Process results
    Runner->>SlackAPI: Upload file via files_upload_v2 (no channel)
    SlackAPI-->>Runner: Return file permalink
    Runner->>SlackAPI: Post message with file permalink to channel via chat_postMessage
    SlackAPI-->>Runner: Confirm message posted
Loading

Assessment against linked issues

Objective Addressed Explanation
Replace deprecated Slack files.upload API with recommended methods (files.getUploadURLExternal, files.completeUploadExternal) (#373) The code replaces files_upload with files_upload_v2 and separate chat_postMessage, but does not implement files.getUploadURLExternal or files.completeUploadExternal.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Python version constraint update (pyproject.toml) Not related to Slack API deprecation or file upload changes requested in the linked issue (#373).
CLI help text expansion for Slack output option (robusta_krr/main.py) Enhances documentation but does not address Slack API deprecation or file upload API changes (#373).
"""

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e27411 and 1304d36.

📒 Files selected for processing (2)
  • robusta_krr/core/runner.py (1 hunks)
  • robusta_krr/main.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • robusta_krr/main.py
  • robusta_krr/core/runner.py
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
robusta_krr/core/runner.py (1)

14-14: Remove unused import.

The SlackApiError import is not used in the current implementation. Consider removing it or adding proper error handling for Slack API calls.

-from slack_sdk.errors import SlackApiError
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79680ee and b490075.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • pyproject.toml (1 hunks)
  • robusta_krr/core/runner.py (2 hunks)
  • robusta_krr/main.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.11.9)
robusta_krr/core/runner.py

14-14: slack_sdk.errors.SlackApiError imported but unused

Remove unused import: slack_sdk.errors.SlackApiError

(F401)

🪛 Flake8 (7.2.0)
robusta_krr/core/runner.py

[error] 14-14: 'slack_sdk.errors.SlackApiError' imported but unused

(F401)

🔇 Additional comments (4)
pyproject.toml (1)

26-26: LGTM: Python version constraint update is appropriate.

Extending the upper bound to <=3.12.9 allows compatibility with newer patch versions that include bug fixes and security updates without breaking changes.

robusta_krr/main.py (1)

266-266: Excellent documentation improvement for Slack integration.

The expanded help text clearly specifies the required OAuth scopes and setup requirements, which will help users properly configure their Slack bot integration. This aligns well with the API changes in the runner module.

robusta_krr/core/runner.py (2)

139-149: LGTM: Proper migration to Slack files_upload_v2 API.

The transition from the deprecated files_upload to files_upload_v2 API is correctly implemented. The new API requires channel IDs instead of names, which is properly handled by the new helper method.


151-182: Well-implemented channel ID resolution method.

The _resolve_slack_channel_id method properly handles:

  • Channel ID detection (starts with 'C')
  • Channel name normalization (removes '#' prefix)
  • Pagination through Slack conversations API
  • Comprehensive error messaging with troubleshooting guidance

The implementation is robust and follows Slack API best practices.

Copy link
Contributor

@arikalon1 arikalon1 left a comment

Choose a reason for hiding this comment

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

nice work

@arikalon1 arikalon1 merged commit 0c7119c into main Jul 13, 2025
3 checks passed
@arikalon1 arikalon1 deleted the small-fixes branch July 13, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack files.upload API is deprecated

3 participants