Closed simonbyford closed 2 months ago
Does two things:
1) adds some handling to the /api/rules/csv-import endpoint to ensure the user making the request has the correct permissions. Also stores their email address against the change instead of the dummy value "CSV Import" (see: https://github.com/guardian/typerighter/commit/b71cd93596dad8f5accb460bd9ede51e4cc386b8) 2) introduces a new endpoint /api/rules/archive-by-tag which can be used to bulk-archive rules based on a given tag (see: https://github.com/guardian/typerighter/commit/e62afe13cc6c4bf5edcde9d28cc078224ff0fbbd)
/api/rules/csv-import
"CSV Import"
/api/rules/archive-by-tag
The new endpoint /api/rules/archive-by-tag accepts one parameter encoded as form-data:
tag
For example:
curl --location 'https://manager.typerighter.gutools.co.uk/api/rules/archive-by-tag' \ --header 'accept: */*' \ --header 'content-type: application/json' \ --form 'tag="MP"'
It's slightly more complicated than the above. See these notes on the previous PR: https://github.com/guardian/typerighter/pull/477#how-to-test
Testing on CODE:
https://github.com/user-attachments/assets/c8175624-2554-4d2a-8b15-768881e2e29e
I'm not too sure why this particular request took 17 seconds. Subsequent requests took 200ms!
Overdue on Checker, Rule Manager (merged by @simonbyford 15 minutes and 3 seconds ago) What's gone wrong?
What does this change?
Does two things:
1) adds some handling to the
/api/rules/csv-import
endpoint to ensure the user making the request has the correct permissions. Also stores their email address against the change instead of the dummy value"CSV Import"
(see: https://github.com/guardian/typerighter/commit/b71cd93596dad8f5accb460bd9ede51e4cc386b8) 2) introduces a new endpoint/api/rules/archive-by-tag
which can be used to bulk-archive rules based on a given tag (see: https://github.com/guardian/typerighter/commit/e62afe13cc6c4bf5edcde9d28cc078224ff0fbbd)The new endpoint
/api/rules/archive-by-tag
accepts one parameter encoded as form-data:tag
(required): the tag associated with the rules to archive.For example:
How to test
It's slightly more complicated than the above. See these notes on the previous PR: https://github.com/guardian/typerighter/pull/477#how-to-test
Testing on CODE:
https://github.com/user-attachments/assets/c8175624-2554-4d2a-8b15-768881e2e29e
I'm not too sure why this particular request took 17 seconds. Subsequent requests took 200ms!