Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix HTML analysis report. #513

Merged
merged 3 commits into from
Oct 11, 2023
Merged

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Oct 10, 2023

The HTML report (tarball) is composed/streamed by the hub in steps:

  1. Add the static report directory (template).
  2. Add the composed output.js file which contains the analysis data.

Using this method, the ReportWriter was adding the output.js (entry) twice in the tar. First from the static report (template) and the second generated by the hub.
The tar command line seems to deal with this by overwriting the file. However the extract functionality used by browsers ignores the 2nd occurrence.

The fix is to filter out the 1st output.js when using tar.Writer.AddDir().

The Filter in the tar package only supported include filtering. This PR updates the tar.Filter to support both included and excluded patterns.

Refitted and tested the /bucket.

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Signed-off-by: Jeff Ortel <jortel@redhat.com>
@jortel jortel marked this pull request as ready for review October 10, 2023 22:37
Signed-off-by: Jeff Ortel <jortel@redhat.com>
@jortel jortel requested a review from mansam October 11, 2023 00:34
Copy link
Collaborator

@mansam mansam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jortel jortel merged commit 54849ba into konveyor:main Oct 11, 2023
17 checks passed
aufi pushed a commit to aufi/tackle2-hub that referenced this pull request Oct 30, 2023
The HTML report (tarball) is composed/streamed by the hub in steps:
1. Add the static report directory (template).
2. Add the composed `output.js` file which contains the analysis data.

Using this method, the ReportWriter was adding the `output.js` (entry)
twice in the tar. First from the static report (template) and the second
generated by the hub.
The tar command line seems to deal with this by overwriting the file.
However the _extract_ functionality used by browsers ignores the 2nd
occurrence.

The fix is to filter out the 1st output.js when using
tar.Writer.AddDir().

The `Filter` in the `tar` package only supported _include_ filtering.
This PR updates the `tar.Filter` to support both _included_ and
_excluded_ patterns.

Refitted and tested the /bucket.

---------

Signed-off-by: Jeff Ortel <jortel@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants