-
Notifications
You must be signed in to change notification settings - Fork 81
gitlab mr 状态可配置 #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
gitlab mr 状态可配置 #52
Conversation
WalkthroughA new configuration constant, Changes
Sequence Diagram(s)sequenceDiagram
participant GitLab
participant Fetcher as gitlab_fetcher.py
participant Config as config.py
GitLab->>Fetcher: Send merge request payload
Fetcher->>Config: Access GITLAB_MERGE_REQUEST_STATUS
Fetcher->>Fetcher: Check payload's state/merge_status against config list
alt Match found
Fetcher->>GitLab: Return True (opened)
else No match
Fetcher->>GitLab: Return False (not opened)
end
Possibly related PRs
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (2)
config/config.py (1)
88-93
: Consider clarifying the commented-out merge status entry.The Chinese comment questioning whether review is needed after merge suggests uncertainty about the business logic. Consider either:
- Removing the commented code if post-merge review isn't required
- Adding clear documentation about when this configuration should be enabled
- # 这个好像是合并后触发的状态,合并后还需要review吗? - # { - # "state": "merged", - # "merge_status": "can_be_merged" - # } + # Uncomment the following entry if post-merge review is required + # { + # "state": "merged", + # "merge_status": "can_be_merged" + # }gitlab_integration/gitlab_fetcher.py (1)
12-12
: Remove redundant import.This explicit import is unnecessary since line 9 already imports all symbols from
config.config
usingfrom config.config import *
.-from config.config import GITLAB_MERGE_REQUEST_STATUS
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
config/config.py
(1 hunks)doc/config.md
(1 hunks)gitlab_integration/gitlab_fetcher.py
(2 hunks)
🔇 Additional comments (4)
config/config.py (1)
76-93
: Well-structured configuration for GitLab version compatibility.The new
GITLAB_MERGE_REQUEST_STATUS
constant provides a clean, extensible way to handle different GitLab version requirements. The structure with dictionaries containingstate
andmerge_status
pairs is intuitive and maintainable.doc/config.md (2)
81-81
: Good documentation addition with helpful reference.The documentation clearly describes the new configuration parameter and provides a link to the relevant GitHub issue for additional context about GitLab version differences.
85-85
: Minor formatting improvement.Adding the newline improves consistency in the documentation format.
gitlab_integration/gitlab_fetcher.py (1)
213-222
: Excellent refactoring to use configuration-driven approach.The function now dynamically checks merge request status against the configurable
GITLAB_MERGE_REQUEST_STATUS
list, making it much more maintainable and adaptable to different GitLab versions. The logic is clear and the exception handling is preserved appropriately.
满足不同gitlab版本state,merge_status
Summary by CodeRabbit
New Features
Documentation