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

Improves overview branch autolinks #3957

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

Conversation

nzaytsev
Copy link
Contributor

@nzaytsev nzaytsev commented Jan 20, 2025

Description

Screen.Recording.2025-01-20.at.16.04.40.mov
  • skip redirected PR autolinks if the refset is non-prefixed
  • filter autolinks by type=issue before render in the issues section
  • add unlink feature

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

- skip redirected PR autolinks if the refset is non-prefixed
- filter autolinks by type=issue before render in the issues section
- add unlink feature
@nzaytsev nzaytsev linked an issue Jan 20, 2025 that may be closed by this pull request
@nzaytsev nzaytsev requested review from eamodio, d13 and axosoft-ramint and removed request for eamodio and d13 January 20, 2025 09:06
Comment on lines +238 to +244
// we consider that all non-prefixed links are came from branch names and linked to issues
// skip if it's a PR link
if (!link.prefix) {
issueOrPullRequestPromise = issueOrPullRequestPromise?.then(x =>
x?.type === 'pullrequest' ? undefined : x,
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain what "non-prefixed" means a bit so I can understand?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

non-prefixed refset is required to parse branch name autolinks and mean that we're trying to search issue keys in any numbers with no prefixes. For example, we can search issues with prefixes # or gh for github in commit messages, but for the branch names the issue keys can be non-prefixed - just numbers. like in current branch name
bugs/3956-pr-autolinks-are-rendered-in-issues-section - the issue key is just a number without any prefixes

const item =
skipPrompt ??
(await window.showWarningMessage(
`This action will unlink the issue ${issue.url} from the branch ${reference.name} forever`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of something that cannot be undone like this. I think we need a broader discussion on how we want to handle issue association and dissociation and how autolinks fit into that mix, in a way that prevents anyone from getting stuck into a state they cannot easily back out from.

@@ -67,6 +67,14 @@ export interface GetOverviewRequest {
[key: string]: unknown;
}

export interface OverviewBranchIssue {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is an "overview branch"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's an item on the overview section. I have no idea how to call this omitted issue interface

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.

PR autolinks are rendered in issues section
2 participants