Skip to content
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

Set azure devops default status to ByDesign #1228

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

eddielu
Copy link
Contributor

@eddielu eddielu commented Sep 14, 2024

User description

Using a default status of Active = 1 causes issues because a common setup is to enable comment check for Azure PRs. Setting Active=1 means that reviewers need to manually mark each comment as resolved.

Use a better ByDesign status (https://learn.microsoft.com/en-us/javascript/api/azure-devops-extension-api/commentthreadstatus), which better fits what we see in github and gitlab


PR Type

Enhancement


Description

  • Changed the default status of Azure DevOps comment threads from Active (1) to ByDesign (5)
  • This change addresses issues with common PR review setups that use comment checks
  • The new ByDesign status better aligns with GitHub and GitLab behavior
  • Eliminates the need for reviewers to manually mark each comment as resolved

Changes walkthrough 📝

Relevant files
Enhancement
azuredevops_provider.py
Update Azure DevOps comment thread default status               

pr_agent/git_providers/azuredevops_provider.py

  • Changed the default status of CommentThread from 1 (Active) to 5
    (ByDesign)
  • +1/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🏅 Score: 95
    🧪 No relevant tests
    🔒 No security concerns identified
    🔀 No multiple PR themes
    ⚡ No key issues to review

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Use a named constant for the comment thread status value

    Consider using an enumeration or constant for the status value (5) to improve code
    readability and maintainability. This will make the intent clearer and reduce the
    risk of using incorrect status values.

    pr_agent/git_providers/azuredevops_provider.py [383]

    -thread = CommentThread(comments=[comment], thread_context=thread_context, status=5)
    +COMMENT_STATUS_BY_DESIGN = 5
    +thread = CommentThread(comments=[comment], thread_context=thread_context, status=COMMENT_STATUS_BY_DESIGN)
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion improves code readability and maintainability by using a named constant for the status value, making the intent clearer and reducing the risk of errors.

    7

    @mrT23
    Copy link
    Collaborator

    mrT23 commented Sep 14, 2024

    seems reasonable

    @mrT23 mrT23 merged commit 2102c51 into qodo-ai:main Sep 14, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants