You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by le...@apache.org on 2019/03/21 20:24:26 UTC

[incubator-druid] branch master updated: More TeamCity and Structural Search inspection instructions (#7275)

This is an automated email from the ASF dual-hosted git repository.

leventov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new a4270da  More TeamCity and Structural Search inspection instructions (#7275)
a4270da is described below

commit a4270da5f3de25f1182cfdf2ac0d9de7781312cf
Author: Roman Leventov <le...@gmail.com>
AuthorDate: Thu Mar 21 17:24:21 2019 -0300

    More TeamCity and Structural Search inspection instructions (#7275)
    
    * More TeamCity and Structural Search inspection instructions
    
    * the -> a
    
    * an e-mail
---
 ci/README_TeamCity.md                   |  63 ++++++++++++++++++++++++++++++--
 ci/inspections_change_apply.png         | Bin 0 -> 706159 bytes
 ci/structural_search_dialog.png         | Bin 0 -> 213511 bytes
 ci/structural_search_find.png           | Bin 0 -> 545045 bytes
 ci/structural_search_inspection.png     | Bin 0 -> 619809 bytes
 ci/structural_search_inspection_add.png | Bin 0 -> 1072641 bytes
 6 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/ci/README_TeamCity.md b/ci/README_TeamCity.md
index 20728ce..a567234 100644
--- a/ci/README_TeamCity.md
+++ b/ci/README_TeamCity.md
@@ -17,16 +17,16 @@
   ~ under the License.
   -->
   
-## Overview  
+### Overview
 TeamCity is a continuous integration and deployment server responsible for 
 static analysis of Druid source code. Each Github PR request for 
 [Druid](https://teamcity.jetbrains.com/project.html?projectId=OpenSourceProjects_Druid) 
 is checked by TeamCity automatically.
 
-## Login
+### Login
 One can log in to TeamCity either via credentials or as a guest to check static analysis result of any PR.
 
-## Becoming a Project Administrator
+### Becoming a Project Administrator
 Druid committers shall obtain a status of a [Druid project](
 https://teamcity.jetbrains.com/project.html?projectId=OpenSourceProjects_Druid)
 administrator. First, the Druid committer needs to log in teamcity.jetbrains.com using his Github account.
@@ -39,5 +39,60 @@ Then, somebody who is already a project administrator needs to do the following:
  5. Press the "Assign roles" button in the bottom of the page
  6. Select "Role: Project administrator" and "Scope: Open-source project -> Druid" in the inputs, press "Assign"
 
-## Restarting a Build
+### Restarting a Build
 A project administrator could restart a build by pressing the "Run" button on the build page.
+
+### Contacting TeamCity support regarding problems with builds
+
+Regarding any build problems, feel free to contact TeamCity support by writing an e-mail at
+teamcity-support@jetbrains.com. There is an automatic system behind this e-mail address that creates a ticket and sends
+you an e-mail with a link to the ticket. Note that:
+
+ - Contacting TeamCity support regarding problems with open-source Druid project builds is *free*. Don't hestitate doing
+ that if you don't see how to resolve some problem with a build.
+ - You don't need to be a Druid committer to do this. Any Druid contributor can contact TeamCity support.
+
+### Creating a custom inspection from a Structural Search pattern
+
+1. Open a structural search dialog: `Edit` -> `Find` -> `Search Structurally...`
+
+2. Enter a pattern that you want to make an inspection, for example:
+![Structural Search dialog](structural_search_dialog.png)
+
+3. Press the `Find` button to test your pattern:
+![Structural Search find results](structural_search_find.png)
+
+Note that even if currently the pattern finds nothing, it might still be a good idea to add it as an inspection to
+prevent bugs creeping in the codebase in the future. However, test that your pattern doesn't contain mistakes by
+deliberately adding code with a mistake that should be spotted by the pattern in any existing Druid class and testing
+that your Structural Search pattern finds that newly added dummy mistake.
+
+4. Open `Preferences...` -> `Inspections`, navigate to `General` -> `Structural Search inspection`:
+![Structural Search inspection](structural_search_inspection.png)
+
+5. Click a button with a plus sign (`+`) in the bottom of the Options window, `Add Search Template...`:
+![Structural Search inspection add](structural_search_inspection_add.png)
+
+6. Click `OK`. Then you will see a dialong window with title `Save Template` and a field to enter a "template name".
+Enter in this field something reasonably short that yet would serve as a good message for people who add code that
+is caught by this pattern, e. g. "Use Map.putIfAbsent() instead of containsKey() + put()", in this example case. Press
+`OK` again.
+
+7. Move focus anywhere, e. g. by choosing any other inspection. Upon doing this, the `Apply` botton should become
+active:
+![Inspections change apply](inspections_change_apply.png)
+
+8. Press the `Apply` button, then `OK` to exit the inspection preferences.
+
+9. If you did everything right, file `.idea/inspectionProfiles/Druid.xml` should be updated with a new
+`searchConfiguration` entry, in this example case, the following:
+```xml
+      <searchConfiguration name="Use Map.putIfAbsent() instead of containsKey() + put()" text="if (!$m$.containsKey($k$)) {&#10;  $m$.put($k$, $v$);&#10;}" recursive="true" caseInsensitive="true" type="JAVA">
+        <constraint name="__context__" target="true" within="" contains="" />
+        <constraint name="m" within="" contains="" />
+        <constraint name="k" within="" contains="" />
+        <constraint name="v" within="" contains="" />
+      </searchConfiguration>
+```
+
+Don't forget to include this change in your commit when making a pull-request.
\ No newline at end of file
diff --git a/ci/inspections_change_apply.png b/ci/inspections_change_apply.png
new file mode 100644
index 0000000..c647b20
Binary files /dev/null and b/ci/inspections_change_apply.png differ
diff --git a/ci/structural_search_dialog.png b/ci/structural_search_dialog.png
new file mode 100644
index 0000000..6eaf908
Binary files /dev/null and b/ci/structural_search_dialog.png differ
diff --git a/ci/structural_search_find.png b/ci/structural_search_find.png
new file mode 100644
index 0000000..01e5df0
Binary files /dev/null and b/ci/structural_search_find.png differ
diff --git a/ci/structural_search_inspection.png b/ci/structural_search_inspection.png
new file mode 100644
index 0000000..18fa7bc
Binary files /dev/null and b/ci/structural_search_inspection.png differ
diff --git a/ci/structural_search_inspection_add.png b/ci/structural_search_inspection_add.png
new file mode 100644
index 0000000..6388f8a
Binary files /dev/null and b/ci/structural_search_inspection_add.png differ


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org