-
Notifications
You must be signed in to change notification settings - Fork 1
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
682 dataset task list fetch data from all active resources #717
682 dataset task list fetch data from all active resources #717
Conversation
Warning Rate limit exceeded@GeorgeGoodall-GovUk has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 6 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis pull request introduces significant modifications to middleware and utility files, focusing on enhancing issue tracking and resource management. The changes primarily involve restructuring functions in Changes
Sequence DiagramsequenceDiagram
participant MW as Middleware
participant DB as Database
participant Service as Performance DB API
participant Utils as Utils
MW->>Utils: Import entryIssueGroups
MW->>DB: Fetch Entry Issues
DB-->>MW: Return Entry Issues
MW->>Service: Get Task Message
Service-->>MW: Generate Task List
MW->>MW: Prepare Template Params
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
|
…set-task-list-fetch-data-from-all-active-resources
…set-task-list-fetch-data-from-all-active-resources
got the tasklist page working with all active endpoints
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/middleware/datasetTaskList.middleware.js (1)
67-72
: Consider using type-safe null checks.The current filtering logic could be more robust by using type-safe null checks.
- issue => issue.issue_type !== '' && - issue.issue_type !== undefined && - issue.field !== '' && - issue.field !== undefined + issue => Boolean(issue.issue_type?.trim()) && Boolean(issue.field?.trim())
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/middleware/datasetTaskList.middleware.js
(4 hunks)src/middleware/entryIssueDetails.middleware.js
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: run-tests / test
🔇 Additional comments (7)
src/middleware/entryIssueDetails.middleware.js (3)
2-2
: LGTM! Import changes align with PR objectives.The addition of
fetchEntryIssues
to the imports is consistent with the refactoring goals to update how entry issues are fetched.
64-76
: LGTM! Robust error handling improvements.The changes enhance error handling in two ways:
- Comprehensive checks for missing values with appropriate 404 status
- Validation of entry issue structure with appropriate 500 status
This makes the middleware more resilient and helps with debugging.
131-131
: LGTM! Middleware sequence is correct.The addition of
fetchEntryIssues
in the middleware pipeline is appropriately placed before pagination checks.src/middleware/datasetTaskList.middleware.js (4)
2-8
: LGTM! Well-structured imports and constant definition.The updated imports and the extraction of
SPECIAL_ISSUE_TYPES
into a constant improve code maintainability and readability.Also applies to: 41-41
44-57
: LGTM! Excellent documentation.The JSDoc documentation is thorough and clearly describes the function's purpose, parameters, and requirements.
103-103
: LGTM! Secure URL parameter handling.Proper use of
encodeURIComponent
for all URL parameters prevents potential injection vulnerabilities.Also applies to: 115-115
153-161
: LGTM! Well-structured middleware pipeline.The middleware sequence is logically ordered, with entity and entry issue fetching appropriately placed after resource processing.
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.
Actionable comments posted: 2
♻️ Duplicate comments (4)
src/middleware/common.middleware.js (4)
412-425
:⚠️ Potential issueFix multiple SQL injection vulnerabilities.
The query has multiple SQL injection vulnerabilities due to string interpolation of user inputs.
Apply this diff to use parameterised queries:
query: ({ req, params }) => { - const issueTypeClause = params.issue_type ? `AND i.issue_type = '${params.issue_type}'` : '' - const issueFieldClause = params.issue_field ? `AND field = '${params.issue_field}'` : '' + const values = [req.resources[0].resource] + let paramCount = 2 + const clauses = [] + + if (params.issue_type) { + clauses.push(`AND i.issue_type = $${paramCount++}`) + values.push(params.issue_type) + } + if (params.issue_field) { + clauses.push(`AND field = $${paramCount++}`) + values.push(params.issue_field) + } + + values.push(req.params.dataset) + + return { + text: ` select i.issue_type, field, entity, message, severity, value from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource = '${req.resources[0].resource}' + WHERE resource = $1 + ${clauses.join(' ')} AND it.responsibility = 'external' AND it.severity = 'error' - AND i.dataset = '${req.params.dataset}' + AND i.dataset = $${paramCount} AND entity != '' - ` + `, + values + }
505-525
:⚠️ Potential issueFix multiple SQL injection vulnerabilities.
The query has multiple SQL injection vulnerabilities due to string interpolation of user inputs.
Apply this diff to use parameterised queries:
query: ({ req, params }) => { - const issueTypeClause = params.issue_type ? `AND i.issue_type = '${params.issue_type}'` : '' - const issueFieldClause = params.issue_field ? `AND field = '${params.issue_field}'` : '' + const values = [req.resources[0].resource, req.params.dataset] + let paramCount = 3 + const clauses = [] + + if (params.issue_type) { + clauses.push(`AND i.issue_type = $${paramCount++}`) + values.push(params.issue_type) + } + if (params.issue_field) { + clauses.push(`AND field = $${paramCount++}`) + values.push(params.issue_field) + } + + values.push(entryIssueGroups.map(issue => issue.type)) + values.push(req.dataRange.pageLength) + values.push(req.dataRange.offset) + + return { + text: ` select i.issue_type, field, entity, message, severity, value, line_number from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource = '${req.resources[0].resource}' + WHERE resource = $1 ${issueTypeClause} AND it.responsibility = 'external' AND it.severity = 'error' - AND i.dataset = '${req.params.dataset}' + AND i.dataset = $2 ${issueFieldClause} - AND (entity = '' OR entity is NULL OR i.issue_type in ('${entryIssueGroups.map(issue => issue.type).join("', '")}')) - LIMIT ${req.dataRange.pageLength} OFFSET ${req.dataRange.offset} - ` + AND (entity = '' OR entity is NULL OR i.issue_type = ANY($${paramCount++}::text[])) + LIMIT $${paramCount++} OFFSET $${paramCount} + `, + values + }
527-543
:⚠️ Potential issueFix SQL injection vulnerabilities and string concatenation.
The query has multiple issues:
- SQL injection vulnerabilities due to string interpolation
- Incorrect string concatenation in COUNT
Apply this diff to fix both issues:
query: ({ req }) => { - const datasetClause = req.params.dataset ? `AND i.dataset = '${req.params.dataset}'` : '' + const values = [req.resources.map(resource => resource.resource)] + let paramCount = 2 + const clauses = [] + + if (req.params.dataset) { + clauses.push(`AND i.dataset = $${paramCount++}`) + values.push(req.params.dataset) + } + + return { + text: ` - select dataset, field, i.issue_type, COUNT(resource+line_number) as count + select dataset, field, i.issue_type, COUNT(resource || line_number) as count from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource in ('${req.resources.map(resource => resource.resource).join("', '")}') + WHERE resource = ANY($1::text[]) AND (entity != '' AND entity IS NOT NULL) AND it.responsibility = 'external' AND it.severity = 'error' - ${datasetClause} + ${clauses.join(' ')} GROUP BY field, i.issue_type, dataset - ` + `, + values + }
556-577
:⚠️ Potential issueFix SQL injection vulnerabilities and string concatenation.
The query has multiple issues:
- SQL injection vulnerabilities due to string interpolation
- Incorrect string concatenation in COUNT
Apply this diff to fix both issues:
query: ({ req }) => { - const datasetClause = req.params.dataset ? `AND i.dataset = '${req.params.dataset}'` : '' + const values = [] + let paramCount = 1 + const clauses = [] + + if (req.params.dataset) { + clauses.push(`AND i.dataset = $${paramCount++}`) + values.push(req.params.dataset) + } const mostRecentResources = getMostRecentResources(req.resources) const resourceIds = Object.values(mostRecentResources).map(resource => resource.resource) + values.push(resourceIds) - return ` + return { + text: ` - select dataset, field, i.issue_type, COUNT(resource + line_number) as count + select dataset, field, i.issue_type, COUNT(resource || line_number) as count from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource in ('${resourceIds.join("', '")}') + WHERE resource = ANY($${paramCount}::text[]) AND (entity = '' OR entity is NULL) AND it.responsibility = 'external' AND it.severity = 'error' - ${datasetClause} + ${clauses.join(' ')} GROUP BY field, i.issue_type, dataset - ` + `, + values + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/middleware/common.middleware.js
(7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: run-tests / test
🔇 Additional comments (3)
src/middleware/common.middleware.js (3)
4-4
: LGTM!The import statement is correctly placed and the imported utility is used appropriately in the code.
219-222
: LGTM! Error handling follows best practices.The error handling is well-implemented with:
- Proper error logging with type and stack trace
- Error propagation to the next middleware
- Correct error object destructuring for logging
Also applies to: 230-231
545-553
: LGTM! Correct implementation of date comparison.The function correctly:
- Uses
Date.getTime()
for comparing dates- Efficiently maps resources to their datasets
- Returns the most recent resources
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/middleware/entryIssueDetails.middleware.js (1)
72-76
: Consider enhancing error messages and validation.The error handling could be improved in two ways:
- Provide more specific error messages indicating which validation failed
- Move the validation to a valibot schema for consistency with
IssueDetailsQueryParams
Consider this approach:
+ const EntryIssueSchema = v.object({ + entry_number: v.optional(v.string()), + entity: v.optional(v.string()), + issue_type: v.string(), + line_number: v.number(), + }) const issue = entryIssues[0] - if (!(issue.entry_number || issue.entity) || !issue.issue_type || typeof issue.line_number !== 'number') { - const error = new Error('Invalid entry issue structure') - error.status = 500 - return next(error) - } + try { + v.parse(EntryIssueSchema, issue) + } catch (validationError) { + const error = new Error(`Invalid entry issue structure: ${validationError.message}`) + error.status = 500 + return next(error) + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/middleware/entryIssueDetails.middleware.js
(3 hunks)
🔇 Additional comments (3)
src/middleware/entryIssueDetails.middleware.js (3)
2-2
: LGTM! Import changes align with PR objectives.The addition of
fetchEntryIssues
to the imports is consistent with the PR's goal to update dataset task list functionality.
64-68
: LGTM! Robust input validation.The validation properly checks for both empty arrays and undefined values, providing better error handling than the previous implementation.
131-131
: LGTM! Correct placement in middleware chain.The
fetchEntryIssues
middleware is properly positioned after data range setup and before pagination validation.
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.
Looks good!
…set-task-list-fetch-data-from-all-active-resources
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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/middleware/entryIssueDetails.middleware.js (1)
75-81
: Enhance error message with validation details.While the validation is good, the error message could be more specific about which properties failed validation.
- const error = new Error('Invalid entry issue structure') + const error = new Error(`Invalid entry issue structure: missing required properties. Got: ${JSON.stringify({ + has_entry: Boolean(issue.entry_number || issue.entity), + has_issue_type: Boolean(issue.issue_type), + has_valid_line: typeof issue.line_number === 'number' + })}`)src/middleware/common.middleware.js (1)
593-595
: Track technical debt: Optimise removeIssuesThatHaveBeenFixed.The comment indicates a performance issue that needs to be addressed in the future.
Would you like me to create a GitHub issue to track the optimisation of removeIssuesThatHaveBeenFixed?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/middleware/common.middleware.js
(7 hunks)src/middleware/entryIssueDetails.middleware.js
(3 hunks)src/services/datasette.js
(1 hunks)test/unit/middleware/common.middleware.test.js
(4 hunks)test/unit/middleware/entryIssueDetails.middleware.test.js
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/services/datasette.js
- test/unit/middleware/entryIssueDetails.middleware.test.js
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: run-tests / test
🔇 Additional comments (12)
src/middleware/entryIssueDetails.middleware.js (2)
63-70
: Well-structured error handling with detailed debugging information!The error handling provides clear context about which checks failed, making it easier to diagnose issues in production.
136-136
: Good placement of fetchEntryIssues in the middleware chain!The middleware is correctly positioned after pagination setup and before 404 checks.
src/middleware/common.middleware.js (9)
218-232
: Well-implemented error handling with proper logging!The error handling includes:
- Proper error propagation
- Detailed error logging with type and stack traces
- Null coalescing for entry_count
505-506
: Clear documentation of business logic!The comment clearly explains why we only fetch issues from the latest resource.
545-553
: Well-implemented date comparison logic!The function:
- Safely compares dates using getTime()
- Maintains a clean, functional approach
- Properly handles resource grouping by dataset
560-561
: Good use of getMostRecentResources function!The function correctly utilises getMostRecentResources to filter resources.
214-215
:⚠️ Potential issueFix SQL injection vulnerability in addEntityCountsToResources.
The query is vulnerable to SQL injection as it uses string interpolation for
resource.resource
.- const query = `SELECT entry_count FROM dataset_resource WHERE resource = "${resource.resource}"` + const query = { + text: 'SELECT entry_count FROM dataset_resource WHERE resource = $1', + values: [resource.resource] + }Likely invalid or redundant comment.
199-201
:⚠️ Potential issueFix SQL injection vulnerability in fetchResources.
The query is vulnerable to SQL injection as it uses string interpolation for
req.params.lpa
andreq.params.dataset
.- WHERE ro.organisation = '${req.params.lpa}' - AND rd.dataset = '${req.params.dataset}' + WHERE ro.organisation = $1 + AND rd.dataset = $2`, + values: [req.params.lpa, req.params.dataset]Likely invalid or redundant comment.
412-425
:⚠️ Potential issueFix multiple SQL injection vulnerabilities in fetchEntityIssuesForFieldAndType.
The query is vulnerable to SQL injection in multiple places.
- const issueTypeClause = params.issue_type ? `AND i.issue_type = '${params.issue_type}'` : '' - const issueFieldClause = params.issue_field ? `AND field = '${params.issue_field}'` : '' + const values = [req.resources[0].resource] + let paramCount = 2 + const clauses = [] + + if (params.issue_type) { + clauses.push(`AND i.issue_type = $${paramCount++}`) + values.push(params.issue_type) + } + if (params.issue_field) { + clauses.push(`AND field = $${paramCount++}`) + values.push(params.issue_field) + } + values.push(req.params.dataset) + + return { + text: ` select i.issue_type, field, entity, message, severity, value from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource = '${req.resources[0].resource}' - ${issueTypeClause} + WHERE resource = $1 + ${clauses.join(' ')} AND it.responsibility = 'external' AND it.severity = 'error' - ${issueFieldClause} - AND i.dataset = '${req.params.dataset}' + AND i.dataset = $${paramCount} AND entity != '' - ` + `, + values + }Likely invalid or redundant comment.
527-543
:⚠️ Potential issueFix SQL injection and string concatenation in fetchEntityIssueCounts.
The query has two issues:
- SQL injection vulnerabilities
- Incorrect string concatenation in COUNT
query: ({ req }) => { - const datasetClause = req.params.dataset ? `AND i.dataset = '${req.params.dataset}'` : '' + const values = [req.resources.map(resource => resource.resource)] + let paramCount = 2 + const clauses = [] + + if (req.params.dataset) { + clauses.push(`AND i.dataset = $${paramCount++}`) + values.push(req.params.dataset) + } + + return { + text: ` - select dataset, field, i.issue_type, COUNT(resource+line_number) as count + select dataset, field, i.issue_type, COUNT(resource || line_number) as count from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource in ('${req.resources.map(resource => resource.resource).join("', '")}') + WHERE resource = ANY($1::text[]) AND (entity != '' AND entity IS NOT NULL) AND it.responsibility = 'external' AND it.severity = 'error' - ${datasetClause} + ${clauses.join(' ')} GROUP BY field, i.issue_type, dataset - ` + `, + values + }Likely invalid or redundant comment.
556-577
:⚠️ Potential issueFix SQL injection and string concatenation in fetchEntryIssueCounts.
The query has two issues:
- SQL injection vulnerabilities
- Incorrect string concatenation in COUNT
query: ({ req }) => { - const datasetClause = req.params.dataset ? `AND i.dataset = '${req.params.dataset}'` : '' + const values = [] + let paramCount = 1 + const clauses = [] + + if (req.params.dataset) { + clauses.push(`AND i.dataset = $${paramCount++}`) + values.push(req.params.dataset) + } const mostRecentResources = getMostRecentResources(req.resources) const resourceIds = Object.values(mostRecentResources).map(resource => resource.resource) + values.push(resourceIds) - return ` + return { + text: ` - select dataset, field, i.issue_type, COUNT(resource + line_number) as count + select dataset, field, i.issue_type, COUNT(resource || line_number) as count from issue i LEFT JOIN issue_type it ON i.issue_type = it.issue_type - WHERE resource in ('${resourceIds.join("', '")}') + WHERE resource = ANY($${paramCount}::text[]) AND (entity = '' OR entity is NULL) AND it.responsibility = 'external' AND it.severity = 'error' - ${datasetClause} + ${clauses.join(' ')} GROUP BY field, i.issue_type, dataset - ` + `, + values + }Likely invalid or redundant comment.
test/unit/middleware/common.middleware.test.js (1)
Line range hint
1157-1228
: Well-structured tests with comprehensive coverage!The tests:
- Cover the parameter rename from entityCount to rowCount
- Include edge cases
- Validate the integration with performanceDbApi
query: ({ req, params }) => { | ||
const issueTypeClause = params.issue_type ? `AND i.issue_type = '${params.issue_type}'` : '' | ||
const issueFieldClause = params.issue_field ? `AND field = '${params.issue_field}'` : '' | ||
return ` | ||
select i.issue_type, field, entity, message, severity, value, line_number | ||
from issue i | ||
LEFT JOIN issue_type it ON i.issue_type = it.issue_type | ||
WHERE resource = '${req.resources[0].resource}' | ||
${issueTypeClause} | ||
AND it.responsibility = 'external' | ||
AND it.severity = 'error' | ||
AND i.dataset = '${req.params.dataset}' | ||
${issueFieldClause} | ||
AND (entity = '' OR entity is NULL OR i.issue_type in ('${entryIssueGroups.map(issue => issue.type).join("', '")}')) | ||
LIMIT ${req.dataRange.pageLength} OFFSET ${req.dataRange.offset} | ||
` |
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.
Fix SQL injection vulnerabilities in fetchEntryIssues.
The query is vulnerable to SQL injection in multiple places.
- const issueTypeClause = params.issue_type ? `AND i.issue_type = '${params.issue_type}'` : ''
- const issueFieldClause = params.issue_field ? `AND field = '${params.issue_field}'` : ''
+ const values = [req.resources[0].resource]
+ let paramCount = 2
+ const clauses = []
+
+ if (params.issue_type) {
+ clauses.push(`AND i.issue_type = $${paramCount++}`)
+ values.push(params.issue_type)
+ }
+ if (params.issue_field) {
+ clauses.push(`AND field = $${paramCount++}`)
+ values.push(params.issue_field)
+ }
+ values.push(req.params.dataset)
+ values.push(entryIssueGroups.map(issue => issue.type))
+ values.push(req.dataRange.pageLength)
+ values.push(req.dataRange.offset)
+
+ return {
+ text: `
select i.issue_type, field, entity, message, severity, value, line_number
from issue i
LEFT JOIN issue_type it ON i.issue_type = it.issue_type
- WHERE resource = '${req.resources[0].resource}'
- ${issueTypeClause}
+ WHERE resource = $1
+ ${clauses.join(' ')}
AND it.responsibility = 'external'
AND it.severity = 'error'
- AND i.dataset = '${req.params.dataset}'
- ${issueFieldClause}
- AND (entity = '' OR entity is NULL OR i.issue_type in ('${entryIssueGroups.map(issue => issue.type).join("', '")}'))
- LIMIT ${req.dataRange.pageLength} OFFSET ${req.dataRange.offset}
+ AND i.dataset = $${paramCount++}
+ AND (entity = '' OR entity is NULL OR i.issue_type = ANY($${paramCount++}::text[]))
+ LIMIT $${paramCount++} OFFSET $${paramCount}
+ `,
+ values
+ }
📝 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.
query: ({ req, params }) => { | |
const issueTypeClause = params.issue_type ? `AND i.issue_type = '${params.issue_type}'` : '' | |
const issueFieldClause = params.issue_field ? `AND field = '${params.issue_field}'` : '' | |
return ` | |
select i.issue_type, field, entity, message, severity, value, line_number | |
from issue i | |
LEFT JOIN issue_type it ON i.issue_type = it.issue_type | |
WHERE resource = '${req.resources[0].resource}' | |
${issueTypeClause} | |
AND it.responsibility = 'external' | |
AND it.severity = 'error' | |
AND i.dataset = '${req.params.dataset}' | |
${issueFieldClause} | |
AND (entity = '' OR entity is NULL OR i.issue_type in ('${entryIssueGroups.map(issue => issue.type).join("', '")}')) | |
LIMIT ${req.dataRange.pageLength} OFFSET ${req.dataRange.offset} | |
` | |
query: ({ req, params }) => { | |
const values = [req.resources[0].resource] | |
let paramCount = 2 | |
const clauses = [] | |
if (params.issue_type) { | |
clauses.push(`AND i.issue_type = $${paramCount++}`) | |
values.push(params.issue_type) | |
} | |
if (params.issue_field) { | |
clauses.push(`AND field = $${paramCount++}`) | |
values.push(params.issue_field) | |
} | |
values.push(req.params.dataset) | |
values.push(entryIssueGroups.map(issue => issue.type)) | |
values.push(req.dataRange.pageLength) | |
values.push(req.dataRange.offset) | |
return { | |
text: ` | |
select i.issue_type, field, entity, message, severity, value, line_number | |
from issue i | |
LEFT JOIN issue_type it ON i.issue_type = it.issue_type | |
WHERE resource = $1 | |
${clauses.join(' ')} | |
AND it.responsibility = 'external' | |
AND it.severity = 'error' | |
AND i.dataset = $${paramCount++} | |
AND (entity = '' OR entity is NULL OR i.issue_type = ANY($${paramCount++}::text[])) | |
LIMIT $${paramCount++} OFFSET $${paramCount} | |
`, | |
values | |
} |
What type of PR is this? (check all applicable)
Description
Updates the dataset task list to look at all active resources when looking at entity issues and only the latest resource when looking at entry issues
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
no styling or changes should be present. however the data we are fetching should be different.
Before:
After:
Added/updated tests?
We encourage you to keep the code coverage percentage at 80% and above.
QA sign off
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Refactoring
Documentation
These changes enhance the application's ability to track, manage, and report issues more effectively, with a focus on improving data entry and task management processes.