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
Adds a cli command to restart privacy requests #96
Conversation
This pull request has been linked to 1 task:
|
39c3982
to
c279839
Compare
c279839
to
e1017bd
Compare
// eslint-disable-next-line no-await-in-loop | ||
} = await makeGraphQLRequest(client, REQUESTS, { | ||
first: PAGE_SIZE, | ||
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.
We should be using cursor based pagination here using something like createdAt
to avoid stressing out our DB on deep pages, similar to the Salesloft issue we caused, all those moons ago. An example we have in our codebase: https://github.com/transcend-io/main/blob/ceacc7b526a62c89f524ffb58ac7ae4f421d1f59/frontend-services/admin-dashboard/src/PrivacyRequests/ExportToCsv/index.tsx#L134
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.
oh good callout. this repo has this pagination in a future place, ill make a ticket to refactor these all, but im gonna merge this for now to unblock testing. refactoring this will require new testing.
}); | ||
const requests = allRequests.filter( | ||
(request) => | ||
new Date(request.createdAt) < createdAt && |
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.
Nitpick: Would use moment
Related Issues
This PR moves out our internal battle tested bulk-restart request script to be accessible through the cli.
Screen.Recording.2022-12-06.at.12.31.48.AM.mov
Bulk update a set of privacy requests based on a set of request filters.
Authentication
In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
The API key needs the following scopes:
Arguments
Usage
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE
For self-hosted sombras that use an internal key:
Specifying the backend URL, needed for US hosted backend infrastructure.
Increase the concurrency (defaults to 20)
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --concurrency=100
Restart specific requests by ID
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --requestIds=c3ae78c9-2768-4666-991a-d2f729503337,342e4bd1-64ea-4af0-a4ad-704b5a07cfe4
Restart requests that were submitted before a specific date.
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --createdAt=2022-05-11T00:46
Restart requests and place everything in silent mode submitted before a certain date
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --markSilent=2022-12-05T00:46
Send email receipts to the restarted requests
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --sendEmailReceipt=true
Copy over all enriched identifiers from the initial request. Leave false to restart from scratch with initial identifiers only
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --copyIdentifiers=true
Skip queued state of request and go straight to compiling
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --skipWaitingPeriod=true