Support multiple viz HTML files per orion step directory#123
Conversation
|
Warning Review limit reached
Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesDeferred Viz URL Construction
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bugzooka/analysis/log_summarizer.py`:
- Around line 250-255: The multi-file path in log_summarizer.py silently
overwrites entries in viz_urls when multiple HTML files normalize to the same
test_name. Update the loop that builds viz_urls to detect collisions after
strip_step_prefixes(html_name.removesuffix("_viz.html")) and either log a
warning and preserve both entries or generate a unique suffixed key instead of
replacing the existing one. Use the existing gcs_basename, strip_step_prefixes,
and viz_urls assignment block to locate the change.
- Around line 242-255: Add a focused unit test for the multi-file branch in
log_summarizer’s viz URL assembly logic, since tests/test_slack_fetcher.py only
mocks construct_all_orion_viz_urls. Exercise the path where len(html_files) > 1
in the summarizer code, and verify each html_file is converted via gcs_basename,
has the _viz.html suffix removed before calling strip_step_prefixes, and is
stored in viz_urls with the expected artifact URL.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 46b66c20-4be9-486c-94aa-cc9c93f59159
📒 Files selected for processing (1)
bugzooka/analysis/log_summarizer.py
| for html_file in html_files: | ||
| html_name = gcs_basename(html_file) | ||
| test_name = strip_step_prefixes( | ||
| html_name.removesuffix("_viz.html") | ||
| ) | ||
| viz_urls[test_name] = f"{artifacts_url}{html_name}" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Silent key collision when multiple HTML files map to the same test name.
In the multi-file branch, test_name is derived from html_name.removesuffix("_viz.html") passed through strip_step_prefixes. If two HTML files in the same step directory produce the same stripped name (e.g., orion-test_viz.html and test_viz.html both yield test after prefix stripping), the second entry silently overwrites the first in viz_urls, losing a visualization URL without any warning.
Consider logging a warning or appending a suffix on collision to preserve all entries.
🛡️ Suggested fix: detect and warn on collisions
for html_file in html_files:
html_name = gcs_basename(html_file)
test_name = strip_step_prefixes(
html_name.removesuffix("_viz.html")
)
+ if test_name in viz_urls:
+ logger.warning("Duplicate viz test name '%s' from '%s' — overwrites existing entry", test_name, html_name)
viz_urls[test_name] = f"{artifacts_url}{html_name}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for html_file in html_files: | |
| html_name = gcs_basename(html_file) | |
| test_name = strip_step_prefixes( | |
| html_name.removesuffix("_viz.html") | |
| ) | |
| viz_urls[test_name] = f"{artifacts_url}{html_name}" | |
| for html_file in html_files: | |
| html_name = gcs_basename(html_file) | |
| test_name = strip_step_prefixes( | |
| html_name.removesuffix("_viz.html") | |
| ) | |
| if test_name in viz_urls: | |
| logger.warning("Duplicate viz test name '%s' from '%s' — overwrites existing entry", test_name, html_name) | |
| viz_urls[test_name] = f"{artifacts_url}{html_name}" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@bugzooka/analysis/log_summarizer.py` around lines 250 - 255, The multi-file
path in log_summarizer.py silently overwrites entries in viz_urls when multiple
HTML files normalize to the same test_name. Update the loop that builds viz_urls
to detect collisions after
strip_step_prefixes(html_name.removesuffix("_viz.html")) and either log a
warning and preserve both entries or generate a unique suffixed key instead of
replacing the existing one. Use the existing gcs_basename, strip_step_prefixes,
and viz_urls assignment block to locate the change.
Signed-off-by: Nabeel Mohd <mmnabeel317@gmail.com>
574fb0f to
b991c67
Compare
Summary
oslat-changepoint.yamlwithtelco-oslat-latencyandtelco-oslat-availability), it produces multiple_viz.htmlfiles in the same artifacts directoryconstruct_all_orion_viz_urls()only picked uphtml_files[0]— the first HTML per step directory_viz.htmlsuffix +strip_step_prefixes). Single-HTML steps still use the folder name for backward compatibility with perfscale jobs.What changes
Test plan
#2074463759547502592)cluster-density,node-density, etc.)Relates to: PERFSCALE-5191
/cc @vishnuchalla