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

bug: Jira Branch Names Not Being Picked Up #50

Open
therynamo opened this issue Dec 13, 2019 · 13 comments
Open

bug: Jira Branch Names Not Being Picked Up #50

therynamo opened this issue Dec 13, 2019 · 13 comments
Assignees
Labels
🐛 fix Something isn't working

Comments

@therynamo
Copy link
Contributor

therynamo commented Dec 13, 2019

There is an issue where, even if you use the correct branch name, CL does not pick up the changes for the changelog.

Notes: It is probably the regex that is the issue.

@therynamo therynamo added the 🐛 fix Something isn't working label Dec 13, 2019
@therynamo therynamo self-assigned this Dec 13, 2019
@benzvan
Copy link
Contributor

benzvan commented Dec 13, 2019

I'll take a quick look. I think this is the regex you're referring to:

const branchRegex = /([[A-Z][A-Z0-9]*-[1-9][0-9]*)\]?/;

@therynamo
Copy link
Contributor Author

That would be the one!

@therynamo therynamo moved this from To Do to In Progress in Captain's Log Workstream Dec 13, 2019
@benzvan
Copy link
Contributor

benzvan commented Dec 13, 2019

\]? is definitely unnecessary but shouldn't harm anything. The regex should match correctly at least for all our example.

@therynamo
Copy link
Contributor Author

Bummer. Well, that isn't what I wanted to hear 😄. If that is the case then we'll have to dive a little deeper. I can debug it some time later today to verify what is going on here. I'll connect with you for some test data, offline.

Thanks for verifying that @benzvan!

@benzvan
Copy link
Contributor

benzvan commented Dec 13, 2019

Here's a really small PR to add tests #51

@benzvan
Copy link
Contributor

benzvan commented Dec 13, 2019

I think jiraFinder just isn't being called anywhere.

@benzvan
Copy link
Contributor

benzvan commented Dec 13, 2019

I see where it's used now, I think. I don't understand this code well enough to figure out the problem.

@therynamo
Copy link
Contributor Author

therynamo commented Dec 13, 2019

It can get a bit convoluted at times, that is for sure. I'm sure a refactor is on our roadmap some time in the future 😄.

I have a feeling it has to do with the commits being exposed to the ticket finders. I recently changed how the commit searches work because we were hitting rate limits. If you don't squash and merge it may be incorrectly grabbing the commits associated with your release. It is a weird scenario, and I'm hoping that is not the issue, but that is my theory right now.

Edit code that changed: https://github.com/target/captains-log/pull/45/files#diff-bb4627ea32ef9426b04989a45066c1b8R85-R93

@benzvan
Copy link
Contributor

benzvan commented Feb 13, 2020

It worked once!

@therynamo
Copy link
Contributor Author

Awesome! Glad to hear it! Can you check and see what the branch name was?

@benzvan
Copy link
Contributor

benzvan commented Feb 18, 2020

prod-loglevel/RP-2636

@benzvan
Copy link
Contributor

benzvan commented Mar 2, 2020

Taking another look at this because I had time. I notice the regex in the code is also looking for square bracket characters in an odd way. Maybe /([A-Z][A-Z0-9]*-[1-9][0-9]*)/ would be better?

@therynamo
Copy link
Contributor Author

You're right! I think that may be a typo!

@therynamo therynamo moved this from In Progress to Closed in Captain's Log Workstream Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 fix Something isn't working
Projects
Development

No branches or pull requests

2 participants