-
Notifications
You must be signed in to change notification settings - Fork 2
Issue Queue Pool #35
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
Issue Queue Pool #35
Conversation
Signed-off-by: Sachin Panayil <sachinpanayil01@gmail.com>
| return; | ||
| } | ||
|
|
||
| issuesGrid.innerHTML = filteredIssues.map(createIssueCard).join(''); |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix the issue, all dynamic data used in createIssueCard must be sanitized using the escapeHtml function or equivalent contextual escaping. Specifically:
- Ensure that
typeTagselements are sanitized before being concatenated and injected into the DOM. - Sanitize
issue.urlbefore using it in the<a>tag'shrefattribute. - Replace
issuesGrid.innerHTMLwith safer methods liketextContentorappendChildwhere possible, or ensure all data is sanitized before usinginnerHTML.
-
Copy modified line R171 -
Copy modified line R173 -
Copy modified lines R176-R179 -
Copy modified line R185 -
Copy modified line R199
| @@ -170,11 +170,11 @@ | ||
| if (issue.isOpen) { | ||
| typeTags.push('<span class="usa-tag usa-tag--success">Open</span>'); | ||
| typeTags.push(escapeHtml('<span class="usa-tag usa-tag--success">Open</span>')); | ||
| } else { | ||
| typeTags.push('<span class="usa-tag">Closed</span>'); | ||
| typeTags.push(escapeHtml('<span class="usa-tag">Closed</span>')); | ||
| } | ||
|
|
||
| if (issue.isBug) typeTags.push('<span class="usa-tag usa-tag--error">Bug</span>'); | ||
| if (issue.isFeature) typeTags.push('<span class="usa-tag usa-tag--info">Feature</span>'); | ||
| if (issue.needsHelp) typeTags.push('<span class="usa-tag usa-tag--accent-warm">Help Wanted</span>'); | ||
| if (issue.isBeginner) typeTags.push('<span class="usa-tag usa-tag--accent-cool">Good First Issue</span>'); | ||
| if (issue.isBug) typeTags.push(escapeHtml('<span class="usa-tag usa-tag--error">Bug</span>')); | ||
| if (issue.isFeature) typeTags.push(escapeHtml('<span class="usa-tag usa-tag--info">Feature</span>')); | ||
| if (issue.needsHelp) typeTags.push(escapeHtml('<span class="usa-tag usa-tag--accent-warm">Help Wanted</span>')); | ||
| if (issue.isBeginner) typeTags.push(escapeHtml('<span class="usa-tag usa-tag--accent-cool">Good First Issue</span>')); | ||
|
|
||
| @@ -184,3 +184,3 @@ | ||
| <h3 class="margin-top-0 margin-bottom-1"> | ||
| <a href="${issue.url}" target="_blank" rel="noopener noreferrer" class="usa-link"> | ||
| <a href="${escapeHtml(issue.url)}" target="_blank" rel="noopener noreferrer" class="usa-link"> | ||
| ${escapeHtml(issue.title || 'Untitled Issue')} | ||
| @@ -198,3 +198,3 @@ | ||
| <div class="font-body-xs text-base-dark"> | ||
| ${issue.commentCount || 0} comments • | ||
| ${escapeHtml(issue.commentCount || 0)} comments • | ||
| Created ${formatDate(issue.createdDate)} • |
decause-gov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1 🚢
Let's see how it looks!
Issue Queue Pool
Problem
code.gov originally had an issue pool tracker where users can track issues from federal repos that opt in via a specific set of labels.
Solution
This branch tracks the recreation of that tool.
Result
Issue Queue Pool will be back up and running. Below will be a checklist of things that need to be accomplished regarding this task.
Checklist
code-govlabelsNotes
Test Plan
Test this locally via web browser and by running scripts using
nodeor GH Actions