You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2023/07/31 10:24:49 UTC

[couchdb] branch feat/xref-fails-build updated (bfa0e035d -> f77ccfe78)

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

jan pushed a change to branch feat/xref-fails-build
in repository https://gitbox.apache.org/repos/asf/couchdb.git


    omit bfa0e035d feat(build): fail build if xref complains
     add 1f2994e7c ci(freebsd): re-enable full platform ci on FreeBSD
     add 64af302f6 Handle invalid field errors in Mango
     new f77ccfe78 feat(build): fail build if xref complains

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (bfa0e035d)
            \
             N -- N -- N   refs/heads/feat/xref-fails-build (f77ccfe78)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build-aux/Jenkinsfile.full           | 17 +++++++++++------
 src/fabric/src/fabric_view.erl       |  8 ++++++--
 src/mango/src/mango_cursor_view.erl  |  7 ++++++-
 src/mango/src/mango_error.erl        |  6 ++++++
 src/mango/src/mango_httpd.erl        |  5 +++++
 src/mango/test/02-basic-find-test.py |  1 +
 6 files changed, 35 insertions(+), 9 deletions(-)


[couchdb] 01/01: feat(build): fail build if xref complains

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch feat/xref-fails-build
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit f77ccfe7851cac86af710dd33142bc6807edd76a
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Thu Jan 5 12:24:24 2023 +0100

    feat(build): fail build if xref complains
---
 Makefile                       | 11 +++++++----
 build-aux/xref-helper.sh       | 24 ++++++++++++++++++++++++
 test/fixtures/allowed-xref.txt |  2 ++
 3 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 231fbb669..7123eae45 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@
 include version.mk
 
 REBAR?=$(shell echo `pwd`/bin/rebar)
+REBAR3?=$(shell echo `pwd`/bin/rebar3)
 ERLFMT?=$(shell echo `pwd`/bin/erlfmt)
 
 # Handle the following scenarios:
@@ -152,6 +153,7 @@ escriptize: couch
 .PHONY: check
 # target: check - Test everything
 check: all
+	@$(MAKE) find-bugs
 	@$(MAKE) exunit
 	@$(MAKE) eunit
 	@$(MAKE) mango-test
@@ -367,10 +369,11 @@ dialyze: .rebar
 	@$(REBAR) -r dialyze $(DIALYZE_OPTS)
 
 
-.PHONY: find_bugs
-# target: find_bugs - Find unused exports etc
-find_bugs:
-	@$(REBAR) --keep-going --recursive xref $(DIALYZE_OPTS)
+.PHONY: find-bugs
+# target: xref - find unused exports etc
+find-bugs:
+	@./build-aux/xref-helper.sh $(REBAR) $(DIALYZE_OPTS)
+
 
 .PHONY: introspect
 # target: introspect - Check for commits difference between rebar.config and repository
diff --git a/build-aux/xref-helper.sh b/build-aux/xref-helper.sh
new file mode 100755
index 000000000..16bbaab88
--- /dev/null
+++ b/build-aux/xref-helper.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+REBAR=$1
+DIALYZE_OPTS=$2
+
+mkdir -p ./tmp
+
+# run rebar xref, grep out rebar meta output (==> and WARN)
+# pipe the rest into a file
+$REBAR --keep-going --recursive xref $DIALYZE_OPTS | \
+                                      grep -v '==>' | \
+                                      grep -v 'WARN' | \
+                                      grep -v hastings > ./tmp/xref-output.txt
+
+# compare result against known allowed output
+DIFF=`diff -u ./tmp/xref-output.txt ./test/fixtures/allowed-xref.txt`
+
+# if the actual output differs from the allowed output
+# print the difference and exit with 1
+if [ -n "$DIFF" ]; then
+  echo "$DIFF"
+  exit 1
+else
+  exit 0
+fi
diff --git a/test/fixtures/allowed-xref.txt b/test/fixtures/allowed-xref.txt
new file mode 100644
index 000000000..c630fc109
--- /dev/null
+++ b/test/fixtures/allowed-xref.txt
@@ -0,0 +1,2 @@
+src/ioq.erl: Warning: ioq:get_disk_queues/0 is undefined function (Xref)
+src/weatherreport_check_ioq.erl:{95,1}: Warning: weatherreport_check_ioq:check_legacy_int/1 calls undefined function ioq:get_disk_queues/0 (Xref)