-
Notifications
You must be signed in to change notification settings - Fork 236
Add OpenHands issue duplicate automation workflow #2909
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
adf2c7b
Add issue duplicate automation workflow
enyst f140353
chore: verify PR review synchronize trigger
enyst 9ecb6ff
chore: address PR review feedback (#2909)
enyst c604d38
chore: stop auto-review on every PR push
enyst ef21d98
chore: address second round of PR feedback (#2909)
enyst c6f9660
chore: use agent final response endpoint for duplicate checks (#2909)
enyst f7b3065
chore: harden duplicate auto-close comment handling (#2909)
enyst b48b7ce
chore: address remaining duplicate automation review feedback (#2909)
enyst 7954a8c
chore: address follow-up duplicate automation review comments (#2909)
enyst 68cf508
test: fix malformed issue data cross-test isolation (#2909)
enyst 3a40ec3
fix: harden duplicate automation edge cases (#2909)
enyst 53ba891
test: cover duplicate automation failure paths (#2909)
enyst 60665d0
fix: harden duplicate workflow operations (#2909)
enyst 5d8a1cf
fix: close duplicate automation review gaps (#2909)
enyst 5cbe558
fix: harden duplicate check response handling (#2909)
openhands-agent 096422d
chore: narrow duplicate checker smoke clone (#2909)
openhands-agent d029322
fix: keep duplicate workflow repo-local (#2909)
openhands-agent bd4cdf3
fix: redact duplicate-check debug payloads (#2909)
enyst 47d216c
Fix duplicate automation review follow-ups
enyst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| name: Remove duplicate candidate label on activity | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| concurrency: | ||
| group: remove-duplicate-${{ github.repository }}-${{ github.event.issue.number }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| remove-duplicate-candidate: | ||
| if: | | ||
| github.event.issue.state == 'open' && | ||
| github.event.issue.pull_request == null && | ||
| contains(github.event.issue.labels.*.name, 'duplicate-candidate') && | ||
|
enyst marked this conversation as resolved.
|
||
| github.event.comment.user.type != 'Bot' && | ||
|
enyst marked this conversation as resolved.
enyst marked this conversation as resolved.
|
||
| !startsWith(github.event.comment.body || '', '<!-- openhands-duplicate-check') && | ||
| !startsWith(github.event.comment.body || '', '<!-- openhands-duplicate-veto') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Remove duplicate-candidate label | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.OPENHANDS_BOT_GITHUB_PAT_PUBLIC || github.token }} | ||
| script: | | ||
| const issueNumber = context.issue.number; | ||
| const commenter = context.payload.comment.user.login || ''; | ||
| const normalizedCommenter = commenter.toLowerCase(); | ||
|
|
||
| if ( | ||
| normalizedCommenter.endsWith('[bot]') || | ||
| normalizedCommenter === 'all-hands-bot' | ||
| ) { | ||
| core.info( | ||
| `Skipping duplicate-candidate label removal for bot comment from ${commenter || 'unknown'}` | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| core.info( | ||
| `Removing duplicate-candidate label from issue #${issueNumber} after comment from ${commenter}` | ||
| ); | ||
|
|
||
| try { | ||
| await github.rest.issues.removeLabel({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issueNumber, | ||
| name: 'duplicate-candidate', | ||
| }); | ||
| } catch (error) { | ||
| if (error.status === 404) { | ||
| core.info( | ||
| `duplicate-candidate label was already removed from issue #${issueNumber}` | ||
| ); | ||
| return; | ||
| } | ||
| throw error; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.