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 exp 881 #926

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Fix exp 881 #926

wants to merge 9 commits into from

Conversation

Kartikayy007
Copy link
Contributor

@Kartikayy007 Kartikayy007 commented Mar 24, 2025

Fix Sample Page Rendering Issues

Problem

mentioned in #883
Sample pages were failing to render with these errors:
image

The template was using a filter called splitlines which wasn't registered in the Jinja2 environment. Additionally, the template also lacking robustness against undefined variables.

Files Changed for #883

  1. report/web.py - Added missing filter and improved error handling
  2. report/templates/sample.html - Added robustness checks

Changes Made

  1. Added missing filter:

    • Implemented _splitlines method in web.py
    • Registered it with Jinja2 environment
  2. Improved template robustness:

    • Added is defined checks for variables that might be missing
    • Added default values with |default() filter
    • Made remove_trailing_empty_lines filter handle edge cases better
  3. Enhanced error handling:

    • Added detailed error logging with full traceback
    • Created fallback error pages when rendering fails
    • Provided better default values for missing data

These improvements should resolve all the sample page rendering issues.

DonggeLiu and others added 9 commits March 17, 2025 13:47
…dated section name (google#881)

This PR enhances the report UI by adding syntax highlighting to both fuzz target code and build script code.
and the Outdated section name

Reference: GitHub PR google#867 Comment
CC: @DonggeLiu

Features
Fuzz Target Code: Applies language-specific highlighting based on the benchmark YAML language field.
Build Scripts: Uses Bash syntax highlighting for all build scripts, also added line numbers for build script code.
Clean Display: Properly separates build script code from fixer prompts- Fixed Labeling: Corrects misleading "Fixer prompt" section that was previously showing build scripts.
Implementation Details
Added highlight.js library to base.html.
Enhanced Benchmark class with a language field and extraction from YAML files.
Updated Target class to separate build script code from fixer prompts.
Modified templates to apply appropriate syntax highlighting and correct section labeling.
added line numbers to build script code (used the same approach as for the fuzz target code)
Bug Fixes
Fixes issue where build scripts were incorrectly stored in the fixer_prompt field.
Fixes misleading UI section headings by properly labelling build scripts as "Build Script".
…dated section name (google#881)

This PR enhances the report UI by adding syntax highlighting to both fuzz target code and build script code.
and the Outdated section name

Reference: GitHub PR google#867 Comment
CC: @DonggeLiu

Features
Fuzz Target Code: Applies language-specific highlighting based on the benchmark YAML language field.
Build Scripts: Uses Bash syntax highlighting for all build scripts, also added line numbers for build script code.
Clean Display: Properly separates build script code from fixer prompts- Fixed Labeling: Corrects misleading "Fixer prompt" section that was previously showing build scripts.
Implementation Details
Added highlight.js library to base.html.
Enhanced Benchmark class with a language field and extraction from YAML files.
Updated Target class to separate build script code from fixer prompts.
Modified templates to apply appropriate syntax highlighting and correct section labeling.
added line numbers to build script code (used the same approach as for the fuzz target code)
Bug Fixes
Fixes issue where build scripts were incorrectly stored in the fixer_prompt field.
Fixes misleading UI section headings by properly labelling build scripts as "Build Script".
@Kartikayy007
Copy link
Contributor Author

CC: @DonggeLiu

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