Skip to content
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

[BUG] Mapping issue with OpenSearch Gradle Check Metrics #39

Closed
prudhvigodithi opened this issue Jun 4, 2024 · 3 comments
Closed

[BUG] Mapping issue with OpenSearch Gradle Check Metrics #39

prudhvigodithi opened this issue Jun 4, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@prudhvigodithi
Copy link
Member

What is the bug?

Today for OpenSearch Gradle Check Metrics, the publishGradleCheckTestResults.groovy is used to collect the gradle test failures from jenkins job and index to the metrics cluster. The index creation is done as gradle-check-\$MONTH_YEAR and wont create if the index already exists.

With the new fields added (opensearch-project/OpenSearch#13786 and opensearch-project/opensearch-build#4719) in the gradle check workflow when indexing these fields to an already existing index and its own mapping, OpenSearch created the default index mapping. Now with this PR opensearch-project/opensearch-build-libraries#427 the field mappings that are added for the new fields which will take effect for the new index's broke the existing visualizations.

What is the expected behavior?

The visualizations in OpenSearch Gradle Check Metrics dashboard should load the latest data from index pattern created that match gradle-check-\$MONTH_YEAR.

@prudhvigodithi
Copy link
Member Author

prudhvigodithi commented Jun 4, 2024

[Triage]
To fix the visualizations using the gradle-check-06-2024:

Create the temporary index gradle-check-06-2024-new with the desired working mapping that is working for previous month index gradle-check-05-2024.

PUT /gradle-check-06-2024-new
{
  "mappings": {
    "properties": {
      "build_duration": {
        "type": "float"
      },
      "build_number": {
        "type": "integer"
      },
      "build_result": {
        "type": "keyword"
      },
      "build_start_time": {
        "type": "date"
      },
      "git_reference": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "invoke_type": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "pr_description": {
        "type": "text"
      },
      "pull_request": {
        "type": "keyword"
      },
      "pull_request_owner": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "pull_request_title": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "test_class": {
        "type": "keyword"
      },
      "test_fail_count": {
        "type": "integer"
      },
      "test_name": {
        "type": "keyword"
      },
      "test_passed_count": {
        "type": "integer"
      },
      "test_skipped_count": {
        "type": "integer"
      },
      "test_status": {
        "type": "keyword"
      }
    }
  }
}

Copy the data to created temporary index.

POST /_reindex
{
  "source": {
    "index": "gradle-check-06-2024"
  },
  "dest": {
    "index": "gradle-check-06-2024-new"
  }
}

Delete the index once the data is copied and verified to temporary index.

DELETE /gradle-check-06-2024

Create the index gradle-check-06-2024 with the desired working mapping.

PUT /gradle-check-06-2024
{
  "mappings": {
    "properties": {
      "build_duration": {
        "type": "float"
      },
      "build_number": {
        "type": "integer"
      },
      "build_result": {
        "type": "keyword"
      },
      "build_start_time": {
        "type": "date"
      },
      "git_reference": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "invoke_type": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "pr_description": {
        "type": "text"
      },
      "pull_request": {
        "type": "keyword"
      },
      "pull_request_owner": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "pull_request_title": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      },
      "test_class": {
        "type": "keyword"
      },
      "test_fail_count": {
        "type": "integer"
      },
      "test_name": {
        "type": "keyword"
      },
      "test_passed_count": {
        "type": "integer"
      },
      "test_skipped_count": {
        "type": "integer"
      },
      "test_status": {
        "type": "keyword"
      }
    }
  }
}

Copy the data from temporary index to gradle-check-06-2024.

POST /_reindex
{
  "source": {
    "index": "gradle-check-06-2024-new"
  },
  "dest": {
    "index": "gradle-check-06-2024"
  }
}

Delete the temporary index after copying the data and once verified

DELETE /gradle-check-06-2024-new

Adding @getsaurabh02 @bshien @rishabh6788

@prudhvigodithi
Copy link
Member Author

The related change is already merged opensearch-project/opensearch-build-libraries#434, we can close this once a new library version is released with the above PR change and once the Jenkins file is updated with the new released library.
@getsaurabh02 @rishabh6788

@prudhvigodithi
Copy link
Member Author

This issue is now resolved as the change has been included in the library release starting from version 6.5.0.
Thank you
@getsaurabh02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant