Skip to content

Commit

Permalink
✨ Add support for download static analysis (#475)
Browse files Browse the repository at this point in the history
### Feature ###

Add support for composing and downloading the static analysis report.

New route: ` /applications/:id/analysis/report` endpoint returns the
analysis report _tarball_.

Adds `AnalysisWriter` used to create/write the Analysis resource to a
temporary file. This is needed to support being streamed which bounds
the memory footprint.

Adds `ReportWriter` used to compose and stream the analysis report
_tarball_. The AppLatestReport() delegates handling of the request to
the writer.

Dockerfile updated to copy the analysis report (tree) from the
static-report project image to /tmp/analysis/report. The tree is used
when creating the analysis report _tarball_.

### Side Effects ###
Created a _new_ `tar` package the provides common, symmetrical
functionality for reading and writing tar (g-zipped) content streams.
This also fixes the problem of existing implementations reading entire
files into memory. This will be used by the new endpoint for static
reports. The implementation has been improved to eliminate loading the
files into memory before zipping.

Added `/test/tar` functional tests.

Also, the BucketOwner & client getDir() and putDir() endpoints can be
stripped down and refactored to delegate to the _new_ `tar` package.

Adds: BaseHandler._Attachment_() method to simplify setting the
Content-Disposition header in multiple places.

closes #354

---------

Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel authored Aug 28, 2023
1 parent 6a361d0 commit 7b74546
Show file tree
Hide file tree
Showing 19 changed files with 977 additions and 330 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ COPY --chown=1001:0 . .
RUN make docker
RUN git clone https://github.com/konveyor/tackle2-seed

FROM quay.io/konveyor/static-report as report

FROM registry.access.redhat.com/ubi9/ubi-minimal
COPY --from=builder /opt/app-root/src/bin/hub /usr/local/bin/tackle-hub
COPY --from=builder /opt/app-root/src/auth/roles.yaml /tmp/roles.yaml
COPY --from=builder /opt/app-root/src/auth/users.yaml /tmp/users.yaml
COPY --from=builder /opt/app-root/src/tackle2-seed/resources/ /tmp/seed
COPY --from=report /usr/local/static-report /tmp/analysis/report

RUN microdnf -y install \
sqlite \
Expand Down
Loading

0 comments on commit 7b74546

Please sign in to comment.