Commit Graph

270 Commits

Author SHA1 Message Date
hiromipaw
d1ab93ba98 Update license 2017-01-03 10:04:03 +01:00
iwakeh
3e37f25eb2 Added test and cure for corrupted history file.
In that case a warning is logged and parsing continued.

Warning makes sense, as it could be due to problems with the
file system, which an operator can do something about.
2016-12-20 09:02:50 +01:00
Karsten Loesing
2f9c942ca1 Add tests for descriptor reader. 2016-12-20 09:02:49 +01:00
iwakeh
f0db82ad75 Some read/write modernization of DescriptorReaderImpl. 2016-12-20 09:02:44 +01:00
Karsten Loesing
56840df195 Add methods for loading and saving a history file.
The history file implementation in `DescriptorReader` writes the
history file passed in `setExcludeFiles()` immediately after reading
and parsing the last descriptor and putting it into the queue,
regardless of whether the application has finished processing those
descriptors.

If the application fails after the history file is written, it may not
be able to process descriptors in the next execution that have still
been in the queue at the time of failing.

This commit deprecates the `setExcludeFiles()` method and replaces it
by a `setHistoryFile()` and a `saveHistoryFile()` method.
Applications would use `setHistoryFile()` before starting to read
descriptors, process all descriptors, perform any cleaning up, and
then call `saveHistoryFile()`.

Implements #20521.
2016-12-20 09:02:40 +01:00
hiromipaw
ee4d69d4bf Revert "Prepare metrics-lib for jenkins build. Exclude checks when building in jenkins. Add clean task as dep for test."
This reverts commit d154982e5a.
2016-11-18 16:27:10 +01:00
hiromipaw
d154982e5a Prepare metrics-lib for jenkins build. Exclude checks when building in jenkins. Add clean task as dep for test. 2016-11-15 13:50:34 +01:00
Karsten Loesing
dd4b395357 Bump version to 1.5.0-dev. 2016-10-20 11:01:16 +02:00
Karsten Loesing
fb74059ae3 Prepare for 1.5.0 release. 2016-10-19 21:21:48 +02:00
iwakeh
421f38eeb9 Implements task-20039: DescriptorIndexCollector now accepts a URL path.
If only a base URL is given, try to retrieve 'index/index.json' from
the given host URL.
2016-10-19 16:44:43 +02:00
iwakeh
24a8d1d5f6 Added checkstyle unused imports module. 2016-10-19 16:44:43 +02:00
iwakeh
3acc8fe61d Logs the served implementation. Implements task-20334. 2016-10-19 16:44:43 +02:00
iwakeh
d00b8ac09b Changed 'descriptor.collector' default value to DescriptorIndexCollector.
Implements task-20404.
2016-10-19 16:44:39 +02:00
Karsten Loesing
f7f56dd83d Avoid running into an IOException and logging it.
When we recently switched from System.err printing to slf4j logging,
we started logging an IOException that we shouldn't be running into
and that we simply ignored before.  This exception gets thrown when
DescriptorReaderImpl attempts to read a parse history file that
doesn't exist (yet).  We should simply check whether that files exists
before attempting to read it.

Fixes #20320.
2016-10-09 08:51:55 +02:00
Karsten Loesing
38b18e3520 Bump version to 1.4.0-dev. 2016-08-31 11:02:14 +02:00
Karsten Loesing
adf4a67702 Prepare for 1.4.0 release. 2016-08-31 10:57:06 +02:00
iwakeh
799fc259b2 Added hints about new jar location to README.md and CHANGELOG.md. 2016-08-31 10:28:49 +02:00
iwakeh
d65b26e0db Added more inline comments and extended tests. 2016-08-30 16:32:09 +02:00
iwakeh
9cdce8c53e Corrected test file size. 2016-08-30 16:32:05 +02:00
Karsten Loesing
c4076089f2 Tweak change log for upcoming 1.4.0 release. 2016-08-24 22:10:14 +02:00
iwakeh
f95a347e93 Download using index.json; implements task-19791.
Added tests and adapted coverage checks.
2016-08-24 21:52:38 +02:00
iwakeh
e9c0731f39 Increased coverage for DescriptorSourceFactory from zero to 100%. 2016-08-23 21:51:11 +02:00
iwakeh
7a0e1097af Adapted build.xml to use Gson and tweaked some tasks and paths. 2016-08-23 21:51:05 +02:00
Karsten Loesing
f120e7f325 Add change log entry for #19643. 2016-08-22 11:27:08 +02:00
iwakeh
1dab40d450 Added slf4j for logging support; implements #19643.
Tests use logback; runtime will use whatever slf4j implementation supplied.
Also removed TODOs about testing, b/c this is noticeable in our coverage report.
2016-08-22 11:25:44 +02:00
Karsten Loesing
2ef622a0d3 Include resources in tarball.
Implements #19893.
2016-08-22 10:38:04 +02:00
iwakeh
7ee3038e0c Make checkstyle task fail, when new warnings appear. 2016-08-02 20:10:37 +02:00
Karsten Loesing
c68b09070a Bump version to 1.3.1-dev. 2016-08-01 14:48:57 +02:00
Karsten Loesing
ec268b51e3 Prepare for 1.3.1 release. 2016-08-01 14:38:36 +02:00
Karsten Loesing
6ac45212ce Update unit tests for 17943b0. 2016-08-01 14:38:25 +02:00
Karsten Loesing
6aa37108e2 Add change log entry for 17943b0. 2016-08-01 14:26:28 +02:00
Karsten Loesing
17943b0b5e Adapt to CollecTor's new date format.
We're parsing dates from the CollecTor's Apache directory listings to
decide whether or not to fetch a remote file.  The CollecTor host was
recently upgraded from wheezy to jessie, which apparently changed the date
format from dd-MMM-yyyy to yyyy-MM-dd.  Adapt to this change.

Obviously, parsing dates like this is very fragile.  We should soon switch
to using CollecTor's index.json file instead, ideally before the next
release.
2016-07-31 10:24:18 +02:00
Karsten Loesing
ad9a1065b4 Bump version to 1.3.0-dev. 2016-07-07 20:24:18 +02:00
Karsten Loesing
e6fb04897b Create javadoc jar. 2016-07-07 20:21:54 +02:00
iwakeh
ac5ff698c9 All clean according to checkstyle. 2016-07-07 10:02:29 +02:00
iwakeh
7294218158 Checkstyle complaints reduced to three. 2016-07-06 20:35:21 +02:00
Karsten Loesing
163442b786 Update CONTRIB.md. 2016-07-06 10:29:49 +02:00
Karsten Loesing
9195a7c4a1 Prepare for 1.3.0 release. 2016-07-06 09:45:32 +02:00
Karsten Loesing
f391d0db48 Update library versions in CONTRIB. 2016-07-06 09:43:41 +02:00
Karsten Loesing
304e72a2ac Adapt the branch rate to 42% for cobertura check.
Suggested by iwakeh on #19571.
2016-07-06 09:02:27 +02:00
Karsten Loesing
732686a8dc Add changelog entry for #19571. 2016-07-05 22:39:49 +02:00
iwakeh
0f367a046e Added test and bugfix for RelayNetworkStatusImpl. 2016-07-05 22:34:02 +02:00
iwakeh
97cf26dc47 Tweaked file structure and added cobertura. 2016-07-05 21:37:44 +02:00
Karsten Loesing
7eff3cc0d9 Update copyright notice to 2016. 2016-07-05 15:58:42 +02:00
Karsten Loesing
395aedf194 Fix most of the style issues found by checkstyle.
Fixed the following number of issues per type:

1131 Indentation
 431 EmptyLineSeparator
  95 CustomImportOrder
  76 OperatorWrap
  54 SeparatorWrap
  25 LocalVariableName
  14 ModifierOrder
  13 MultipleVariableDeclarations
   5 WhitespaceAround
   5 JavadocTagContinuationIndentation
   4 EmptyCatchBlock
   2 VariableDeclarationUsageDistance
   2 MissingSwitchDefault
   1 (... types with single occurrence omitted...)
2016-07-05 15:50:07 +02:00
Karsten Loesing
dfb0ce449b Add checkstyle task.
Copied over from CollecTor.
2016-07-05 14:27:03 +02:00
Karsten Loesing
600a020877 Move all Java sources to src/main/java/. 2016-07-05 10:28:06 +02:00
Karsten Loesing
a7a2dc54f2 Parse "tunnelled-dir-server" lines in server descriptors.
Implements #19284.
2016-07-05 10:10:36 +02:00
Karsten Loesing
90d61b7004 Support other algorithms for directory signatures than sha1.
- Support more than one "directory-signature" line in a vote, which
   may become relevant when authorities start signing votes using more
   than one algorithm.
 - Provide directory signatures in consensuses and votes in a list
   rather than a map to support multiple signatures made using the
   same identity key digest but different algorithms.
 - Be more lenient about digest lengths in directory signatures which
   may be longer or shorter than 20 bytes.

Implements #18875.

While implementing this, make "sha1" constant and deprecate
RelayNetworkStatusVote.getSigningKeyDigest(), because it's remissible
and ambiguous.  Suggested or based on discussions with iwakeh.
2016-07-05 09:34:20 +02:00
Karsten Loesing
d863abbc4e Add @Override annotations.
Also reduce visibility of all public methods in ParseHelper and of one
public method in TorperfResultsImpl, and remove unused methods in
DirectorySignatureImpl and ExitListEntryImpl.
2016-06-14 10:11:49 +02:00