Commit Graph

319 Commits

Author SHA1 Message Date
Matthias Sohn 6007371e3a Enable Maven reproducible builds
- configure Maven to run build reproducibly [1]
- use UTC timestamp of checked out commit as build timestamp
- add git-describe, git-commit-id, git-commit-id, git-tags,
  git-remote-origin-url to MANIFEST.MF files
- configure cyclonedx-maven-plugin to also use UTC timestamp of
  checked out commit
- for packaging build use tycho-buildtimestamp-jgit [2] to ensure
  version uses the timestamp of the last commit
- SBOMs are not reproducible by design [3] they should have a build
  timestamp matching the time when the build was executed and a serial
  number which is a unique UUID per build run. Hence exclude them from
  comparison [4].
- Use gmavenplus-plugin to format build timestamps. Maven expects
  build timestamp in ISO-8601 format, to replace the qualifier in
  versions the timestamp format must be compatible with rules for OSGi
  version numbers. Didn't find a way to read the properties set by the
  git-commit-id-maven-plugin from another plugin. Hence use JGit in a
  groovy script to get the commit time of the current HEAD and provide
  it in these two formats.

TODO: packaging build (features and p2 repository) is not yet binary
reproducible since that's not yet supported by Tycho [5], artefacts have
reproducible version numbers but file lastModified timestamps are not
yet reproducible.

Test plan for Maven build:
- build using
  mvn clean install"
- verify second build is reproducible:
  mvn -T1 clean verify artifact:compare
  verification seems not to be thread-safe, hence run it with a single
  thread using option -T1

For packaging build (still fails due to non-reproducible file
timestamps):
- build using
  mvn -f org.eclipse.jgit.packaging/pom.xml clean install
- verify second build is reproducible:
  mvn -T1 -f org.eclipse.jgit.packaging/pom.xml clean verify artifact:compare

[1] https://maven.apache.org/guides/mini/guide-reproducible-builds.html
[2] https://wiki.eclipse.org/Tycho/Reproducible_Version_Qualifiers
[3] https://github.com/CycloneDX/cyclonedx-maven-plugin/issues/84
[4] https://maven.apache.org/plugins/maven-artifact-plugin/compare-mojo.html
[5] https://github.com/eclipse-tycho/tycho/issues/233

Change-Id: I0202f55a1b6ae0edd922cfef638beb39d2ce9417
2023-11-09 00:08:42 +01:00
Thomas Wolf e3798df6e8 OSGi: move plugin localization to subdirectory
OSGi can have its plugin localization at an arbitrary place; there is
no need to have it in a top-level plugin.properties file. In non-OSGi
environments having the files at the root level may mean that these
files clash with each other, or, as in the referenced bug, with some
third-party plug-in's plugin.properties, which may not even have
anything to do with localization.

Move our OSGi localization to a subfolder OSGI-INF/l10n. For OSGi
environments, that's just as good, and for non-OSGi environments it
avoid clashes with other root level items on the classpath or in a fat
JAR.

For fragments, use neither plugin.properties (which would clash with the
host plug-in's plugin.properties) nor fragment.properties (which might
clash with other fragments for the same fragment host bundle). Instead
use names "relative" to the host bundle.

Bug: 582394
Change-Id: Ifbcd046d912e2cfe86c0f7259c5ca8de599d9aa1
Signed-off-by: Thomas Wolf <twolf@apache.org>
2023-09-12 20:27:59 +02:00
Matthias Sohn 3a3b72cf90 Prepare 6.8.0-SNAPSHOT builds
Change-Id: Ifc81f0a96c2ced0b25926b9daa539d9cfc951925
2023-09-07 02:24:53 +02:00
Matthias Sohn bb12dd4cbd Prepare 6.7.1-SNAPSHOT builds
Change-Id: I96097ef8c6f198220f513bbc6d5f8881834a1491
2023-09-07 02:03:54 +02:00
Matthias Sohn ea02caf1e7 JGit v6.7.0.202309050840-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Ibe952d97bc178adb909cdd40f48957f5b68af699
2023-09-05 14:41:09 +02:00
Matthias Sohn c5d8936c80 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I49751232464e70b7d1dc3292a9f36b7a7015e44f
2023-08-30 17:46:26 +02:00
Matthias Sohn c54acc5822 JGit v6.7.0.202308301100-rc1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I712a9f6830364ed404d03f3a145c055906273544
2023-08-30 16:57:25 +02:00
Matthias Sohn de7b5b7b26 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I936d2d9106a1e3b7a98ec89fec8ae8a92ec765f2
2023-08-03 00:05:50 +02:00
Matthias Sohn 1d26471c16 JGit v6.7.0.202308011830-m2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I255a979e9f48f60a251ef7b74ced3f720f012706
2023-08-02 00:30:01 +02:00
Antoine Musso 7b955048eb Fix all Javadoc warnings and fail on them
This fixes all the javadoc warnings, stops ignoring doclint 'missing'
category and fails the build on javadoc warnings for public and
protected classes and class members.

Since javadoc doesn't allow access specifiers when specifying doclint
configuration we cannot set `-Xdoclint:all,-missing/private`
hence there is no simple way to skip private elements from doclint.
Therefore we check javadoc using the Eclipse Java compiler
(which is used by default) and javadoc configuration in
`.settings/org.eclipse.jdt.core.prefs` files.
This allows more fine grained configuration.

We can reconsider this when javadoc starts supporting access specifiers
in the doclint configuration.

Below are detailled explanations for most modifications.

@inheritDoc
===========
doclint complains about explicits `{@inheritDoc}` when the parent does
not have any documentation. As far as I can tell, javadoc defaults to
inherit comments and should only be used when one wants to append extra
documentation from the parent. Given the parent has no documentation,
remove those usages which doclint complains about.

In some case I have moved up the documentation from the concrete class
up to the abstract class.

Remove `{@inheritDoc}` on overriden methods which don't add additional
documentation since javadoc defaults to inherit javadoc of overridden
methods.

@value to @link
===============
In PackConfig, DEFAULT_SEARCH_FOR_REUSE_TIMEOUT and similar are forged
from Integer.MAX_VALUE and are thus not considered constants (I guess
cause the value would depends on the platform). Replace it with a link
to `Integer.MAX_VALUE`.

In `StringUtils.toBoolean`, @value was used to refer to the
`stringValue` parameter. I have replaced it with `{@code stringValue}`.

{@link <url>} to <a>
====================
@link does not support being given an external URL. Replaces them with
HTML `<a>`.

@since: being invalid
=====================

org.eclipse.jgit/src/org/eclipse/jgit/util/Equality.java has an invalid
tag `@since: ` due to the extra `:`. Javadoc does not complain about it
with version 11.0.18+10 but does with 11.0.19.7. It is invalid
regardless.

invalid HTML syntax
===================

- javadoc doesn't allow <br/>, <p/> and </p> anymore, use <br> and <p>
instead
- replace <tt>code</tt> by {@code code}
- <table> tags don't allow summary attribute, specify caption as
<caption>caption</caption> to fix this

doclint visibility issue
========================

In the private abstract classes `BaseDirCacheEditor` and
`BasePackConnection` links to other methods in the abstract class are
inherited in the public subclasses but doclint gets confused and
considers them unreachable. The HTML documentation for the sub classes
shows the relative links in the sub classes, so it is all correct. It
must be a bug somewhere in javadoc.
Mute those warnings with: @SuppressWarnings("doclint:missing")

Misc
====
Replace `<` and `>` with HTML encoded entities (`&lt; and `&gt;`).
In `SshConstants` I went enclosing a serie of -> arrows in @literal.

Additional tags
===============
Configure maven-javad0c-plugin to allow the following additional tags
defined in https://openjdk.org/jeps/8068562:
- apiNote
- implSpec
- implNote

Missing javadoc
===============
Add missing @params and descriptions

Change-Id: I840056389aa59135cfb360da0d5e40463ce35bd0
Also-By: Matthias Sohn <matthias.sohn@sap.com>
2023-06-16 01:08:13 +02:00
Matthias Sohn 9afff3e808 Prepare 6.7.0-SNAPSHOT builds
Change-Id: I50ff7ee31046cfc29a087c8963be3deae24b1c9c
2023-05-24 17:31:26 +02:00
Matthias Sohn f34ae6fe31 Prepare 6.6.0-SNAPSHOT builds
Change-Id: I17893f9db12bcb208866f40a06cd4f1ccbb4fe30
2023-03-01 15:40:45 +01:00
Matthias Sohn 2e28f27c26 Prepare 6.5.0-SNAPSHOT builds
Change-Id: I4238b6181e96e22e540cf34802a332f868cb6dfb
2022-11-23 19:09:33 +01:00
Matthias Sohn 85182df267 Prepare 6.4.0-SNAPSHOT builds
Change-Id: I47ca5f1d0263caa0bfc7c303042360c6c5ac4dec
2022-09-14 13:56:40 +02:00
Matthias Sohn fb377b09eb Prepare 6.3.1-SNAPSHOT builds
Change-Id: I44e159eca4131880d74d3078060e7e20f9b5ce76
2022-09-12 10:09:10 +02:00
Matthias Sohn 68e8ecc91b JGit v6.3.0.202209071007-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: Iea3fae9f6f6c5fb0a79f7684334a3e0059738c4f
2022-09-07 16:07:11 +02:00
Matthias Sohn f8104e25f1 JGit v6.3.0.2022009070944-r
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I3cc78dbcf8c7970e80bf1499751611110ec2b30b
2022-09-07 15:39:48 +02:00
Matthias Sohn 3a12709851 Prepare 6.3.0-SNAPSHOT builds
Change-Id: Ie398b651c5308ec86812bf01fcc563d3e679c828
2022-08-17 07:44:50 +02:00
Matthias Sohn 85a4809996 JGit v6.3.0.202208161710-m3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Change-Id: I0954d11a1f35eff196b157df3aa8386476c48a7e
2022-08-16 23:09:30 +02:00
Thomas Wolf 559be66529 [tests] Stabilize the HTTP server's request log
The TestRequestLog added log entries only after a request had been
handled. But the response is already sent at that point, so the
following sequence was possible:

  client sends request A
  server thread T1 handles request A and sends back response
  client receives response
  client sends request B
  server thread T2 handles request B (and sends back response)
  server thread T2 logs B
  server thread T1 logs A

Fix this by logging events before handling a request, and then filling
in the response data after the request has been handled. This should
avoid such inversions, at least for tests using a single single-threaded
client. With multiple concurrent or multi-threaded clients, all bets
about the log order would be off anyway.

Bug: 528187
Change-Id: I99a46df17231fa7c4f75a8c37e2c14dc098c4e22
Signed-off-by: Thomas Wolf <twolf@apache.org>
2022-07-31 14:08:46 +02:00
Matthias Sohn 8137e5e746 Prepare 6.3.0-SNAPSHOT builds
Change-Id: I092fdd2c35d85bf35e3ef700aa7078e6d304d977
2022-06-07 01:02:10 +02:00
Matthias Sohn d0ed6016d4 Prepare 6.2.0-SNAPSHOT builds
Change-Id: Ic2dde88bee3242169d6fa50956f8938f3fc4ba8e
2022-03-03 10:49:58 +01:00
Nail Samatov 2b01ac3389 [test] Fix closing of test repositories
Fix tests failing on Windows because Repository instance is created but
not closed on tear down.

Fix repositories closed twice, except in tests that test this behavior
explicitly.

Name the temporary directories the tests run in after the test method;
that makes it easier to figure out in which tests repositories are
closed twice if it should occur again in the future.

Bug: 550111
Change-Id: I9398b58f0f36d2c29236d2a9a8599117d9083980
Signed-off-by: Nail Samatov <sanail@yandex.ru>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2022-01-30 17:16:02 -05:00
Matthias Sohn 5f556588a9 Merge branch 'stable-6.0'
* stable-6.0:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  [errorprone] Fix InfiniteRecursion error in RecordingLogger
  [errorprone] Suppress Finally error in ObjectDownloadListener
  [errorprone] Fix implicit use of default charset in FileBasedConfigTest
  [errorprone] Suppress FutureReturnValueIgnored in FileRepository#autoGc

Change-Id: I08d58c8f3f04e3a920da43b5fb252b1654c2b33c
2022-01-19 09:53:21 +01:00
Matthias Sohn a268faf729 [errorprone] Fix InfiniteRecursion error in RecordingLogger
Change-Id: I092389e428232a4fe7613d846c288d285ae9102c
2022-01-18 16:11:57 +01:00
Matthias Sohn 30b79cd0e8 Prepare 6.0.1-SNAPSHOT builds
Change-Id: Iddb67ed9578293b83b8147aa18dd8319426f83d1
2021-11-29 17:37:27 +01:00
Matthias Sohn 9492e84fe5 JGit v6.0.0.202111291000-r
Change-Id: I6441d9226e8131552bfafe1fb2c353f2e07e42ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-29 16:10:14 +01:00
Matthias Sohn 3cb02ccfdf Merge branch 'stable-6.0'
* stable-6.0:
  FS: debug logging only if system config file cannot be found
  FS: debug logging only if system config file cannot be found
  Update .factorypath used by annotation processor for benchmarks
  Use  maven-compiler-plugin's release tag instead of source and target
  Don't use deprecated Repository#getAllRefs in Repository
  Don't use deprecated Repository#getAllRefs in FileRepository
  RevListTest: fix warning that method parameter hides field 'git'
  Implement RecordingLogger based on org.slf4j.Logger
  Let ObjectDatabase implement AutoClosable

Change-Id: Ie6b3cfa66b319033d4448dcf20362b753c0e9d7c
2021-11-28 12:07:48 +01:00
Matthias Sohn 75c716f5d7 Implement RecordingLogger based on org.slf4j.Logger
Jetty 10 uses slf4j for logging and deprecated its own Logger interface
org.eclipse.jetty.util.log.Logger.

Change-Id: I1b0c3a23e43190a50987175973725c3ad6e32f5f
2021-11-24 23:12:08 +01:00
Matthias Sohn 4453a6e042 Prepare 6.1.0-SNAPSHOT builds
Change-Id: Ied07b1298bd32672a5025cec5079440ab9b9a100
2021-11-24 19:42:27 +01:00
Matthias Sohn e3707a6cea Prepare 6.0.0-SNAPSHOT builds
Change-Id: I4e06186cf62681767962e391331cc65bafddc205
2021-11-24 18:18:12 +01:00
Matthias Sohn ad8d89b9c0 JGit v6.0.0.202111241155-rc1
Change-Id: I35dc089a00ee12f83f506fb320d23762fa030063
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-11-24 17:54:51 +01:00
Matthias Sohn 791d3b0eb4 AppServer: fix keystore used to setup test SSL context factory
- configure dName
- add SANs ip:127.0.0.1, ip:[::1]

See jetty's own test setup in
1cd15e8d85/jetty-client/src/test/resources/readme_keystores.txt (L6)

and the fixes done in
1cd15e8d85

Change-Id: Ie3260db7a7090dfa92b43eb32bf247640ebf8482
2021-11-24 09:17:07 +01:00
Matthias Sohn f91e47f5b6 Update Jetty to 10.0.6
- this is the same version eclipse platform currently uses
- update servlet-api to 4.0
- configure keystore used by AppServer with Subject Alternative Names
  for host name and ip address to satisfy more strict SNI checking in
  Jetty 10. See https://github.com/eclipse/jetty.project/issues/5379
- add jetty bundles to JGit-dependency-bundles in the jgit p2 repository

Bug: 571932
Bug: 576100
Change-Id: Ibd0240cf7ad4dc201947fd69707f517c3c1fc1c8
2021-11-22 20:50:28 +01:00
Thomas Wolf bdba9edd5f Remove redundant type arguments
In Java 11 type arguments for anonymous subclasses can be inferred
and don't need to be specified. This resolves a number of compiler
warnings.

Change-Id: I55eff3babb7628aa0627085e65a1b45eb12c2cd3
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-09-30 09:31:12 +02:00
Matthias Sohn 1d280db147 Enable compiler option --release
This ensures the compiler compiles against the public, supported and
documented API for a specific VM version (here 11) [1]. This also means
that
we don't need EE descriptors in Eclipse anymore in order to ensure that
only supported APIs of the selected Java version can be used.

According to [2] if option --release is used --source and --target
options can't be used.

While we are at it also add default value for all new jdt core options
added in Eclipse 4.21.

[1] https://docs.oracle.com/en/java/javase/11/tools/javac.html
[2] https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#option-release

Change-Id: I852a5d7b0a3210751c15d79ec91915b4c01c41e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:13:01 +02:00
Matthias Sohn f81a3fc91a Bump minimum required Java version to 11
Bug: 569917
Change-Id: Ifdcdb022a3f29321b4d10da1cc34acca68ed7b03
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:12:12 +02:00
Matthias Sohn a19494b735 Merge branch 'master' into next
* master: (38 commits)
  Revert "DFS block cache: Refactor to enable parallel index loading"
  GitServlet: allow to override default error handlers
  Silence API error for new interface method ProtocolV2Hook#onObjectInfo
  transport: add object-info capability
  Ignore IllegalStateException if JVM is already shutting down
  Update orbit to R20210825222808 for 2021-09
  Update spotbugs-maven-plugin to 4.3.0
  Update ant to 1.10.11 also in pom.xml
  DFS block cache: add additional stats to DfsReaderIoStats
  Update Orbit to S20210817231813
  [gpg] Better GPG home directory determination
  FS: cleanup use of final modifier
  Ensure FS#searchPath only selects executable files
  RevWalk: getMergedInto's result is wrong on the second call
  DFS block cache: Refactor to enable parallel index loading
  [test] Create keystore with the keytool of the running JDK
  [gpg] Update to Bouncy Castle 1.69
  [test] Create keystore with the keytool of the running JDK
  [sshd] Minor code clean-up
  Support commit.template config property
  ...

Change-Id: I9f99e9a513a23c0c0d252334e79c351512d7355e
2021-09-13 23:53:34 +02:00
Thomas Wolf 2d73c702d3 [test] Create keystore with the keytool of the running JDK
Call keytool with the absolute path of "java.home". Otherwise a keytool
for a different, maybe even newer Java version might be picked up, and
then the keystore may not be readable by the JVM used to run the tests.

Change-Id: Iea77024947a34267f008847d81312fe0abadc615
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-07-25 15:48:26 +02:00
Matthias Sohn 1cbfea9ece Prepare 5.13.0-SNAPSHOT builds
Change-Id: Ie9cfc1eeb0eda7b2bbe744a22a7e4cfe6d59bc37
2021-06-14 01:49:05 +02:00
Matthias Sohn a397727e4a Prepare 5.12.1-SNAPSHOT builds
Change-Id: Idf266c34aa9a04cf9c5e0e09bcb415c13d773d4c
2021-06-13 23:59:14 +02:00
Matthias Sohn 1f062c64be JGit v5.12.0.202106070339-r
Change-Id: I0fbfea2c83f1ce83f75130cc97591547032f1104
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-06-07 09:38:29 +02:00
Matthias Sohn 044c5f215c Prepare 5.12.0-SNAPSHOT builds
Change-Id: Ifc72d3f3ac84b9c4055b95ec0093d877ffb09ab0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-06-03 20:04:28 +02:00
Matthias Sohn 45a4c131ae JGit v5.12.0.202106021050-rc1
Change-Id: I622ee049f14f37504ff4a062f03d6fc25465d0ec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-06-02 16:49:17 +02:00
Matthias Sohn 1f733663bf Prepare 5.12.0-SNAPSHOT builds
Change-Id: I25e4efc9b40ae4e7168b37385445c73992c5beb0
2021-06-02 08:47:28 +02:00
Matthias Sohn 94aa245023 JGit v5.12.0.202106011439-rc1
Change-Id: Ieac1d02879defe0f4791062448d4efc328a2f652
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-06-01 20:38:31 +02:00
Matthias Sohn 677d7794cc Prepare 5.12.0-SNAPSHOT builds
Change-Id: If563be77aab768ac1f31ae2211fb0892d0205a2a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-06-01 16:13:41 +02:00
Matthias Sohn ff4c10bf90 JGit v5.12.0.202105261145-m3
Change-Id: I3b1af2032227900e6e0c6189f47bace1df67f0ab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-05-26 17:43:55 +02:00
Matthias Sohn 520b6d7dcf Prepare 5.12.0-SNAPSHOT builds
Change-Id: I2fc5305e7eaaa4593d418fc3b31d20e4b6e1e585
2021-05-06 09:53:25 +02:00
Matthias Sohn 92679d792f JGit v5.12.0.202105051250-m2
Change-Id: Ic7d86c91ec0ff9aa0678dcb971c197e62a4ca2dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-05-05 17:50:19 +02:00