Add fields resolved_at, dismissed_at to vulnerability ES index

What does this MR do and why?

Adds resolved_at, dismissed_at fields on the vulnerability index.

This is done to help with performing aggregation query for the vulnerabilities over time chart which is discussed in &18805 (comment 2703138693)

Reference addition, field sync (incremental data), backfill will be done in follow up MRs.

How to set up and validate locally

Run the ES migration:

  1. Run the migration in Rails console Elastic::DataMigrationService[20250822201831].migrate.

  2. GET gitlab-development-vulnerabilities/_mapping in Kibana Dev console or curl "http://localhost:9200/gitlab-development-vulnerabilities/_mapping" should list the mappings of the index including the new fields resolved_at and dismissed_at as date type, like below response.

Example response
{
  "gitlab-development-vulnerabilities-20250710-0625": {
    "mappings": {
      "dynamic": "strict",
      "_meta": {
        "created_by": "18.2.0-pre"
      },
      "properties": {
        "archived": {
          "type": "boolean"
        },
        "auto_resolved": {
          "type": "boolean"
        },
        "casted_cluster_agent_id": {
          "type": "long"
        },
        "cluster_agent_id": {
          "type": "keyword"
        },
        "created_at": {
          "type": "date"
        },
        "dismissal_reason": {
          "type": "short"
        },
        "dismissed_at": {
          "type": "date"
        },
        "epss_scores": {
          "type": "float"
        },
        "has_issues": {
          "type": "boolean"
        },
        "has_merge_request": {
          "type": "boolean"
        },
        "has_remediations": {
          "type": "boolean"
        },
        "has_vulnerability_resolution": {
          "type": "boolean"
        },
        "identifier_names": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "normalizer": "lower_case_normalizer"
            },
            "ngram": {
              "type": "text",
              "analyzer": "identifier_ngram_analyzer",
              "search_analyzer": "standard"
            },
            "original": {
              "type": "keyword"
            }
          },
          "analyzer": "identifier_pattern_analyzer"
        },
        "location_image": {
          "type": "keyword"
        },
        "project_id": {
          "type": "long"
        },
        "reachability": {
          "type": "short"
        },
        "report_type": {
          "type": "short"
        },
        "resolved_at": {
          "type": "date"
        },
        "resolved_on_default_branch": {
          "type": "boolean"
        },
        "scanner_external_id": {
          "type": "keyword"
        },
        "scanner_id": {
          "type": "long"
        },
        "schema_version": {
          "type": "short"
        },
        "severity": {
          "type": "short"
        },
        "state": {
          "type": "short"
        },
        "traversal_ids": {
          "type": "keyword"
        },
        "type": {
          "type": "keyword"
        },
        "updated_at": {
          "type": "date"
        },
        "uuid": {
          "type": "binary"
        },
        "vulnerability_id": {
          "type": "long"
        }
      }
    }
  }
}

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #563388 (closed)

Edited by Bala Kumar

Merge request reports

Loading