Apache Nutch is an extensible and scalable web crawler
NUTCH-3196 Yetus: stop failing the tree on known false positives and non-source noise (#947)
Lewis John McGibbney78c179c6c694
diff --git a/.codespellrc b/.codespellrcindex 377447ad9..dedef4624 100644--- a/.codespellrc+++ b/.codespellrc@@ -1,5 +1,11 @@[codespell]-# JUnit 5 annotations incorrectly flagged as spelling errors-ignore-words-list = AfterAll,BeforeAll-# CHANGES.md is a historical changelog not maintained by this branch-skip = CHANGES.md+# JUnit 5 annotations incorrectly flagged as spelling errors.+# Loction: intentional misspelling in protocol-http/okhttp TestResponse fixtures+# used to exercise SpellCheckedMetadata error-tolerant Location header matching.+# uery: intentional query-string token in urlnormalizer-protocol TestProtocolURLNormalizer.+ignore-words-list = AfterAll,BeforeAll,Loction,uery+# CHANGES.md is a historical changelog not maintained by this branch.+# Language-identifier corpora, binary license trees, and naivebayes training+# sample are also listed in .yetus/excludes.txt for full-tree Yetus runs; skip+# them here so local codespell matches CI.+skip = CHANGES.md,src/plugin/language-identifier/src/test,LICENSE-binary,NOTICE-binary,licenses-binary,conf/naivebayes-train.txt.templatediff --git a/.yetus/detsecrets-ignored-hashes.txt b/.yetus/detsecrets-ignored-hashes.txtnew file mode 100644index 000000000..42f240cb3--- /dev/null+++ b/.yetus/detsecrets-ignored-hashes.txt@@ -0,0 +1,39 @@+# detect-secrets hashed_secret values that Yetus should ignore.+# Format: one hash per line; lines starting with # are comments.+# Review any addition: confirm it is a false positive, not a real secret.+# See apacheyetuspatchdir/results-detsecrets.txt from the failing master run+# and NUTCH Yetus Child A (baselines / false positives).+#+# SHA-1 of the literal string "password" (and similar). Hits config property+# names, URI documentation examples (amqp://username:password@...), and+# constant values that name the password field — not live credentials.+5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8+#+# OpenSearch1xConstants: config key string "trust.store.password"+ec05eda067a39ffdc229dff3a0d55db56656d678+#+# OpenSearch1xConstants: config key string "key.store.password"+31fa62ac05693f4af2e2502db1f33f702afbdb43+#+# OpenSearch1xIndexWriter: documented default "admin" for local/dev broker+# examples (not a production secret checked into the tree as a credential).+d033e22ae348aeb5660fc2140aec35850c4da997+#+# TestExtParser: expected MD5 hex of sample parse content+2fe42febe111596aa7070228ed35a41f3ffe444c+#+# protocol-httpclient auth unit-test fixture passwords (passx, ntlm_pass, ...)+c05344161c34c6606402148288f1c554ae669c59+00f18fe6a9b0aca8604af067990196a949ea954a+085a30b5d2b112ebbbcbc8d54d41e4df58d02f39+f0578f1e7174b1a41c4ea8c6e17f7a8a3b88c92a+8be52126a6fde450a7162a3651d589bb51e9579d+#+# TestBadServerResponses: high-entropy alphabet string used as response body+8332535894e68d6ff799a283a496515c03a78d94+#+# DumpFileUtilTest: expected MD5 hex assertion value+b1da254a02ecdaa258432fa3f3292bd77243de2c+#+# TestStringUtil: example AMQP URI containing the documentation password token+7e9c593cb78751c2c9c5e026e8b37bffbeb0ca75diff --git a/.yetus/excludes.txt b/.yetus/excludes.txtnew file mode 100644index 000000000..6cfe88d3c--- /dev/null+++ b/.yetus/excludes.txt@@ -0,0 +1,16 @@+# Regexes (one per line, no spaces) of paths Yetus should keep out of the+# changed-file set passed to plugins. See --excludes / .yetus/excludes.txt.+# Used especially by full-tree (master) runs so non-source noise does not drown+# the report. Comments and blank lines are ignored.+#+# Language-identifier test corpora: non-English / sample text that codespell+# treats as typos. Product Java under this plugin is not excluded.+^src/plugin/language-identifier/src/test/+#+# Bundled third-party license/notice text (not Nutch prose to spell-check).+^LICENSE-binary$+^NOTICE-binary$+^licenses-binary/+#+# Naive Bayes training sample (deliberately messy email/OCR-like text).+^conf/naivebayes-train\.txt\.template$diff --git a/README.md b/README.mdindex d453d6584..2a4ec82fe 100644--- a/README.md+++ b/README.md@@ -47,7 +47,8 @@ test-patch --basedir=/path/to/clean/repo --build-tool=nobuild \--plugins=all,-jira,-gitlab,-unit,-compile [patchfile]```-Exclude patterns can be added in `.yetus/excludes.txt` (regex, one per line).+Exclude patterns and related Yetus baselines can be added under `.yetus/`+(see `.yetus/excludes.txt`).IDE setup---------diff --git a/src/java/org/apache/nutch/util/GZIPUtils.java b/src/java/org/apache/nutch/util/GZIPUtils.javaindex 7daa6a729..df137cc48 100644--- a/src/java/org/apache/nutch/util/GZIPUtils.java+++ b/src/java/org/apache/nutch/util/GZIPUtils.java@@ -27,7 +27,7 @@ import org.slf4j.Logger;import org.slf4j.LoggerFactory;/**- * A collection of utility methods for working on GZIPed data.+ * A collection of utility methods for working on gzipped data.*/public class GZIPUtils {diff --git a/src/plugin/index-replace/src/test/org/apache/nutch/indexer/replace/TestIndexReplace.java b/src/plugin/index-replace/src/test/org/apache/nutch/indexer/replace/TestIndexReplace.javaindex 0e48cee0e..d4cabbe5f 100644--- a/src/plugin/index-replace/src/test/org/apache/nutch/indexer/replace/TestIndexReplace.java+++ b/src/plugin/index-replace/src/test/org/apache/nutch/indexer/replace/TestIndexReplace.java@@ -418,7 +418,7 @@ public class TestIndexReplace {/*** Test a replacement pattern that uses the target field feature.- * Check that the input is not modifid and that the taret field is added.+ * Check that the input is not modified and that the target field is added.*/@Testpublic void testReplacementsDifferentTarget() {diff --git a/src/plugin/lib-regex-filter/src/java/org/apache/nutch/urlfilter/api/RegexURLFilterBase.java b/src/plugin/lib-regex-filter/src/java/org/apache/nutch/urlfilter/api/RegexURLFilterBase.javaindex 2795c2cf8..9a357d88f 100644--- a/src/plugin/lib-regex-filter/src/java/org/apache/nutch/urlfilter/api/RegexURLFilterBase.java+++ b/src/plugin/lib-regex-filter/src/java/org/apache/nutch/urlfilter/api/RegexURLFilterBase.java@@ -177,7 +177,7 @@ public abstract class RegexURLFilterBase implements URLFilter {try {domain = URLUtil.getDomainName(url);} catch (MalformedURLException e) {- // shouldnt happen here right?+ // shouldn't happen here right?}LOG.debug("URL belongs to host {} and domain {}", host, domain);diff --git a/src/plugin/protocol-htmlunit/src/java/org/apache/nutch/protocol/htmlunit/HttpResponse.java b/src/plugin/protocol-htmlunit/src/java/org/apache/nutch/protocol/htmlunit/HttpResponse.javaindex 0a4f0a68c..e77932e33 100644--- a/src/plugin/protocol-htmlunit/src/java/org/apache/nutch/protocol/htmlunit/HttpResponse.java+++ b/src/plugin/protocol-htmlunit/src/java/org/apache/nutch/protocol/htmlunit/HttpResponse.java@@ -450,7 +450,7 @@ public class HttpResponse implements Response {+ " bytes in successful chunks" + " and " + chunkBytesRead+ " in current chunk");- // DANGER!!! Will printed GZIPed stuff right to your+ // DANGER!!! Will print gzipped stuff right to your// terminal!// if (LOG.isTraceEnabled()) { LOG.trace("read: " + new String(bytes, 0,// len)); }diff --git a/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java b/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.javaindex ead757574..bd2611ec1 100644--- a/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java+++ b/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java@@ -524,7 +524,7 @@ public class HttpResponse implements Response {+ " bytes in successful chunks" + " and " + chunkBytesRead+ " in current chunk");- // DANGER!!! Will printed GZIPed stuff right to your+ // DANGER!!! Will print gzipped stuff right to your// terminal!// if (LOG.isTraceEnabled()) { LOG.trace("read: " + new String(bytes, 0,// len)); }diff --git a/src/plugin/protocol-httpclient/src/test/org/apache/nutch/protocol/httpclient/TestProtocolHttpClient.java b/src/plugin/protocol-httpclient/src/test/org/apache/nutch/protocol/httpclient/TestProtocolHttpClient.javaindex 4873ae8ed..88315c2e9 100644--- a/src/plugin/protocol-httpclient/src/test/org/apache/nutch/protocol/httpclient/TestProtocolHttpClient.java+++ b/src/plugin/protocol-httpclient/src/test/org/apache/nutch/protocol/httpclient/TestProtocolHttpClient.java@@ -92,7 +92,7 @@ public class TestProtocolHttpClient extends AbstractHttpProtocolPluginTest {}/**- * Tests that no pre-emptive authorization headers are sent by the client.+ * Tests that no preemptive authorization headers are sent by the client.** @throws Exception* If an error occurs or the test case fails.diff --git a/src/plugin/urlfilter-validator/src/test/org/apache/nutch/urlfilter/validator/TestUrlValidator.java b/src/plugin/urlfilter-validator/src/test/org/apache/nutch/urlfilter/validator/TestUrlValidator.javaindex d815486de..9d9b60592 100644--- a/src/plugin/urlfilter-validator/src/test/org/apache/nutch/urlfilter/validator/TestUrlValidator.java+++ b/src/plugin/urlfilter-validator/src/test/org/apache/nutch/urlfilter/validator/TestUrlValidator.java@@ -56,7 +56,7 @@ public class TestUrlValidator {"Invalid url: ftp:www.example.com/main.html");assertNull(url_validator.filter("http://999.000.456.32/nutch/trunk/README.txt"),- "Inalid url: http://999.000.456.32/nutch/trunk/README.txt");+ "Invalid url: http://999.000.456.32/nutch/trunk/README.txt");assertNull(url_validator.filter(" http://www.example.com/ma|in\\toc.html"),"Invalid url: http://www.example.com/ma|in\\toc.html");