• We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Inline commenting and code discussions on changesets, outside of the context of a pull request

          Form Name

            [BSERV-2511] Comments on Commits

            @Kevin - if you're doing this in a Jenkins build environment, then won't you have access to both the new & old commit hashes? Then you could add it as a true comment on the diff between those two commits.

            Ken Williams added a comment - @Kevin - if you're doing this in a Jenkins build environment, then won't you have access to both the new & old commit hashes? Then you could add it as a true comment on the diff between those two commits.

            Well, I think there are things I'd rather see (i.e., reporting of builds of the /pull-requests/id/merge internal ref on the pull request itself).

            But, the reason I tried it was this:

            We are using Jenkins to automatically build and then Jenkins' Stash Notifier plugin to display the build information with each commit. As part of the build process, we publish unit test results and code coverage reports. I tried to use the API to post a comment on the commit with links to the code coverage report and test results. As I mentioned, this is supported by the API, but the comments don't display on the UI.

            Not sure if others have a similar desire to post a comment on the raw commit item itself, but if there are others, consider me a +1 on that.

            Kevin Schumacher added a comment - Well, I think there are things I'd rather see (i.e., reporting of builds of the /pull-requests/id/merge internal ref on the pull request itself). But, the reason I tried it was this: We are using Jenkins to automatically build and then Jenkins' Stash Notifier plugin to display the build information with each commit. As part of the build process, we publish unit test results and code coverage reports. I tried to use the API to post a comment on the commit with links to the code coverage report and test results. As I mentioned, this is supported by the API, but the comments don't display on the UI. Not sure if others have a similar desire to post a comment on the raw commit item itself, but if there are others, consider me a +1 on that.

            Kevin,

            It's a little bit of neither.

            When the server model and its service and REST APIs were added, I intentionally added them in a way that was flexible enough to support this use case. As a result, as you can see, commenting directly on a commit, rather than in a diff between two commits, works. You can even provide a path and comment directly on a specific file at a specific commit. So the functionality isn't a bug.

            That said, we have nothing on our roadmap currently for building the UI changes necessary to render comments on commits that are not part of the diff. So it's not a planned feature either. To get it there, we'd need more customers coming forward requesting the feature and providing use cases. That type of interest is what helps get things on the backlog, and so far we're just not seeing that.

            If a plugin developer was feeling adventurous, though, they could build the UI for it in a plugin and use the server's existing REST and service APIs to back it.

            Best regards,
            Bryan Turner
            Atlassian Stash

            Bryan Turner (Inactive) added a comment - Kevin, It's a little bit of neither. When the server model and its service and REST APIs were added, I intentionally added them in a way that was flexible enough to support this use case. As a result, as you can see, commenting directly on a commit, rather than in a diff between two commits, works. You can even provide a path and comment directly on a specific file at a specific commit. So the functionality isn't a bug. That said, we have nothing on our roadmap currently for building the UI changes necessary to render comments on commits that are not part of the diff. So it's not a planned feature either. To get it there, we'd need more customers coming forward requesting the feature and providing use cases. That type of interest is what helps get things on the backlog, and so far we're just not seeing that. If a plugin developer was feeling adventurous, though, they could build the UI for it in a plugin and use the server's existing REST and service APIs to back it. Best regards, Bryan Turner Atlassian Stash

            Kevin Schumacher added a comment - - edited

            So, through the REST API, you can actually make a comment on the commit itself like so:

            curl -u user:pass -X POST -d { "\"text\"" : "\"some comment on the commit\"" } http://example.com/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments
            

            POSTing a commit this way has it show up in the count of comments, but the UI doesn't actually display the comment anywhere. Is there a planned feature to display comments there, or is it just a bug on the API?

            Kevin Schumacher added a comment - - edited So, through the REST API, you can actually make a comment on the commit itself like so: curl -u user:pass -X POST -d { "\" text\ "" : " \ "some comment on the commit\" " } http: //example.com/ rest /api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments POSTing a commit this way has it show up in the count of comments, but the UI doesn't actually display the comment anywhere. Is there a planned feature to display comments there, or is it just a bug on the API?

            sinetob, at this stage we specifically focussed on general commit comments rather than tying them into review workflow. We will add commit count visibility on the commits tab in the near future, and will consider making further improvements from there.

            Roger Barnes (Inactive) added a comment - sinetob , at this stage we specifically focussed on general commit comments rather than tying them into review workflow. We will add commit count visibility on the commits tab in the near future, and will consider making further improvements from there.

            This feature, as currently implemented in Stash 2.11.2 has one flaw : any comments made in a commit is not shown in the Overview Section of the corresponding pull request. This limits the usefulness of the feature.

            Tahmid Nabi added a comment - This feature, as currently implemented in Stash 2.11.2 has one flaw : any comments made in a commit is not shown in the Overview Section of the corresponding pull request. This limits the usefulness of the feature.

            Awesome! When will this feature be out?

            Prakash Nadar added a comment - Awesome! When will this feature be out?

            Consider being able to comment on any file (modified or unmodified) requested, this feature would be awesome for our team. We've currently got a big backlog of unreviewed, unstandardised code from back when the company was much smaller which we're working to improve. Being able to comment on this old code would be a far better option when planning refactoring than our current "solution" - which is basically making notes with line numbers in Confluence.

            Dan Cowell added a comment - Consider being able to comment on any file (modified or unmodified) requested, this feature would be awesome for our team. We've currently got a big backlog of unreviewed, unstandardised code from back when the company was much smaller which we're working to improve. Being able to comment on this old code would be a far better option when planning refactoring than our current "solution" - which is basically making notes with line numbers in Confluence.

            Thanks for the feedback, Andrew!

            If I'm in a pull request and I click on the commits tab and then down in to a commit itself and add a commit at that level. Is that comment part of the pull request (and shows up in it's default view and is sent out to the reviewers) or is it a completely separate commit area? If it's the later that seems like a potential source of confusion.

            Not in 2.11. Comments on commits are totally independent of pull requests regardless of how you got to the commit. If you want to ensure pull request reviewers are notified of such comments, you will need to mention them in 2.11.

            This is something that will change in subsequent releases. For example, clicking through from a pull request to the commit and adding a comment there may automatically also show the comment on the pull request overview (it is very unlikely the comment will appear in the pull request's diff because line numbers in commit diffs have little to no relationship to line numbers in pull request diffs; they're showing totally different diffs). We're still considering options for how this will work, and open to feedback on what users would like to see.

            Am I limited to only commenting on the differences in a commit or can I commit on any file (e.g. to add a "you forgot to update this part" style commit on an unchanged file, a common use for that would be to remind them to update a factory method or icon).

            In 2.11 you can only comment on the diff--any file that was modified in the commit. However, the storage model supports more uses than just diffs, so it's certainly a feature that could be added in a future release if users request it.

            Hope this helps,
            Bryan Turner
            Atlassian Stash

            Bryan Turner (Inactive) added a comment - Thanks for the feedback, Andrew! If I'm in a pull request and I click on the commits tab and then down in to a commit itself and add a commit at that level. Is that comment part of the pull request (and shows up in it's default view and is sent out to the reviewers) or is it a completely separate commit area? If it's the later that seems like a potential source of confusion. Not in 2.11. Comments on commits are totally independent of pull requests regardless of how you got to the commit. If you want to ensure pull request reviewers are notified of such comments, you will need to mention them in 2.11. This is something that will change in subsequent releases. For example, clicking through from a pull request to the commit and adding a comment there may automatically also show the comment on the pull request overview (it is very unlikely the comment will appear in the pull request's diff because line numbers in commit diffs have little to no relationship to line numbers in pull request diffs; they're showing totally different diffs). We're still considering options for how this will work, and open to feedback on what users would like to see. Am I limited to only commenting on the differences in a commit or can I commit on any file (e.g. to add a "you forgot to update this part" style commit on an unchanged file, a common use for that would be to remind them to update a factory method or icon). In 2.11 you can only comment on the diff--any file that was modified in the commit. However, the storage model supports more uses than just diffs, so it's certainly a feature that could be added in a future release if users request it. Hope this helps, Bryan Turner Atlassian Stash

            andrew.milne1 added a comment -

            This seems like a great start, thanks.

            I'd like to see general commit level comments, I think it would be useful. The main use case I can think of would be to have general discussion on topics like:

            • Coding or documentation standards
            • Repeating issues (i.e. saying "you've miss-spelled 'receive' every time you use it" rather than adding in-line comments to every occurrence)
            • General discussion on the suitability of the change and whether it should even have been committed.

            I've two questions relating to this feature that I'm not currently sure about:

            • If I'm in a pull request and I click on the commits tab and then down in to a commit itself and add a commit at that level. Is that comment part of the pull request (and shows up in it's default view and is sent out to the reviewers) or is it a completely separate commit area? If it's the later that seems like a potential source of confusion.
            • Am I limited to only commenting on the differences in a commit or can I commit on any file (e.g. to add a "you forgot to update this part" style commit on an unchanged file, a common use for that would be to remind them to update a factory method or icon).

            Thanks

            andrew.milne1 added a comment - This seems like a great start, thanks. I'd like to see general commit level comments, I think it would be useful. The main use case I can think of would be to have general discussion on topics like: Coding or documentation standards Repeating issues (i.e. saying "you've miss-spelled 'receive' every time you use it" rather than adding in-line comments to every occurrence) General discussion on the suitability of the change and whether it should even have been committed. I've two questions relating to this feature that I'm not currently sure about: If I'm in a pull request and I click on the commits tab and then down in to a commit itself and add a commit at that level. Is that comment part of the pull request (and shows up in it's default view and is sent out to the reviewers) or is it a completely separate commit area? If it's the later that seems like a potential source of confusion. Am I limited to only commenting on the differences in a commit or can I commit on any file (e.g. to add a "you forgot to update this part" style commit on an unchanged file, a common use for that would be to remind them to update a factory method or icon). Thanks

              Unassigned Unassigned
              4f6fc254103d Jason Perry
              Votes:
              133 Vote for this issue
              Watchers:
              95 Start watching this issue

                Created:
                Updated:
                Resolved: