Skip to content

Add GraphQL mutation `projectTextReplace`

Joe Woodward requested to merge feat/450701-redact-text into master

What does this MR do and why?

Add GraphQL mutation projectTextReplace

Allows maintainers+ to replace text via the GraphQL API.

Takes 2 arguments:

  • projectPath - full path of the project to redact
  • replacements - list of replacements

Valid replacements values are documented here

Returns nothing when successful Returns errors when something went wrong

Part of

Changelog: added

How to set up and validate locally

Install git-filter-repo locally (not bundled with GDK yet)

brew install git-filter-repo

Run mutation

See the linked docs for information on how to replace text with different options. Look for a file in the repo you will redact and then use the options to redact in various ways. By default the replacement will be ***REMOVED***, however, you can also specify what to replace with e.g. foo==>bar will replace all instances of foo with bar

mutation {
  # projectTextRedact(input: { projectPath: "Flightjs/flight", replacements: ["flight"]}) {
  projectTextReplace(input: { projectPath: "Flightjs/flight", replacements: ["flight"]}) {

Config options:


NOTE: We do not support regex: or glob: replacements due to potential for ReDoS attacks.

More details can be seen in the 'Content based filtering' section of the man page

Edited by Joe Woodward

Merge request reports