You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/03/09 10:15:45 UTC

[1/6] incubator-weex git commit: * [test] add modify public method/class danger check

Repository: incubator-weex
Updated Branches:
  refs/heads/0.11-dev 894a1318e -> fd8a964a6


* [test] add modify public method/class danger check


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/2af15c1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/2af15c1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/2af15c1d

Branch: refs/heads/0.11-dev
Commit: 2af15c1d801a7dd9d626eb3f00cc3e85ff08febb
Parents: 18aa265
Author: sospartan <so...@gmail.com>
Authored: Thu Mar 9 14:29:16 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Thu Mar 9 16:14:38 2017 +0800

----------------------------------------------------------------------
 Dangerfile                                         | 17 +++++++++++++++++
 .../test/java/com/taobao/weex/TestActivity.java    |  6 ++++--
 test/ci-funcs.sh                                   |  2 +-
 3 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2af15c1d/Dangerfile
----------------------------------------------------------------------
diff --git a/Dangerfile b/Dangerfile
index 9cffca1..f0d1cd1 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -1,3 +1,20 @@
+# Error or Warn when delete public interface
+metion_break_change = git.commits.any? { |c| c.message =~ /'breack change'/ }
+
+for file in git.modified_files do
+  if file.end_with?("java")
+    diff = git.diff_for_file(file)
+    if diff && diff.patch =~ /^-\s*?public\s+[\s\S]+$/ 
+      if metion_break_change
+        warn("Modify public in #{file}")
+      else
+        fail("Modify public in #{file} without metion it in commit message. ")
+    end
+  end
+end
+
+
+
 # Warn when there is a big PR
 warn("Big PR") if git.lines_of_code > 500
 

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2af15c1d/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/test/java/com/taobao/weex/TestActivity.java b/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
index 1b5cb6f..f5d2e75 100644
--- a/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
+++ b/android/sdk/src/test/java/com/taobao/weex/TestActivity.java
@@ -205,9 +205,11 @@
 package com.taobao.weex;
 
 import android.app.Activity;
-
 /**
  * Created by sospartan on 7/27/16.
  */
-public class TestActivity extends Activity {
+public  class TestActivity extends Activity {
+  public void test(){
+    //
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2af15c1d/test/ci-funcs.sh
----------------------------------------------------------------------
diff --git a/test/ci-funcs.sh b/test/ci-funcs.sh
index 5a4c96a..912769f 100644
--- a/test/ci-funcs.sh
+++ b/test/ci-funcs.sh
@@ -110,7 +110,7 @@ function test_cpt {
         npm run build
         npm run test
     else
-        xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
+       # xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
         bundle exec danger
     fi
 }


[5/6] incubator-weex git commit: * [test] fix ignore list

Posted by cx...@apache.org.
* [test] fix ignore list


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/fcc289f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/fcc289f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/fcc289f2

Branch: refs/heads/0.11-dev
Commit: fcc289f27849f594918222fcf6e87620b62b3ce2
Parents: 7e4e9e9
Author: sospartan <so...@gmail.com>
Authored: Thu Mar 9 17:35:27 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Thu Mar 9 17:35:27 2017 +0800

----------------------------------------------------------------------
 Dangerfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/fcc289f2/Dangerfile
----------------------------------------------------------------------
diff --git a/Dangerfile b/Dangerfile
index 0a75143..e50de1c 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -4,8 +4,8 @@ metion_break_change = git.commits.any? { |c| c.message =~ /'breack change'/ }
 # File name match any of these patterns will be ignored.
 def is_ignored_public_check file
   ignored_break_change_pattern = Array.[](
-    /$android\/sdk\/src\/test\/.+/,
-    /$android\/playground\/.+/,
+    /^android\/sdk\/src\/test\/.+/,
+    /^android\/playground\/.+/,
   )
   for pattern in ignored_break_change_pattern do
     if file =~ pattern


[3/6] incubator-weex git commit: * [test] fix dangerfile

Posted by cx...@apache.org.
* [test] fix dangerfile


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6da5b993
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6da5b993
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6da5b993

Branch: refs/heads/0.11-dev
Commit: 6da5b993d0779a29850d4883500df8caecec7a84
Parents: 0c421b2
Author: sospartan <so...@gmail.com>
Authored: Thu Mar 9 16:53:30 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Thu Mar 9 16:53:30 2017 +0800

----------------------------------------------------------------------
 Dangerfile | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6da5b993/Dangerfile
----------------------------------------------------------------------
diff --git a/Dangerfile b/Dangerfile
index 5232ff5..4276853 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -9,6 +9,7 @@ for file in git.modified_files do
         warn("Modify public in #{file}")
       else
         fail("Modify public in #{file} without metion it in commit message. ")
+      end
     end
   end
 end


[6/6] incubator-weex git commit: Merge branch '0.11-dev-danger-remove-public' of https://github.com/sospartan/incubator-weex into 0.11-dev

Posted by cx...@apache.org.
Merge branch '0.11-dev-danger-remove-public' of https://github.com/sospartan/incubator-weex into 0.11-dev


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/fd8a964a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/fd8a964a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/fd8a964a

Branch: refs/heads/0.11-dev
Commit: fd8a964a623af965a84b2e99cc3969ddb002f61a
Parents: 894a131 fcc289f
Author: cxfeng <cx...@apache.org>
Authored: Thu Mar 9 18:15:34 2017 +0800
Committer: cxfeng <cx...@apache.org>
Committed: Thu Mar 9 18:15:34 2017 +0800

----------------------------------------------------------------------
 Dangerfile                                      | 34 ++++++++++++++++++--
 Dangerfile-ios                                  |  4 +++
 .../test/java/com/taobao/weex/TestActivity.java |  6 ++--
 test/ci-funcs.sh                                |  4 +--
 4 files changed, 41 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[2/6] incubator-weex git commit: * [test] push ios ut report to seperate danger file

Posted by cx...@apache.org.
* [test] push ios ut report to seperate danger file


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0c421b2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0c421b2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0c421b2e

Branch: refs/heads/0.11-dev
Commit: 0c421b2ea936e5751bc72e342685c5b2e9950341
Parents: 2af15c1
Author: sospartan <so...@gmail.com>
Authored: Thu Mar 9 16:29:47 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Thu Mar 9 16:29:47 2017 +0800

----------------------------------------------------------------------
 Dangerfile       | 5 -----
 Dangerfile-ios   | 4 ++++
 test/ci-funcs.sh | 4 ++--
 3 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0c421b2e/Dangerfile
----------------------------------------------------------------------
diff --git a/Dangerfile b/Dangerfile
index f0d1cd1..5232ff5 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -13,8 +13,6 @@ for file in git.modified_files do
   end
 end
 
-
-
 # Warn when there is a big PR
 warn("Big PR") if git.lines_of_code > 500
 
@@ -26,9 +24,6 @@ if git.lines_of_code > 100 && has_app_changes && !has_test_changes
   warn "This PR may need tests."
 end
 
-# Shows all build errors, warnings and unit tests results generated from `xcodebuild`
-xcode_summary.ignored_files = '**/Pods/**'
-xcode_summary.report 'ios/sdk/xcodebuild.json'
 
 # Fails build when Copyright header is not included
 oc_files = (git.modified_files + git.added_files).uniq.select do |file_path|

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0c421b2e/Dangerfile-ios
----------------------------------------------------------------------
diff --git a/Dangerfile-ios b/Dangerfile-ios
new file mode 100644
index 0000000..c7139b4
--- /dev/null
+++ b/Dangerfile-ios
@@ -0,0 +1,4 @@
+
+# Shows all build errors, warnings and unit tests results generated from `xcodebuild`
+xcode_summary.ignored_files = '**/Pods/**'
+xcode_summary.report 'ios/sdk/xcodebuild.json'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0c421b2e/test/ci-funcs.sh
----------------------------------------------------------------------
diff --git a/test/ci-funcs.sh b/test/ci-funcs.sh
index 912769f..8b4915b 100644
--- a/test/ci-funcs.sh
+++ b/test/ci-funcs.sh
@@ -105,13 +105,13 @@ function test_cpt {
         ./test/serve.sh 2&>1 > /dev/null &
         xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
         run_in_ci=true ./test/run.sh ios
+        bundle exec danger --dangerfile=Dangerfile-ios
     elif [ $target = $target_jsfm ]
     then
         npm run build
         npm run test
     else
-       # xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6' | XCPRETTY_JSON_FILE_OUTPUT=ios/sdk/xcodebuild.json xcpretty -f `xcpretty-json-formatter`
-        bundle exec danger
+        bundle exec danger 
     fi
 }
 


[4/6] incubator-weex git commit: * [test] add ignore for tests

Posted by cx...@apache.org.
* [test] add ignore for tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7e4e9e98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7e4e9e98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7e4e9e98

Branch: refs/heads/0.11-dev
Commit: 7e4e9e98a2651abeb3273c5634188b3a411c8638
Parents: 6da5b99
Author: sospartan <so...@gmail.com>
Authored: Thu Mar 9 17:29:02 2017 +0800
Committer: sospartan <so...@gmail.com>
Committed: Thu Mar 9 17:29:02 2017 +0800

----------------------------------------------------------------------
 Dangerfile | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7e4e9e98/Dangerfile
----------------------------------------------------------------------
diff --git a/Dangerfile b/Dangerfile
index 4276853..0a75143 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -1,14 +1,29 @@
 # Error or Warn when delete public interface
 metion_break_change = git.commits.any? { |c| c.message =~ /'breack change'/ }
 
+# File name match any of these patterns will be ignored.
+def is_ignored_public_check file
+  ignored_break_change_pattern = Array.[](
+    /$android\/sdk\/src\/test\/.+/,
+    /$android\/playground\/.+/,
+  )
+  for pattern in ignored_break_change_pattern do
+    if file =~ pattern
+      return true
+    end
+  end
+  return false
+end
+
+
 for file in git.modified_files do
-  if file.end_with?("java")
+  if not is_ignored_public_check(file) && file.end_with?("java")
     diff = git.diff_for_file(file)
     if diff && diff.patch =~ /^-\s*?public\s+[\s\S]+$/ 
       if metion_break_change
-        warn("Modify public in #{file}")
+        warn("Potential BREAK CHANGE. Modify public in #{file}")
       else
-        fail("Modify public in #{file} without metion it in commit message. ")
+        fail("Potential BREAK CHANGE. Modify public in #{file} without metion it in commit message. ")
       end
     end
   end