Skip to content
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

Add QA Custom broker data to broker scan results #5359

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

codemist
Copy link
Collaborator

@codemist codemist commented Dec 3, 2024

References:

Jira: MNTOR-
Figma:

Description

Screenshot (if applicable)

Not applicable.

How to test

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

Comment on lines +414 to +424
const qaToggles = await getQaToggleRow(onerepProfileId);
let showCustomBrokers = false;
let showRealBrokers = true;

let scanResults = await knex("onerep_scan_results as sr")
.select(
"sr.*",
"s.*",
"sr.status as scan_result_status", // rename to avoid collision
"db.status as broker_status", // rename to avoid collision
)
.innerJoin("onerep_scans as s", "sr.onerep_scan_id", "s.onerep_scan_id")
.where("s.onerep_profile_id", onerepProfileId)
.andWhere("sr.manually_resolved", "false")
.andWhereNot("sr.status", "removed")
.join("onerep_data_brokers as db", "sr.data_broker", "db.data_broker")
.orderBy("sr.onerep_scan_result_id");

scanResults = scanResults.filter(
(result) =>
result.broker_status === "removal_under_maintenance" ||
new Date().getTime() - new Date(result.updated_at).getTime() >
CONST_DAY_MILLISECONDS * 200,
);
if (qaToggles) {
showCustomBrokers = qaToggles.show_custom_brokers;
showRealBrokers = qaToggles.show_real_brokers;
}
const scan = await getLatestOnerepScan(onerepProfileId);

let results: OnerepScanResultRow[] = [];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The logic here for adding the QA custom broker results is similar to that of getLatestOnerepScanResults() in the same file.

@codemist codemist requested a review from mansaj December 3, 2024 16:57
Copy link

github-actions bot commented Dec 3, 2024

Comment on lines +451 to +461
if (showCustomBrokers) {
const qaBrokers = await getQaCustomBrokers(
onerepProfileId,
scan?.onerep_scan_id,
);
const filteredCustomBrokers = qaBrokers.filter(
(broker) => broker.manually_resolved === false,
);

results = [...results, ...filteredCustomBrokers];
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For QA to test this feature, they should check that the manually_resolved attribute of a custom data broker is getting set to true.

@codemist codemist marked this pull request as draft December 3, 2024 19:04
@codemist codemist added the 🛑 Do Not Merge Do not merge this PR, even if approved. label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛑 Do Not Merge Do not merge this PR, even if approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant