Repository navigation
Add ability to comment on a build - #7147
Conversation
There was a problem hiding this comment.
Great first pass at what I think will be a really useful feature! Just glanced at the code briefly, but left a comment on the database schema and have some thoughts on the UI design:
I like the idea of some sort of indication of which builds have a comment in the build list (currently a small triangle as you currently have) 👍 . Maybe we could even make it so that hovering over the build in the list displays the comment as a tooltip for even faster access? Not sure if that's necessarily a good idea, but just spit-balling.
I think it'd be best if the design for build comments was more similar to the design (but not necessarily the exact styles) for pinned resource comments. Here's a short video of what that looks like in case you aren't familiar:
Screen.Recording.2021-06-10.at.1.47.14.PM.mov
We could apply a similar idea to what you have now - having a "comment" button in the header. For icons, we usually pull from https://materialdesignicons.com. Maybe the ones called comment (or comment-*) would be most intuitive.
The way I'm picturing this button working is similar to how it works currently, with some small differences. It'd act more like a toggle button to view/hide comments, and could behave something like the following:
- If the build does not currently have a comment...
- On page load, the button appears as dim
- On hover, the button appears as bright with the tooltip "add a comment"
- On click, the button becomes bright, the comment section becomes visible, and you're directly editing the comment
- For now, maybe the comment is pre-populated with the timestamp and author as text (though we may want to store this in a more structured way in the future)
- If the build already has a comment...
- On page load, the button appears as bright. The comment section is visible
- On hover, the button appears as dim with the tooltip "hide comment"
- On click, the button becomes dim (perhaps with some additional indication that there is a comment, like a notification badge or something), and the comment section is hidden
The comment block could function in a similar way to the resource pin. When you aren't editing the comment, but the comment is visible, we display a pencil icon in the top-right corner. When we click that button, we are able to edit the text, and the pencil icon is replaced with a "save" button.
Curious to hear what you think about this! Feel free to push back on any of the ideas posed here that you don't agree with
aoldershaw
left a comment
There was a problem hiding this comment.
Have a few suggestions, but looking great so far! Really like the new CommentBar module.
Thoughts on adding tooltips to the build tabs as well for a preview of the comment? Could be useful for scanning the history, e.g. so you can skip over short comments like "flake" If you're looking for something in particular. Doesn't need to be anything fancy, and we can just cut the comment off:
Also, I noticed that when you're not authorized to see the build plan, you're still able to see the comment. I wonder if that's desirable, or if we should hide the comment from the API response if they aren't authorized.
84ba661 to
3c6bba4
Compare
👍 I've added tooltips which show the first 50 characters of the first line, and append
I've updated header to not show the build comment when the user isn't authorized, but it will still return the comment in the API response. Is this okay? |
|
Something for a future PR, but it would be neat if we could show the first line / 50-characters of the comment for the latest build of a job on the pipeline screen. I had a quick poke around the code but I'm not familiar with SVGs or D3 so I'll need to spend some time to understand it first. |
aoldershaw
left a comment
There was a problem hiding this comment.
Looking great! Think we're pretty close. Just a few things, particularly around not being authorized to view build comments. I feel like we should handle this at the API level, since if build comments are public, that may limit what you can write
|
Added one last little bit of functionality in the latest commit, d662199, showing a small triangle in the upper-right corner of a job when there is a comment on the latest build of that job. Unsure if I think it's a good idea or not, what do you think? |
aoldershaw
left a comment
There was a problem hiding this comment.
Nearly there! I like what you did with present.Build. Just have one more concern about fetching comments being an N+1 query. Then, think it's just tests and fixing up merge conflicts
2a3556f to
b2aaa23
Compare
Sometimes it is nice to leave a comment for future you, explaining why something worked or, more likely, didn't. This change allows you to do just that, by providing an editable comment field on builds for a job. concourse#476 Signed-off-by: David Symons <[email protected]>
…mment Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Updates the design of the build comment to be more functionally similar to the "pin resource" comment. This commit includes a generic "Comment Bar" view which replicates the existing pin resource comment functionality and can, hopefully, in the future replace it. Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]> Co-authored-by: Aidan Oldershaw <[email protected]>
Signed-off-by: David Symons <[email protected]>
Signed-off-by: David Symons <[email protected]>
b3e292d to
8d63d78
Compare
Signed-off-by: David Symons <[email protected]>
aoldershaw
left a comment
There was a problem hiding this comment.
Almost there! Appreciate your patience and your hard work! Just a few comments and some tests for the API would be nice
| } | ||
|
|
||
|
|
||
| button_tooltip : String -> Tooltip.Tooltip |
There was a problem hiding this comment.
Not a huge deal, but snake_case feels a bit out of place in Elm (or at least in Concourse's Elm codebase)
| "github.com/concourse/concourse/atc/db" | ||
| ) | ||
|
|
||
| func (s *Server) SetBuildComment(build db.Build) http.Handler { |
There was a problem hiding this comment.
Could we add a few small tests for this?
Signed-off-by: David Symons <[email protected]>
aoldershaw
left a comment
There was a problem hiding this comment.
Thanks for all your hard work on another awesome feature!
|
No worries, thanks for the help getting it ready, tested, and merged in 🥳 Thinking I might keep trawling through the old issues to see what to work on next. |



Changes proposed by this PR
closes #476
This PR adds an editable comment field to builds of a job. A new "info" button is added to the header bar for a build and upon clicking it a text box will be show allowing for the build comment to be edited and saved.
Along with the UI work, there is a new API endpoint,
/api/v1/builds/:build_id/comment, for updating the comment. This was written using the pin-comment endpoint for a resource as a guide.I wasn't sure if there were any guidelines around sourcing icons, but found these two icons which are both licensed under Apache 2.0, the same as Concourse.
https://iconify.design/icon-sets/uil/info-circle.html
https://iconify.design/icon-sets/ic/round-save.html
I have no eye for design, so feedback is more than welcome. Some design decisions:
Still to do...
build_commentstableRelease Note
You can now leave comments on builds. For instance, this can be used to give context to your coworkers about why a particular build failed:

If a build has a comment, it is displayed with a small marker to help you quickly find builds of interest. Hovering over the build displays a portion of the comment:
