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 branch autolinks experiments #3898

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

Conversation

nzaytsev
Copy link
Contributor

Description

Added chunk matching logic for non-prefixed numbers:

  • XX - is more likely issue number
  • XX.XX - is less likely issue number, but still possible
  • XX.XX.XX - is more likely not issue number

considered the distance from the edges of the chunk as a priority sign

the chunk that is more close to the end is more likely actual issue number

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

@nzaytsev nzaytsev linked an issue Dec 20, 2024 that may be closed by this pull request
@nzaytsev nzaytsev marked this pull request as ready for review December 20, 2024 05:30
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

I don't quite follow the logic of the added code (specifically, the priority calculation) - some comments throughout might help. @eamodio might have more insight into it.

It didn't seem to help with this case I encountered in my repo. Not a blocker for merge but would be nice if it can accommodate cases like this (the first issue is correct, the second is not):

image

Comment on lines +316 to +322
console.log(
JSON.stringify(match.value),
match.value.groups.numberChunk,
match.value.groups.numberChunkBeginning,
match.value.input,
match.value.groups.issueKeyNumber,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

This console log should be removed. Likely left over from when you were testing it locally.

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.

Improve issue matching with branch names
2 participants