Skip to content

Filter title, description, and body from logs

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60365 and https://gitlab.com/gitlab-org/gitlab-ce/issues/64460.

Before:

$ grep -F SENSITIVE log/development_json.log  | jq '.params | map(select(.value | tojson | test("SENSITIVE")))'
[
  {
    "key": "issue",
    "value": {
      "title": "SENSITIVE: issue title (on create)",
      "description": "SENSITIVE: issue description (on create)",
      "confidential": "0",
      "assignee_ids": [
        "0"
      ],
      "label_ids": [
        ""
      ],
      "due_date": "",
      "lock_version": "0"
    }
  }
]
[
  {
    "key": "title",
    "value": "SENSITIVE: issue title (on edit)"
  },
  {
    "key": "description",
    "value": "SENSITIVE: issue description (on edit)"
  },
  {
    "key": "issue",
    "value": {
      "title": "SENSITIVE: issue title (on edit)",
      "description": "SENSITIVE: issue description (on edit)",
      "lock_version": 0
    }
  }
]
[
  {
    "key": "merge_request",
    "value": {
      "title": "SENSITIVE: MR title (on create)",
      "description": "SENSITIVE: MR description (on create)",
      "assignee_ids": [
        "0"
      ],
      "label_ids": [
        ""
      ],
      "force_remove_source_branch": "0",
      "squash": "0",
      "lock_version": "0",
      "source_project_id": "80",
      "source_branch": "new-branch",
      "target_project_id": "80",
      "target_branch": "master"
    }
  }
]
[
  {
    "key": "merge_request",
    "value": {
      "title": "SENSITIVE: MR title (on edit)",
      "description": "SENSITIVE: MR description (on edit)",
      "assignee_ids": [
        "0"
      ],
      "label_ids": [
        ""
      ],
      "target_branch": "master",
      "force_remove_source_branch": "0",
      "squash": "0",
      "lock_version": "0"
    }
  }
]

After:


  {
    "key": "issue",
    "value": {
      "title": "[FILTERED]",
      "description": "[FILTERED]",
      "confidential": "0",
      "assignee_ids": [
        "0"
      ],
      "label_ids": [
        ""
      ],
      "due_date": "",
      "lock_version": "0"
    }
  }
]
[
  {
    "key": "issue",
    "value": {
      "title": "[FILTERED]",
      "description": "[FILTERED]",
      "lock_version": 0
    }
  }
]
[
  {
    "key": "merge_request",
    "value": {
      "title": "[FILTERED]",
      "description": "[FILTERED]",
      "assignee_ids": [
        "0"
      ],
      "label_ids": [
        ""
      ],
      "force_remove_source_branch": "0",
      "squash": "0",
      "lock_version": "0",
      "source_project_id": "80",
      "source_branch": "add-changelog",
      "target_project_id": "80",
      "target_branch": "master"
    }
  }
]
[
  {
    "key": "merge_request",
    "value": {
      "title": "[FILTERED]",
      "description": "[FILTERED]",
      "assignee_ids": [
        "0"
      ],
      "label_ids": [
        ""
      ],
      "target_branch": "master",
      "force_remove_source_branch": "0",
      "squash": "0",
      "lock_version": "0"
    }
  }
]
Edited by Sean McGivern

Merge request reports