You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2024/06/20 01:09:17 UTC
(hbase) branch HBASE-28679 created (now 64e262a698f)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a change to branch HBASE-28679
in repository https://gitbox.apache.org/repos/asf/hbase.git
at 64e262a698f HBASE-28679 Try another way to validate xml files
This branch includes the following new commits:
new 64e262a698f HBASE-28679 Try another way to validate xml files
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.
(hbase) 01/01: HBASE-28679 Try another way to validate xml files
Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch HBASE-28679
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 64e262a698f17f4bee8c7de8255e08083d6140c5
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Wed Jun 19 23:13:13 2024 +0800
HBASE-28679 Try another way to validate xml files
Use xmllint instead of jrunscript
---
dev-support/docker/Dockerfile | 3 +++
dev-support/hbase-personality.sh | 56 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/dev-support/docker/Dockerfile b/dev-support/docker/Dockerfile
index dcd84c89c21..e3f2ede01bc 100644
--- a/dev-support/docker/Dockerfile
+++ b/dev-support/docker/Dockerfile
@@ -43,6 +43,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
rsync='3.2.3-*' \
tar='1.34+dfsg-*' \
wget='1.21.2-*' \
+# for validating xml files with xmllint
+ libxml2-dev='2.9.13+dfsg-*' \
+ libxml2-utils='2.9.13+dfsg-*' \
# install the dependencies required in order to enable the sundry precommit
# checks/features provided by Yetus plugins.
bats='1.2.1-*' \
diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh
index c7131c45e2f..d3b106eda63 100755
--- a/dev-support/hbase-personality.sh
+++ b/dev-support/hbase-personality.sh
@@ -890,6 +890,62 @@ function hbase_javac_logfilter
${GREP} -E '\[(ERROR|WARNING)\] /.*\.java:' "${input}" | sort > "${output}"
}
+######################################
+
+# Override the default xml_postcompile to use xmllint instead of jrunscript because the javascript
+# engine has been removed from JDK starting from JDK15
+# https://openjdk.org/jeps/372
+function hbase_xml_postcompile
+{
+ declare repostatus=$1
+ declare i
+ declare count
+
+ if ! verify_needed_test xml; then
+ return 0
+ fi
+
+ if [[ "${repostatus}" = branch ]]; then
+ return 0
+ fi
+
+ big_console_header "XML verification: ${BUILDMODE}"
+
+ start_clock
+
+ pushd "${BASEDIR}" >/dev/null || return 1
+ for i in "${CHANGED_FILES[@]}"; do
+ if [[ ${i} =~ \.xml$ && -f ${i} ]]; then
+ if ! "xmllint" --noout "${i}" > "${PATCH_DIR}/xml.txt.tmp" 2>&1; then
+ {
+ echo ""
+ echo "${i}:"
+ echo ""
+ cat "${PATCH_DIR}/xml.txt.tmp"
+ } >> "${PATCH_DIR}/xml.txt"
+ ((count=count+1))
+ XML_FILES+=("${i}")
+ fi
+ fi
+ done
+
+ popd >/dev/null || return 1
+
+ if [[ -f "${PATCH_DIR}/xml.txt.tmp" ]]; then
+ rm "${PATCH_DIR}/xml.txt.tmp"
+ fi
+
+ if [[ ${count} -gt 0 ]]; then
+ add_vote_table -1 xml "${BUILDMODEMSG} has ${count} ill-formed XML file(s)."
+ add_footer_table xml "@@BASE@@/xml.txt"
+ populate_test_table "XML" "Parsing Error(s):" "${XML_FILES[@]}"
+ return 1
+ fi
+
+ add_vote_table +1 xml "${BUILDMODEMSG} has no ill-formed XML file."
+ return 0
+}
+
## This is named so that yetus will check us right after running tests.
## Essentially, we check for normal failures and then we look for zombies.
#function hbase_unit_logfilter