Skip to content

[AUTOCUT] Gradle Check Flaky Test Report for MetadataIndexTemplateServiceTests #3418

[AUTOCUT] Gradle Check Flaky Test Report for MetadataIndexTemplateServiceTests

[AUTOCUT] Gradle Check Flaky Test Report for MetadataIndexTemplateServiceTests #3418

Workflow file for this run

name: Auto triage based on the component label in issue
on:
issues:
types: [opened, reopened, transferred]
jobs:
apply-label:
if: github.repository == 'opensearch-project/OpenSearch'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v8
with:
script: |
const { issue, repository } = context.payload;
const { number, body, user } = issue;
const { owner, name } = repository;
const regex = /###\sRelated\scomponent\n\n(\w.*)\n/gm;
let match;
while ( ( match = regex.exec( body ) ) ) {
const [ , component_label ] = match;
let label
// Check if the component label is "_No response_"
if (component_label.trim() === "_No response_") {
// Add a comment tagging the user
await github.rest.issues.createComment({
owner: owner.login,
repo: name,
issue_number: number,
body: `@${user.login} Please reply to this comment with the relevant component to ensure it gets properly triaged:\n\n- Build\n- Clients\n- Cluster Manager\n- Extensions\n- Indexing:Performance\n- Indexing:Replication\n- Indexing\n- Libraries\n- Other\n- Plugins\n- Search:Aggregations\n- Search:Performance\n- Search:Query Capabilities\n- Search:Query Insights\n- Search:Relevance\n- Search:Remote Search\n- Search:Resiliency\n- Search:Searchable Snapshots\n- Search\n- Storage:Durability\n- Storage:Performance\n- Storage:Remote\n- Storage:Snapshots\n- Storage\n\nReply with the component name, and we'll label this issue appropriately.`
});
label = 'missing-component'
} else {
label = component_label
}
await github.rest.issues.addLabels({
owner: owner.login,
repo: name,
issue_number: number,
labels: [label]
});
}
// Always add the untriaged label
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['untriaged']
});