Skip to content

Support video attachments in Recent Bug Reports cards#79

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-video-bugs-not-showing
Open

Support video attachments in Recent Bug Reports cards#79
Copilot wants to merge 3 commits intomainfrom
copilot/fix-video-bugs-not-showing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

Bug cards in the "Recent Bug Reports" section showed a broken/empty thumbnail when the issue contained a video attachment. GitHub stores uploaded videos as bare URLs in issue bodies (not ![alt](url) syntax), which extractFirstImage never matched.

Changes

  • js/app.js — Renamed extractFirstImageextractFirstMedia; returns { image_url, is_video }. Detection priority:

    1. Markdown image ![alt](url) → image
    2. HTML <img src> → image
    3. HTML <video src> / <source src> → video
    4. Bare https://github.com/user-attachments/assets/<uuid> → video
  • renderRecentBugs — Renders a <video muted autoplay loop playsinline controls> element when bug.is_video is true; falls back to <img> otherwise.

  • .github/workflows/update-and-deploy.yml — Mirrors the same extractFirstMedia logic and conditional <video> / <img> output in the SSR pre-render step.

  • data/leaderboard.json / index.html inline data — Added is_video: false to existing bug entries for consistency.

// Plain GitHub video upload — previously returned null, now detected
const plainVideoMatch = body.match(/(https?:\/\/github\.com\/user-attachments\/assets\/[a-zA-Z0-9-]+)/);
if (plainVideoMatch) return { image_url: plainVideoMatch[1], is_video: true };

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.tailwindcss.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl github.com (dns block)
  • www.google.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl (dns block)
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl github.com (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] video bugs are not showing up</issue_title>
<issue_description>### URL

https://owaspblt.org/

Description

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Add extractFirstMedia() to detect plain GitHub video URLs
- Render video URLs with <video> element instead of <img>
- Update SSR rendering in workflow to handle video bug reports
- Add is_video field to leaderboard.json and inline data

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix video bugs not showing up on the site Support video attachments in Recent Bug Reports cards Mar 7, 2026
@github-actions github-actions bot added the unresolved-conversations: 0 PR has 0 unresolved conversations label Mar 8, 2026
@DonnieBLT DonnieBLT marked this pull request as ready for review March 13, 2026 01:13
Copilot AI review requested due to automatic review settings March 13, 2026 01:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for rendering attached videos (not just images) in the “Recent Bugs” cards, and attempts to propagate this through the generated leaderboard payload / SSR pipeline.

Changes:

  • Replace extractFirstImage() with extractFirstMedia() and render <video> when is_video is true (client-side recent bugs).
  • Update generated leaderboard artifacts to include an is_video field on recent_bugs.
  • Add large new inline generation/SSR logic to the GitHub Actions workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
js/app.js Extract first media (image/video) from issue bodies and render videos in Recent Bugs cards.
index.html Updates embedded window.__BLT_LEADERBOARD__ inline JSON payload.
data/leaderboard.json Updates recent bug entries (adds is_video, alters latest_comment).
.github/workflows/update-and-deploy.yml Introduces new media extraction + SSR/payload generation logic inside the workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 162 to +169
if (i < 3) execSync(`sleep ${i * 5}`, { shell: true });
}
}
}
const topCommenters = Object.entries(commentCounts)
.sort(([, a], [, b]) => b.count - a.count)
.slice(0, 20)
.map(([login, data], idx) => ({
Comment on lines 362 to 364
if (!pushSucceeded) {
throw new Error('Failed to push updated leaderboard after 3 attempts');
}
Comment thread index.html
</footer>

<script id="leaderboard-inline-data">window.__BLT_LEADERBOARD__ = {"updated_at": "2026-03-11T08:09:57.542711Z", "commit_sha": "5f54f2b071dc555e66e500b6e75021f49fbdef62", "total_bugs": 17, "open_bugs": 4, "closed_bugs": 13, "total_domains": 4, "total_orgs": 0, "leaderboard": [{"rank": 1, "login": "DonnieBLT", "count": 11, "avatar_url": "https://avatars.githubusercontent.com/u/128622481?v=4", "profile_url": "https://github.com/DonnieBLT"}, {"rank": 2, "login": "ananya-09", "count": 3, "avatar_url": "https://avatars.githubusercontent.com/u/175581593?v=4", "profile_url": "https://github.com/ananya-09"}, {"rank": 3, "login": "Nachiket-Roy", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/204239697?v=4", "profile_url": "https://github.com/Nachiket-Roy"}, {"rank": 4, "login": "kittenbytes", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/171991749?v=4", "profile_url": "https://github.com/kittenbytes"}, {"rank": 5, "login": "sidd190", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/73955358?v=4", "profile_url": "https://github.com/sidd190"}], "top_commenters": [{"rank": 1, "login": "DonnieBLT", "count": 3, "avatar_url": "https://avatars.githubusercontent.com/u/128622481?v=4", "profile_url": "https://github.com/DonnieBLT"}, {"rank": 2, "login": "mdkaifansari04", "count": 3, "avatar_url": "https://avatars.githubusercontent.com/u/117475603?v=4", "profile_url": "https://github.com/mdkaifansari04"}, {"rank": 3, "login": "Shubhangpathak", "count": 2, "avatar_url": "https://avatars.githubusercontent.com/u/147265305?v=4", "profile_url": "https://github.com/Shubhangpathak"}, {"rank": 4, "login": "Nachiket-Roy", "count": 2, "avatar_url": "https://avatars.githubusercontent.com/u/204239697?v=4", "profile_url": "https://github.com/Nachiket-Roy"}, {"rank": 5, "login": "ananya-09", "count": 2, "avatar_url": "https://avatars.githubusercontent.com/u/175581593?v=4", "profile_url": "https://github.com/ananya-09"}, {"rank": 6, "login": "sidd190", "count": 2, "avatar_url": "https://avatars.githubusercontent.com/u/73955358?v=4", "profile_url": "https://github.com/sidd190"}, {"rank": 7, "login": "azizrebhi", "count": 2, "avatar_url": "https://avatars.githubusercontent.com/u/154744962?v=4", "profile_url": "https://github.com/azizrebhi"}, {"rank": 8, "login": "e-esakman", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/187769872?v=4", "profile_url": "https://github.com/e-esakman"}, {"rank": 9, "login": "tiggachris", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/169353352?v=4", "profile_url": "https://github.com/tiggachris"}, {"rank": 10, "login": "akhileshjadhav-coder", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/226160161?v=4", "profile_url": "https://github.com/akhileshjadhav-coder"}, {"rank": 11, "login": "yogeshwarithombare", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/247213611?v=4", "profile_url": "https://github.com/yogeshwarithombare"}, {"rank": 12, "login": "Armaansaxena", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/143505186?v=4", "profile_url": "https://github.com/Armaansaxena"}, {"rank": 13, "login": "swaparup36", "count": 1, "avatar_url": "https://avatars.githubusercontent.com/u/82692857?v=4", "profile_url": "https://github.com/swaparup36"}], "top_domains": [{"rank": 1, "domain": "owaspblt.org", "count": 11}, {"rank": 2, "domain": "www.owasp.community", "count": 3}, {"rank": 3, "domain": "github.com", "count": 2}, {"rank": 4, "domain": "www.owaspblt.org", "count": 1}], "recent_bugs": [{"number": 87, "title": "[BUG] open / closed count is not showing correct open counts", "html_url": "https://github.com/OWASP-BLT/BLT-Pages/issues/87", "created_at": "2026-03-11T08:09:43Z", "comment_count": 1, "user": {"login": "DonnieBLT", "avatar_url": "https://avatars.githubusercontent.com/u/128622481?v=4", "profile_url": "https://github.com/DonnieBLT"}, "image_url": "https://github.com/user-attachments/assets/5730ec94-d7c8-4c49-ab5c-f8bdf9493486", "domain": "github.com", "reactions": {"eyes": 1}, "latest_comment": {"body": "\ud83d\udc4b Thanks for opening this issue, @DonnieBLT!\n\nOur team will review it shortly. In the meantime:\n- If you'd like to work on this issue, comment `/assign` to get assigned.\n- Visit [OWASP BLT](https://owaspblt.org) for more information about our bug bounty platform.\n", "created_at": "2026-03-11T08:09:46Z", "html_url": "https://github.com/OWASP-BLT/BLT-Pages/issues/87#issuecomment-4037299535", "user": {"login": "owasp-blt[bot]", "avatar_url": "https://avatars.githubusercontent.com/in/1159228?v=4", "profile_url": "https://github.com/apps/owasp-blt"}}}, {"number": 81, "title": "[BUG] whole div \"Chapters\", should be clickable and remove test data", "html_url": "https://github.com/OWASP-BLT/BLT-Pages/issues/81", "created_at": "2026-03-08T23:31:51Z", "comment_count": 7, "user": {"login": "DonnieBLT", "avatar_url": "https://avatars.githubusercontent.com/u/128622481?v=4", "profile_url": "https://github.com/DonnieBLT"}, "image_url": "https://github.com/user-attachments/assets/90330d80-7329-4058-941a-4b50b831d9cf", "domain": "www.owasp.community", "reactions": {"eyes": 1}, "latest_comment": {"body": "@tiggachris This issue already has the maximum number of assignees (1). Please work on a different issue.", "created_at": "2026-03-11T06:13:06Z", "html_url": "https://github.com/OWASP-BLT/BLT-Pages/issues/81#issuecomment-4036768843", "user": {"login": "owasp-blt[bot]", "avatar_url": "https://avatars.githubusercontent.com/in/1159228?v=4", "profile_url": "https://github.com/apps/owasp-blt"}}}, {"number": 17, "title": "[BUG] video bugs are not showing up", "html_url": "https://github.com/OWASP-BLT/BLT-Pages/issues/17", "created_at": "2026-03-02T20:50:49Z", "comment_count": 2, "user": {"login": "DonnieBLT", "avatar_url": "https://avatars.githubusercontent.com/u/128622481?v=4", "profile_url": "https://github.com/DonnieBLT"}, "image_url": "https://github.com/user-attachments/assets/6c188f2b-5aab-4aad-94f3-d7c540518d45", "domain": "owaspblt.org", "reactions": {"+1": 1, "eyes": 1}, "latest_comment": {"body": "Issues aren't particularly assigned here as such. You can directly raise a PR if the copilot one is not in the ready to merge zone yet. If it is, then that'll probably get merged.", "created_at": "2026-03-10T16:49:17Z", "html_url": "https://github.com/OWASP-BLT/BLT-Pages/issues/17#issuecomment-4032926080", "user": {"login": "sidd190", "avatar_url": "https://avatars.githubusercontent.com/u/73955358?v=4", "profile_url": "https://github.com/sidd190"}}}]};</script>
<script id="leaderboard-inline-data">window.__BLT_LEADERBOARD__ = {"updated_at":"2026-03-07T21:29:03.001Z","commit_sha":"00d76c3d5f5aaaf0de2413c82c7636936499ab9e","total_bugs":14,"open_bugs":3,"closed_bugs":11,"total_domains":3,"total_orgs":0,"leaderboard":[{"rank":1,"login":"DonnieBLT","count":8,"avatar_url":"https://avatars.githubusercontent.com/u/128622481?v=4","profile_url":"https://github.com/DonnieBLT"},{"rank":2,"login":"ananya-09","count":3,"avatar_url":"https://avatars.githubusercontent.com/u/175581593?v=4","profile_url":"https://github.com/ananya-09"},{"rank":3,"login":"Nachiket-Roy","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/204239697?v=4","profile_url":"https://github.com/Nachiket-Roy"},{"rank":4,"login":"kittenbytes","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/171991749?v=4","profile_url":"https://github.com/kittenbytes"},{"rank":5,"login":"sidd190","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/73955358?v=4","profile_url":"https://github.com/sidd190"}],"top_commenters":[{"rank":1,"login":"mdkaifansari04","count":3,"avatar_url":"https://avatars.githubusercontent.com/u/117475603?v=4","profile_url":"https://github.com/mdkaifansari04"},{"rank":2,"login":"ananya-09","count":2,"avatar_url":"https://avatars.githubusercontent.com/u/175581593?v=4","profile_url":"https://github.com/ananya-09"},{"rank":3,"login":"azizrebhi","count":2,"avatar_url":"https://avatars.githubusercontent.com/u/154744962?v=4","profile_url":"https://github.com/azizrebhi"},{"rank":4,"login":"Nachiket-Roy","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/204239697?v=4","profile_url":"https://github.com/Nachiket-Roy"},{"rank":5,"login":"sidd190","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/73955358?v=4","profile_url":"https://github.com/sidd190"},{"rank":6,"login":"yogeshwarithombare","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/247213611?v=4","profile_url":"https://github.com/yogeshwarithombare"},{"rank":7,"login":"Armaansaxena","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/143505186?v=4","profile_url":"https://github.com/Armaansaxena"},{"rank":8,"login":"swaparup36","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/82692857?v=4","profile_url":"https://github.com/swaparup36"},{"rank":9,"login":"DonnieBLT","count":1,"avatar_url":"https://avatars.githubusercontent.com/u/128622481?v=4","profile_url":"https://github.com/DonnieBLT"}],"top_domains":[{"rank":1,"domain":"owaspblt.org","count":11},{"rank":2,"domain":"www.owasp.community","count":2},{"rank":3,"domain":"github.com","count":1}],"recent_bugs":[{"number":17,"title":"[BUG] video bugs are not showing up","html_url":"https://github.com/OWASP-BLT/BLT-Pages/issues/17","created_at":"2026-03-02T20:50:49Z","comment_count":0,"user":{"login":"DonnieBLT","avatar_url":"https://avatars.githubusercontent.com/u/128622481?v=4","profile_url":"https://github.com/DonnieBLT"},"image_url":"https://github.com/user-attachments/assets/6c188f2b-5aab-4aad-94f3-d7c540518d45","domain":"owaspblt.org","reactions":{"+1":1},"latest_comment":null,"is_video":false},{"number":8,"title":"[BUG] join chapter button does not work","html_url":"https://github.com/OWASP-BLT/BLT-Pages/issues/8","created_at":"2026-03-01T08:40:35Z","comment_count":3,"user":{"login":"DonnieBLT","avatar_url":"https://avatars.githubusercontent.com/u/128622481?v=4","profile_url":"https://github.com/DonnieBLT"},"image_url":"https://github.com/user-attachments/assets/1d38827d-5518-4f68-b37c-19294f0dcf3c","domain":"www.owasp.community","reactions":{},"latest_comment":{"body":"@Armaansaxena @yogeshwarithombare any of you working on this?","created_at":"2026-03-04T17:04:20Z","html_url":"https://github.com/OWASP-BLT/BLT-Pages/issues/8#issuecomment-3998884616","user":{"login":"swaparup36","avatar_url":"https://avatars.githubusercontent.com/u/82692857?v=4","profile_url":"https://github.com/swaparup36"}},"is_video":false},{"number":6,"title":"[BUG] page always shows loading screen even though it\u2019s loaded before","html_url":"https://github.com/OWASP-BLT/BLT-Pages/issues/6","created_at":"2026-03-01T07:04:11Z","comment_count":3,"user":{"login":"DonnieBLT","avatar_url":"https://avatars.githubusercontent.com/u/128622481?v=4","profile_url":"https://github.com/DonnieBLT"},"image_url":"https://github.com/user-attachments/assets/33a6854c-605f-464c-be62-5c9bd724edcd","domain":"www.owasp.community","reactions":{},"latest_comment":{"body":"Hi @DonnieBLT ! I'd like to work on this issue.\nI'll try reproducing the bug locally and investigate why the loading screen persists after refresh.","created_at":"2026-03-02T08:27:34Z","html_url":"https://github.com/OWASP-BLT/BLT-Pages/issues/6#issuecomment-3982889169","user":{"login":"azizrebhi","avatar_url":"https://avatars.githubusercontent.com/u/154744962?v=4","profile_url":"https://github.com/azizrebhi"}},"is_video":false}]};</script>
Comment thread data/leaderboard.json
"profile_url": "https://github.com/apps/owasp-blt"
}
}
"latest_comment": null,
Comment thread js/app.js
? `<div class="aspect-video bg-gray-100 dark:bg-gray-800 rounded-xl mb-4 overflow-hidden flex-shrink-0">
<video src="${escapeHtml(bug.image_url)}"
class="w-full h-full object-cover"
muted autoplay loop playsinline controls
Comment on lines +177 to +193
// Extract first media (image or video) URL from an issue body (markdown or HTML)
function extractFirstMedia(body) {
if (!body) return { image_url: null, is_video: false };
// Markdown image: ![alt](url)
const mdImgMatch = body.match(/!\[.*?\]\((https?:\/\/[^\s)]+)\)/);
if (mdImgMatch) return { image_url: mdImgMatch[1], is_video: false };
// HTML img tag: <img src="url">
const htmlImgMatch = body.match(/<img[^>]+src=["'](https?:\/\/[^\s"']+)["']/i);
if (htmlImgMatch) return { image_url: htmlImgMatch[1], is_video: false };
// HTML video tag: <video src="url"> or <source src="url">
const htmlVideoMatch = body.match(/<(?:video|source)[^>]+src=["'](https?:\/\/[^\s"']+)["']/i);
if (htmlVideoMatch) return { image_url: htmlVideoMatch[1], is_video: true };
// Plain GitHub user-attachments URL (video uploaded to GitHub issue)
const plainVideoMatch = body.match(/(https?:\/\/github\.com\/user-attachments\/assets\/[a-zA-Z0-9-]+)/);
if (plainVideoMatch) return { image_url: plainVideoMatch[1], is_video: true };
return { image_url: null, is_video: false };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unresolved-conversations: 0 PR has 0 unresolved conversations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] video bugs are not showing up

3 participants