Skip to content

Commit f7f431d

Browse files
authored
Refactor the dedupe workflow by extracting a reusable workflow to opensearch-build (#5319)
* Refactor issue dedupe workflows to call reusable workflow Replace inline workflow logic in all three issue dedup files with thin callers to opensearch-project/opensearch-build/.github/workflows/issue-dedupe.yml@main. This centralizes the dedupe logic (detect, auto-close, remove-label) into a single reusable workflow, reducing per-repo maintenance burden. Signed-off-by: Heng Qian <qianheng@amazon.com> * Temporarily point dedupe workflows to personal fork for testing Point reusable workflow references to qianheng-aws/opensearch-build branch add-issue-dedupe-workflow until the upstream PR is merged. Signed-off-by: Heng Qian <qianheng@amazon.com> * Refactor dedupe workflows to use opensearch-build reusable workflows - Three caller workflows now delegate to opensearch-build reusable workflows - Remove .claude/commands/dedupe.md (prompt now lives in opensearch-build) - Remove scripts/comment-on-duplicates.sh (logic inlined in reusable workflow) Signed-off-by: Heng Qian <qianheng@amazon.com> * Test: point dedupe detect to test-dedupe-debug branch Signed-off-by: Heng Qian <qianheng@amazon.com> * Point dedupe detect to PR branch for testing Signed-off-by: Heng Qian <qianheng@amazon.com> * Simplify dedupe callers after reusable workflow input cleanup Remove redundant parameter passing — reusable workflows now derive issue context from github.event directly. Signed-off-by: Heng Qian <qianheng@amazon.com> * Update dedupe caller to match latest reusable workflow changes - Point to opensearch-project/opensearch-build@main - Rename secret to BEDROCK_ACCESS_ROLE_ISSUE - Add schedule trigger and auto-close job - Remove workflow_dispatch (detect derives issue from github.event) Signed-off-by: Heng Qian <qianheng@amazon.com> * Rename dedupe workflow to remove tool-specific naming Signed-off-by: Heng Qian <qianheng@amazon.com> * Add dispatch for dedupe workflow Signed-off-by: Heng Qian <qianheng@amazon.com> * Add workflow_dispatch support for auto-close job Signed-off-by: Heng Qian <qianheng@amazon.com> * Point dedupe workflows to fork branch for testing Signed-off-by: Heng Qian <qianheng@amazon.com> * Consolidate dedupe workflows and add grace_days to auto-close Signed-off-by: Heng Qian <qianheng@amazon.com> * Pass grace_days to detect workflow via repo variable Signed-off-by: Heng Qian <qianheng@amazon.com> * Point dedupe workflows to upstream main and update secret name Signed-off-by: Heng Qian <qianheng@amazon.com> --------- Signed-off-by: Heng Qian <qianheng@amazon.com>
1 parent 5b792da commit f7f431d

6 files changed

Lines changed: 43 additions & 340 deletions

File tree

.claude/commands/dedupe.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/auto-close-duplicates.yml

Lines changed: 0 additions & 132 deletions
This file was deleted.

.github/workflows/claude-dedupe-issues.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/issue-dedupe.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Issue Dedupe
3+
on:
4+
issues:
5+
types: [opened]
6+
schedule:
7+
- cron: '0 0 * * *'
8+
workflow_dispatch:
9+
inputs:
10+
job:
11+
description: 'Job to run'
12+
required: true
13+
type: choice
14+
options:
15+
- detect
16+
- auto-close
17+
default: detect
18+
issue_number:
19+
description: 'Issue number to check for duplicates (detect only)'
20+
required: false
21+
type: string
22+
23+
jobs:
24+
detect:
25+
if: github.event_name == 'issues' || (github.event_name == 'workflow_dispatch' && inputs.job == 'detect')
26+
uses: opensearch-project/opensearch-build/.github/workflows/issue-dedupe-detect.yml@main
27+
permissions:
28+
contents: read
29+
issues: write
30+
id-token: write
31+
secrets:
32+
BEDROCK_ACCESS_ROLE_ISSUE_DEDUPE: ${{ secrets.BEDROCK_ACCESS_ROLE_ISSUE_DEDUPE }}
33+
with:
34+
issue_number: ${{ inputs.issue_number || '' }}
35+
grace_days: ${{ vars.DUPLICATE_GRACE_DAYS || '7' }}
36+
37+
auto-close:
38+
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.job == 'auto-close')
39+
uses: opensearch-project/opensearch-build/.github/workflows/issue-dedupe-autoclose.yml@main
40+
permissions:
41+
issues: write
42+
with:
43+
grace_days: ${{ vars.DUPLICATE_GRACE_DAYS || '7' }}

.github/workflows/remove-duplicate-on-activity.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

scripts/comment-on-duplicates.sh

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)