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

Add library to check release issues #589

Merged
merged 5 commits into from
Mar 4, 2025

Conversation

gaiksaya
Copy link
Member

Description

Add library to check release issues and trigger the GHA workflow if any are missing.

Issues Resolved

opensearch-project/opensearch-build#5332

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.

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 20 lines in your changes missing coverage. Please review.

Project coverage is 83.62%. Comparing base (bef263b) to head (c9dfa6c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tests/jenkins/TestReleaseMetricsData.groovy 69.76% 5 Missing and 8 partials ⚠️
src/jenkins/ReleaseMetricsData.groovy 76.00% 3 Missing and 3 partials ⚠️
src/jenkins/CreateIntegTestMarkDownTable.groovy 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #589      +/-   ##
============================================
- Coverage     84.61%   83.62%   -0.99%     
- Complexity      133      142       +9     
============================================
  Files           123      124       +1     
  Lines           780      843      +63     
  Branches         86      100      +14     
============================================
+ Hits            660      705      +45     
- Misses           33       41       +8     
- Partials         87       97      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gaiksaya added 5 commits March 3, 2025 13:03
Signed-off-by: Sayali Gaikawad <[email protected]>
Signed-off-by: Sayali Gaikawad <[email protected]>
Signed-off-by: Sayali Gaikawad <[email protected]>
Signed-off-by: Sayali Gaikawad <[email protected]>
@gaiksaya gaiksaya force-pushed the add-another-chore branch from f278751 to c9dfa6c Compare March 3, 2025 21:04
@@ -58,7 +61,7 @@ class ReleaseMetricsData {
],
[
match_phrase: [
"component": "${component}"
"component.keyword": "${component}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this if component field is of keyword type.
Was there any change in results?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the type is text. This is the mapping:

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

Without keyword the the results return everything that has opensearch in it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the field should have been keyword type. I'm okay if mapping cannot be updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right! I am just retrieving data from that index. @prudhvigodithi might be able to add more.

String action = args.action ?: 'check'

// Parameter check
if (!inputManifest || inputManifest.isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same boolean isNullOrEmpty(String str) { return (str == null || str.allWhitespace || str.isEmpty()) } here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also an array. Both manifests for OS and OSD can be supplied at the same time. While calling this method in the orchestrator we will only take version as an input and hardcode manifest file paths.

error "Invalid action '${action}'. Valid values: check, create"
}

def inputManifestYaml = readYaml(file: args.inputManifest[0])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why [0] index?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, just to get the version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Since its an array just taking whichever is the first manifest and parsing it.

}
echo("Components missing release issues: " + componentsMissingReleaseIssue)

if (action == 'create' && !componentsMissingReleaseIssue.isEmpty()) {
Copy link
Collaborator

@rishabh6788 rishabh6788 Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why check and create are two different actions, would it be better to check if the componentsMissingReleaseIssue list is not empty and just create the issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synced up offline. This library is providing flexibility to check as well. However, the orchestrator will be hardcoding to check if required.

@gaiksaya gaiksaya merged commit 533a9b1 into opensearch-project:main Mar 4, 2025
8 of 9 checks passed
@gaiksaya gaiksaya deleted the add-another-chore branch March 4, 2025 01:31
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 4, 2025
Signed-off-by: Sayali Gaikawad <[email protected]>
(cherry picked from commit 533a9b1)
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
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants