Add archive servlet integration test

In change Ic7dc1c8e96e an update of commons-compress from 1.25.0 to
1.28.0 was attempted as part of a broader WORKSPACE dependency refresh.

commons-compress 1.28.0 introduces a runtime dependency on
commons-io (via org.apache.commons.io.output.CountingOutputStream),
which is used by JGit's archive implementation
(org.eclipse.jgit.archive.TarFormat / TgzFormat) when writing
tar/tgz archives.

Gitiles' Bazel configuration does not automatically pull in Maven
transitive dependencies, so commons-io must be declared explicitly.
The attempted upgrade initially omitted this dependency, which would
have caused runtime failures when serving archive downloads, e.g.:

  /<repo>/+archive/refs/heads/<ref>.tar.gz

resulting in:

  java.lang.NoClassDefFoundError:
    org/apache/commons/io/output/CountingOutputStream

This issue was identified during code review and corrected before
submission, but the existing test suite did not exercise the archive
servlet code path and therefore did not detect the breakage.

Add a servlet-level integration test for the archive endpoint that:

* creates a small in-memory test repository
* requests a .tar.gz archive via GitilesServlet
* verifies HTTP 200 response
* verifies response body is non-empty

This test executes ArchiveCommand.call() end-to-end and will fail
with NoClassDefFoundError if commons-io is missing from the runtime
classpath, preventing similar dependency regressions in future
dependency updates.

Change-Id: Ia9266aa6a6ca63b119e2216d8376ce0382ae6e44
1 file changed
tree: 07121dd413ae2c99e870e4af5dc6756864f235bb
  1. .settings/
  2. Documentation/
  3. java/
  4. javatests/
  5. lib/
  6. modules/
  7. resources/
  8. tools/
  9. .bazelrc
  10. .bazelversion
  11. .gitignore
  12. .gitmodules
  13. .mailmap
  14. .zuul.yaml
  15. BUILD
  16. COPYING
  17. fake_pom_deploy.xml
  18. navbar.md
  19. README.md
  20. version.bzl
  21. WORKSPACE
README.md

Gitiles - A simple JGit repository browser

Gitiles is a simple repository browser for Git repositories, built on JGit. Its guiding principle is simplicity: it has no formal access controls, no write access, no fancy Javascript, etc.

Gitiles automatically renders *.md Markdown files into HTML for simplified documentation. Refer to the Markdown documentation for details.

Configuration

Gitiles is configurable in a git-style configuration file named gitiles.config. Refer to the configuration documentation for details.

Bugs

Use gerrit's issue tracker to file bugs.

Contributing to Gitiles

Please refer to the Developer Guide.