filter out internal issues#940
Conversation
WalkthroughA new middleware function, Changes
Sequence Diagram(s)sequenceDiagram
participant Req as Request
participant EIR as extractIssuesFromResults
participant FII as filterOutInternalIssues
participant AQC as addQualityCriteriaLevelsToIssues
Req->>EIR: Process issues extraction
EIR->>FII: Forward issues for filtering
FII->>AQC: Pass filtered issues along
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/controllers/resultsController.js (1)
196-200: Clean implementation of the filtering middleware.The implementation is succinct and follows the established middleware pattern in this file. It correctly filters out issues where the responsibility is "internal" before they can be processed further in the middleware chain.
One minor suggestion for defensive programming:
export function filterOutInternalIssues (req, res, next) { - const { issues } = req - req.issues = issues.filter(issue => issue.responsibility !== 'internal') + const { issues = [] } = req + req.issues = Array.isArray(issues) ? issues.filter(issue => issue.responsibility !== 'internal') : [] next() }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/controllers/resultsController.js(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
🔇 Additional comments (2)
src/controllers/resultsController.js (2)
29-29: Good addition of the new middleware.The placement of the
filterOutInternalIssuesmiddleware is correct, positioned betweenextractIssuesFromResultsandaddQualityCriteriaLevelsToIssues. This ensures internal issues are filtered out at the appropriate point in the middleware chain.
254-263: Consistent with documented behavior.The comment confirms that the new filtering middleware aligns with the existing code logic, as it mentions that issues with responsibility set to "internal" should be excluded from results. The new middleware makes this filtering explicit rather than relying solely on the quality criteria level check.
Preview Link
https://submit-pr-[PR_NUMBER].herokuapp.com/
What type of PR is this? (check all applicable)
Description
correctly filter out issues of responsibility internal before generating the task list
QA Instructions, Screenshots, Recordings
Before
Before screenshot here
After
After screenshot here
Added/updated tests?
We encourage you to keep the code coverage percentage at 80% and above.
QA sign off
[optional] Are there any post-deployment tasks we need to perform?
[optional] Are there any dependencies on other PRs or Work?
Summary by CodeRabbit