Skip to content

View Reports in UI#5

Merged
gibbardsteve merged 14 commits into
mainfrom
example-report-render
May 22, 2026
Merged

View Reports in UI#5
gibbardsteve merged 14 commits into
mainfrom
example-report-render

Conversation

@Yuyuutsu
Copy link
Copy Markdown
Contributor

@Yuyuutsu Yuyuutsu commented May 6, 2026

Summary

Allow users to view reports generated by the theme finder report generator.

Why

Users need a simple way to access previously generated reports from the UI. This avoids requiring them to request access to, or manually browse, the GCP bucket where past reports are stored.

Changes

  • list available Markdown reports from the configured GCP bucket
  • render individual Markdown reports as HTML in the UI when user clicks view report
  • return appropriate errors for invalid or missing reports
  • reports can only be viewed once the users have logged in

How to Test

Set these env values:

export FILE_STORE="GCP"
export BUCKET_NAME= <BUCKET_NAME>
export PROJECT_ID= <PROJECT_ID>
export OUTPUT_BUCKET_NAME = <OUTPUT_BUCKET_NAME>

The bucket has some example Markdowns that were generated by the report generator

Run the Application and check if the reports are rendered

You can also generate a report and see if the UI renderes the new reports

Check the View Reports tab is only visible when the user haslogged in.

@Yuyuutsu Yuyuutsu marked this pull request as ready for review May 13, 2026 12:36
@Yuyuutsu Yuyuutsu changed the title example report rendering View Reports in UI May 13, 2026
@gibbardsteve gibbardsteve self-requested a review May 15, 2026 14:21
Copy link
Copy Markdown
Collaborator

@gibbardsteve gibbardsteve left a comment

Choose a reason for hiding this comment

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

@Yuyuutsu the reports are written to the output bucket. I think this PR is repurposing BUCKET_NAME (which is the staging bucket for uploads) for that. I believe we will need a new env var OUTPUT_BUCKET_NAME for reading the reports as we can't use the same env var for the two different things.

Copy link
Copy Markdown
Collaborator

@gibbardsteve gibbardsteve left a comment

Choose a reason for hiding this comment

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

Hi - the view reports doesn't work because it is still looking at the staging bucket. It will look like it does work if you still have the same named *.md files in the staging storage.

Comment thread src/theme_analysis_ui/routes/ui.py Outdated
Comment thread src/theme_analysis_ui/routes/ui.py Outdated
@ui_blueprint.before_app_request
def enforce_login() -> ResponseReturnValue | None:
"""Ensure unauthenticated users are redirected to the sign-in page."""
if current_app.debug:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we want to add this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops forgot to remove this when pushing up. Removed!

Copy link
Copy Markdown
Collaborator

@gibbardsteve gibbardsteve left a comment

Choose a reason for hiding this comment

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

You also need to add markdown as a project dependency in pyproject.toml otherwise it fails in cloudrun

@gibbardsteve gibbardsteve merged commit 350f968 into main May 22, 2026
2 checks passed
@gibbardsteve gibbardsteve deleted the example-report-render branch May 22, 2026 10:00
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