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

Add handling for opening existing pull requests and merge request from notifications #2954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jonatha1983
Copy link
Contributor

Introduce actions for opening existing pull/merge requests directly in the respective tool windows. This improves usability by allowing users to interact with existing requests if detected, avoiding duplicate creation workflows.
This pull request introduces several new features and improvements to the GitHub and GitLab plugins, focusing on enhanced notification actions for pull and merge requests. The key changes include adding actions for opening existing pull requests and merge requests, as well as improving code readability and maintainability.

GitHub Plugin Changes:

  • Notification Actions:

    • Added GHOpenPullRequestExistingTabNotificationAction to open existing pull requests in a new tab if one exists. [1] [2]
    • Modified GHPushNotificationCustomizer to check for existing pull requests and provide appropriate actions based on the number of existing pull requests.
  • Code Improvements:

    • Improved readability of the canCreateReview and findExistingPullRequests methods by adding comments and restructuring the code.

GitLab Plugin Changes:

  • Notification Actions:

    • Added GitLabOpenMergeRequestExistingTabNotificationAction to open existing merge requests in a new tab if one exists.
    • Modified GitLabPushNotificationCustomizer to check for existing merge requests and provide appropriate actions based on the number of existing merge requests.
  • Code Improvements:

    • Improved readability of the canCreateReview and findExistingMergeRequests methods by adding comments and restructuring the code.

Additional Changes:

  • Properties Files:
    • Added new message keys for opening pull requests and merge requests in the GithubBundle.properties and GitLabBundle.properties files. [1] [2]

These changes enhance the user experience by providing more intuitive actions for handling existing pull and merge requests, while also improving the maintainability of the codebase.

Introduce actions for opening existing pull/merge requests directly in the respective tool windows. This improves usability by allowing users to interact with existing requests if detected, avoiding duplicate creation workflows.
@Jonatha1983
Copy link
Contributor Author

@clemairej sorry about the deletion - this PR contains both GitHub and GitLab.

Sorry also about the indentation - if you can do your magic and use the default IJ indentation would be great.

Lastly, someone should test this - by pushing a commit to an existing PR/MR and seeing that a notification with a link to open the PR/MR tab is showing up.

@iasemenov FYI

@Jonatha1983
Copy link
Contributor Author

Same as #2949

@clemairej clemairej self-requested a review February 21, 2025 12:50
@clemairej
Copy link
Collaborator

I'll just ignore changes made to GitHub in that case, not a big deal in this case.

@clemairej
Copy link
Collaborator

clemairej commented Feb 21, 2025

Lastly, someone should test this - by pushing a commit to an existing PR/MR and seeing that a notification with a link to open the PR/MR tab is showing up.

No worries about that. I've created tickets to track the feature so that our QA knows of it.
And I do a quick check myself

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.

2 participants