Skip to content

fix: auto assign is not working correctly #220

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 2 commits into from
Jun 2, 2025

Conversation

lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Jun 2, 2025

Hello,

Currently, the new feature auto-assign works only for specific checkbox comments, so some issue templates cannot
benefit from the automation.

So, I've fixed the auto-assign plugin properly to make it work for all of the repositories.

Here are some real-world examples:

Real World Examples

Markdown

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request to implement this rule.
- [ ] I am willing to submit a pull request to implement this change.

CSS

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request to implement this rule.
- [ ] I am willing to submit a pull request to implement this change.

JSON

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request to implement this rule.
- [ ] I am willing to submit a pull request to implement this change.

eslint.org

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request for this change.

eslint

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request to implement this rule.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request to implement this change.

rewrite

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.
- [ ] I am willing to submit a pull request for this change.

code-explorer

- [ ] I am willing to submit a pull request for this issue.
- [ ] I am willing to submit a pull request for this change.

@eslint-github-bot eslint-github-bot bot added the bug label Jun 2, 2025
@lumirlumir lumirlumir added this to Triage Jun 2, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jun 2, 2025
@lumirlumir lumirlumir requested a review from Copilot June 2, 2025 11:11
@lumirlumir lumirlumir marked this pull request as ready for review June 2, 2025 11:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR broadens the auto-assign matching logic and updates tests to exercise multiple checkbox templates.

  • Refactored isWillingToSubmitPR to match any “submit a pull request” checkbox, not just a specific text.
  • Added issueBodies helper and API_URL constant in tests; replaced manual mocks with loops over generated bodies.
  • Updated expectations to reference the new API_URL.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/plugins/auto-assign/index.js Introduce API_URL, add issueBodies helper, and loop tests over multiple bodies
src/plugins/auto-assign/index.js Relax substring match in isWillingToSubmitPR for broader coverage
Comments suppressed due to low confidence (4)

tests/plugins/auto-assign/index.js:19

  • [nitpick] The constant API_URL is quite generic—consider renaming it to something like ASSIGNEES_API_URL to clarify its purpose.
const API_URL = "https://api.github.com/repos/test/repo-test/issues/1/assignees";

tests/plugins/auto-assign/index.js:55

  • [nitpick] Hardcoding the full repository path in tests can be brittle; consider deriving this URL dynamically (e.g., from a base constant or repo metadata) to keep tests flexible.
fetchMock.mockGlobal().post(API_URL,

tests/plugins/auto-assign/index.js:26

  • [nitpick] Consider adding a test scenario for an uppercase checkbox mark ([X]) to verify that your matching logic handles case-insensitive checkboxes correctly.
function issueBodies(checkMark) {

src/plugins/auto-assign/index.js:28

  • Using a broad includes check may produce false positives; consider switching to a regex with start-of-line anchoring (e.g., /^- \[x\] i am willing to submit a pull request/i) for more precise matching.
.includes(
            "- [x] i am willing to submit a pull request"
        );

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@nzakas nzakas merged commit 5106e93 into main Jun 2, 2025
5 checks passed
@nzakas nzakas deleted the fix-auto-assign-is-not-working-correctly branch June 2, 2025 14:20
@github-project-automation github-project-automation bot moved this from Needs Triage to Complete in Triage Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy