Repository navigation
feat(pull-requests): open GitLab merge requests in an MR !N tab - #1707
Merged
Merged
Conversation
- Parse GitLab merge request URLs into the pull request Identity, with nested group paths. - Title the side panel tab MR !N, as the original's mergeRequestTab.title. - Read the account and merge request detail through glab api into the Summary shape. - Return the branch's open merge request from the thread PR summary, so View PR opens it. - Hide the draft and reopen action for GitLab; the original's connector has no such call. Refs #1704 Refs #840
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1704
Refs #840
Summary
View PRon a GitLab merge request now opens the Code Review side panel tab, titledMR !Nlike the original'smergeRequestTab.title, with the merge request Summary.What changed and why
Identity::from_urlparseshttps://{host}/{group path}/{project}/-/merge_requests/{n}(nested groups) and sets agitlabflag;url()and the newlabel()follow it.Identity::label():MR !Nfor GitLab,PR #Nas before.glab-current-userreads the account withglab api user;gh-pr-detailreads a GitLab merge request withglab api projects/:path/merge_requests/:iidand maps it to the Summary fields (branch, reviewers, note count, pipeline, status, description).glab mr listlookup), soView PRis enabled on a GitLab branch.Out of scope: the other #840 gaps, and the Code tab diff for GitLab.
Test evidence
cargo clippy -p ui -p app --all-targets -- -D warnings: clean.cargo fmt --all --check: clean.cargo test -p ui --lib pull_requests(19 passed),cargo test -p app --lib -- host::github_pull_requests host::git_pr pull_requests(17 passed),cargo test -p app --test pull_request_tab --test pull_requests(3 + 8 passed).nice -n 19):cargo test --locked -p app --test pull_request_tabpassed 3/3; the front app stayed WezTerm in every sample.pull_request_urls_parse_and_other_urls_do_not,merge_request_maps_to_the_summary_fields,view_pr_opens_a_gitlab_merge_request_tab.glabon a signed-in GitLab host: not run (no GitLab account on the test hosts); the test host answers the two GitLab reads.Before (main):
View PRon a merge request URL sends it to the browser; the thread shows no tab.After: the
MR !7tab with the merge request Summary.No original GitLab capture exists, so there is no original-vs-ours slider.
Checklist
cargo fmt --checkis clean.cargo clippy --workspace --all-targets -- -D warningsis clean. (ran foruiandapp, the changed crates)cargo test --workspacepasses. (ran the affected tests of the changed crates, listed above)cargo run -p parity -- --gateon macOS. (new tab state; no original GitLab capture to compare)## [Unreleased]inCHANGELOG.md. (this task must not edit CHANGELOG.md)