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

Update gradle publish library to handle invokeType #423

Merged
merged 1 commit into from
May 14, 2024

Conversation

prudhvigodithi
Copy link
Collaborator

@prudhvigodithi prudhvigodithi commented May 13, 2024

Description

Coming from a failed gradle check job https://build.ci.opensearch.org/job/gradle-check/38585/console with error No such property: pr_number for class: groovy.lang.Binding because this job was invoked by parameterizedCron.

Update gradle publish library to handle the invokeType so that the failed jobs can be filtered by invokeType.

Issues Resolved

opensearch-project/opensearch-build#4708

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
@prudhvigodithi
Copy link
Collaborator Author

prudhvigodithi commented May 13, 2024

I have tested the mappings update for existing indices and the new documents can be still be indexed with field invoked_by, example

Existing Mapping we have

PUT /gradle_check
{
  "mappings": {
    "properties": {
      "build_number": { "type": "integer" },
      "pull_request": { "type": "keyword" },
      "pr_description": { "type": "text" },
      "test_class": { "type": "keyword" },
      "test_name": { "type": "keyword" },
      "test_status": { "type": "keyword" },
      "build_result": { "type": "keyword" },
      "test_fail_count": { "type": "integer" },
      "test_skipped_count": { "type": "integer" },
      "test_passed_count": { "type": "integer" },
      "build_duration": { "type": "float" },
      "build_start_time": { "type": "date" }
    }
  }
}

Still it allows to index the documents with invoked_by.

POST /gradle_check/_doc
{
  "build_number": 1234,
  "pull_request": "PR-567",
  "pr_description": "Fixes a bug in the authentication module",
  "test_class": "AuthenticationTests",
  "test_name": "test_login",
  "test_status": "pass",
  "build_result": "success",
  "test_fail_count": 0,
  "test_skipped_count": 0,
  "test_passed_count": 1,
  "build_duration": 120.5,
  "build_start_time": "2024-05-13T08:00:00"
}

POST /gradle_check/_doc
{
  "build_number": 1234,
  "pull_request": "PR-567",
  "invoked_by": "manual",
  "pr_description": "Fixes a bug in the authentication module",
  "test_class": "AuthenticationTests",
  "test_name": "test_login",
  "test_status": "pass",
  "build_result": "success",
  "test_fail_count": 0,
  "test_skipped_count": 0,
  "test_passed_count": 1,
  "build_duration": 120.5,
  "build_start_time": "2024-05-13T08:00:00"
}

For the existing indices the invoked_by field will have the default mapping created.

        "invoked_by": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },

For the new indices this is already solved as the mappings are created at the beginning of the index creation, example as

PUT /gradle_check_tmp
{
  "mappings": {
    "properties": {
      "build_number": { "type": "integer" },
      "pull_request": { "type": "keyword" },
      "invoked_by": { "type": "keyword" },
      "pr_description": { "type": "text" },
      "test_class": { "type": "keyword" },
      "test_name": { "type": "keyword" },
      "test_status": { "type": "keyword" },
      "build_result": { "type": "keyword" },
      "test_fail_count": { "type": "integer" },
      "test_skipped_count": { "type": "integer" },
      "test_passed_count": { "type": "integer" },
      "build_duration": { "type": "float" },
      "build_start_time": { "type": "date" }
    }
  }
}

@prudhvigodithi prudhvigodithi marked this pull request as ready for review May 14, 2024 19:55
@prudhvigodithi prudhvigodithi merged commit 302c63c into opensearch-project:main May 14, 2024
7 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 14, 2024
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
(cherry picked from commit 302c63c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants