summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcia Ramos <marcia@gitlab.com>2019-06-25 15:55:03 +0000
committerMarcia Ramos <marcia@gitlab.com>2019-06-25 15:55:03 +0000
commiteb0047e198a5789dbd22936ab5da85c6227ea9e9 (patch)
tree7e2446357795bbe4709f88adc7896e235d05e8fc
parent05079d3340ae3cfb838f5c99f0c3782e222b4d80 (diff)
parent75fd8a40b99500a0deb79026b162ee7b89914228 (diff)
downloadgitlab-ce-eb0047e198a5789dbd22936ab5da85c6227ea9e9.tar.gz
Merge branch 'docs/add-code-comments-development-guide' into 'master'
Add code comments development guide Closes #63132 See merge request gitlab-org/gitlab-ce!30043
-rw-r--r--doc/development/README.md1
-rw-r--r--doc/development/code_comments.md14
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/development/README.md b/doc/development/README.md
index af3207671e6..5df6ec5fd56 100644
--- a/doc/development/README.md
+++ b/doc/development/README.md
@@ -108,6 +108,7 @@ description: 'Learn how to contribute to GitLab.'
- [Database Debugging and Troubleshooting](database_debugging.md)
- [Query Count Limits](query_count_limits.md)
- [Database helper modules](database_helpers.md)
+- [Code comments](code_comments.md)
## Integration guides
diff --git a/doc/development/code_comments.md b/doc/development/code_comments.md
new file mode 100644
index 00000000000..36962eb46d4
--- /dev/null
+++ b/doc/development/code_comments.md
@@ -0,0 +1,14 @@
+# Code comments
+
+Whenever you add comment to the code that is expected to be addressed at any time
+in future, please create a technical debt issue for it. Then put a link to it
+to the code comment you've created. This will allow other developers to quickly
+check if a comment is still relevant and what needs to be done to address it.
+
+Examples:
+
+```rb
+# Deprecated scope until code_owner column has been migrated to rule_type.
+# To be removed with https://gitlab.com/gitlab-org/gitlab-ee/issues/11834.
+scope :code_owner, -> { where(code_owner: true).or(where(rule_type: :code_owner)) }
+```