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

TODOs with same text are confused #216

Closed
naps62 opened this issue Oct 14, 2024 · 4 comments
Closed

TODOs with same text are confused #216

naps62 opened this issue Oct 14, 2024 · 4 comments

Comments

@naps62
Copy link
Contributor

naps62 commented Oct 14, 2024

I merged a pull request where two different TODOs had the exact same text (similar to what I reported in #215 )

it seems the action got confused, and committed both issue URLs to the same place, instead of one for each

@alstr
Copy link
Owner

alstr commented Oct 14, 2024

Can you share your workflow settings and a code example?

@rgalonso
Copy link
Contributor

I think I've uncovered this issue too. In my case, it was the same text in the same file. Is that the case for you too, @naps62? If so, I've resolved it and, once I clean it up, I'll be submitting a PR to address it.

@alstr
Copy link
Owner

alstr commented Nov 4, 2024

I think in the early days, when the action was simpler, there was an assumption that two TODOs in the same file with the same name was unlikely. So I can see how it would potentially not recognise both correctly, and if there was a way to improve things that would be good.

rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 12, 2024
…ng of TODOs

Some parts of the code were using case-insensitive
matches when searching for an identifier (i.e.
TODO and todo would both be acceptable) whereas
other parts of the code would search for a strict
case-sensitive match (only TODO, not todo). This
inconsistency led to many issues, among them
- alstr#216
- alstr#224
- alstr#225

Further, the identifier match wasn't being done
using word breaks, meaning an identifier of "FIX"
would match (case-insensitively) with "suffix" or
"prefix" if those words happened to appear in a
comment. (See alstr#234).

Issue alstr#230 was also preventing issue labels from
being applied properly if the identifier case
did not match exactly the canonical version. i.e.
"todo" would generate an issue, but the associated
labels wouldn't be applied because the exact
identifier used wasn't "TODO".

This commit resolves all of these issues.
rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 12, 2024
rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 12, 2024
…ng of TODOs

Some parts of the code were using case-insensitive
matches when searching for an identifier (i.e.
TODO and todo would both be acceptable) whereas
other parts of the code would search for a strict
case-sensitive match (only TODO, not todo). This
inconsistency led to many issues, among them
- alstr#216
- alstr#224
- alstr#225

Further, the identifier match wasn't being done
using word breaks, meaning an identifier of "FIX"
would match (case-insensitively) with "suffix" or
"prefix" if those words happened to appear in a
comment. (See alstr#234).

Issue alstr#230 was also preventing issue labels from
being applied properly if the identifier case
did not match exactly the canonical version. i.e.
"todo" would generate an issue, but the associated
labels wouldn't be applied because the exact
identifier used wasn't "TODO".

This commit resolves all of these issues.
rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 12, 2024
@rgalonso
Copy link
Contributor

This can be closed thanks to #228 and #237

@alstr alstr closed this as completed Nov 12, 2024
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

No branches or pull requests

3 participants