As a sub-requirement of the following:
https://www.gerritcodereview.com/design-docs/change-log-threaded-feedback.html
adding comments that are not attached to a file are needed for creating
threaded change messages.
Also, adding robot comments that are not a part of a file is needed
as part of an effort to improve robot comments. More specifically,
some robots might want to complain about a missing file and hence
can't attach such a robot comment to an existing file.
When adding a new comment in PostReview, the backend determines
whether a comment's file is legal by checking if the file exists,
or if it's a magic file (e.g commit message and merge list).
Same applies for creating and updating draft comments.
This change adds "/PATCHSET_LEVEL" to the list of legal file names.
That way, it will be possible to create patchset-level comments on
the backend by specifying "/PATCHSET_LEVEL" as the name of the file.
After rolling out this change, it will be possible to create
patchset-level comments but it will not be possible to create them
via the UI.
Another modification is a link to file-id (path) from CommentInput and
CommentInfo to better document the possible magic files (such as
/PATCHSET_LEVEL).
Another backend change that's required is to fix email notifications
for patchset-level comments, since currently /PATCHSET_LEVEL file path
is used. Also, the email links to the file /PATCHSET_LEVEL, which is
against the planned user experience.
It's not possible to create those patchset level comments via the UI,
and it's only possible if you're specifically trying to do so by
naming the file name "/PATCHSET_LEVEL".
Also, even if comments were created it would not break the UI, but just
make it look slightly off (e.g, it would have a file called
/PATCHSET_LEVEL).
Therefore, it's not a problem to merge this change now.
Some frontend adjustments are required:
1. Make patchset-level robot comments behave correctly in the UI.
They are currently planned to be visible at the top of the findings
section.
2. Make patchset-level human comments behave correctly in the UI,
and allow creating them via the UI. Implementation TBD.
Change-Id: Ia84feb593c9ff03613752b8db59d8dfd30de638d