extract_issue_ref_from_message misparses /issues/ URLs — drops instance #177
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
extract_issue_ref_from_message()inkugetsu-session.shincorrectly parses full URLs containing/issues/. The instance prefix is dropped and/issues/becomes the repo field.Affected Code
File:
kugetsu-session.sh,extract_issue_ref_from_message()(lines 159-167)The sed pipeline drops the instance when cutting from field 2:
For URL
https://git.fbrns.co/shoko/kugetsu/issues/158:After sed:
git.fbrns.co/shoko/kugetsu/issues/158After cut -f2-:
shoko/kugetsu/issues/158(4 fields — instance dropped)Then:
shoko(should begit.fbrns.co)kugetsu(should beshoko)issues(should bekugetsu)158(correct)Result:
shoko/kugetsu/issues#158— invalid format, 4 segments before #.Expected
Input:
https://git.fbrns.co/shoko/kugetsu/issues/158Output:
git.fbrns.co/shoko/kugetsu#158Fix
Count from the end since URL structure after instance is always owner/repo/issues/NUMBER:
Reproduction
Impact
Every delegated task fails immediately. Malformed issue_ref reaches cmd_start where validate_issue_ref rejects it (expects 3 segments, gets 4) and task is marked error. This is the only remaining blocker for queue-based delegation working.