dashboard: support LKML patches in `#syz test`
(*) Related discussion: https://lore.kernel.org/all/[email protected]/T/#e9b2fc3253f78c190257c377e72e910e62d2e42dc
At the moment, #syz test can be run either without any patch, or with a patch pasted right after the command, or with the patch sent as an email attachment. It could be convenient to be able to also ask syzbot to test an LKML-sent patch.
We need to figure out the right query syntax. Even when we're given an LKML link to the patch, we also need to be able to figure out the tree on which to apply the patch before testing.
Some of the options.
- Apply such patches only on top of the branch where we found the bug. In this case, the command can be simple
#syz test: https://lore.kernel.org/all/[email protected]/- As proposed in (*),
#syz test patch: [email protected]
- Still support repo/branch arguments. If no patch is attached and a lore link follows a
#syz test, take it.
Though it becomes already quite complicated :(#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master https://lore.kernel.org/all/[email protected]/
The task to solve the branch is easy. Git already has --base parameter. So, just parse an email for it. Then you have the following possibilities:
- The base is found in your cache of known trees / branches (note that git.kernel.org tracks global SHA IDs, means that doesn't matter if you look for something in the repo that doesn't has it, you can always check if it's present somewhere there, but this might get fixed in the future, that said your local cache may be organized same or similar way).
- The base is not provided, use the branch where the problem was found.
- The base wasn't found, we can't do much, but try it as it was the case 2 above and test in case it can be cleanly applied.
In all cases the format for syzbot stays the same.
One more thing is to make possible to mark dup with patch present:
#syz dup [patch available: $MESSAGE_ID] blablabla
square brackets for the solely purpose to filter them out for the existing logic.