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

Create GitHub action that unassigns external contributors from issues after some time of inactivity #12837

Open
MisRob opened this issue Nov 13, 2024 · 8 comments
Assignees
Labels
github_actions Pull requests that update GitHub Actions code help wanted Open source contributors welcome javascript Pull requests that update Javascript code P2 - normal Priority: Nice to have python Pull requests that update Python code

Comments

@MisRob
Copy link
Member

MisRob commented Nov 13, 2024

🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.

Summary

The goal of this issue is to implement a new GitHub action that would unassign external contributors from GitHub issues after some time of inactivity.

The criteria for unassigning:

  • Find all issues that are assigned to a non-LE team member
  • If there is no activity from the assignee for a month
  • AND there is no linked PR
  • THEN unassign the assignee

When a contributor is unassigned, the action should post a comment to the issue: "Automatically unassigning <contributor_mention> due to inactivity. <contributor_mention>, if you're still interested in this issue or already have work in progress, please message us here, and we'll assign you again. Thank you!"

Since the action will be used not only from Kolibri repository, but also from Studio and Kolibri Design System, it needs to be a reusable action whose core logic is placed in the .github repository and imported from Kolibri.

The action needs to be implemented in Python or JavaScript (no shell-based implementation). Avoid using 3rd party actions except the official ones.

Guidance

@MisRob MisRob added help wanted Open source contributors welcome P2 - normal Priority: Nice to have javascript Pull requests that update Javascript code python Pull requests that update Python code github_actions Pull requests that update GitHub Actions code labels Nov 13, 2024
@SukhvirKooner
Copy link

Hi @MisRob ! I would like to work on this issue. I have gone through the contribution guidelines and I'm ready to get started. Could you please assign this issue to me? Thank you!

Keeping these points in my mind

  1. Workflow Setup: Create a GitHub Action workflow that triggers on a daily schedule .

  2. API Setup: Use libraries to authenticate with the GitHub API using GITHUB_TOKEN for secure operations.

  3. Issue Filtering: Query all open issues assigned to non-LE team members using the GitHub API.

  4. Activity Check: For each issue, check if there has been no activity (comments or status changes) from the assignee in the past month.
    5 . PR Verification: Confirm that there is no linked pull request associated with the issue.

  5. Unassign Action: If the criteria are met, unassign the contributor and add a comment:
    "Automatically unassigning <contributor_mention> due to inactivity. <contributor_mention>, if you're still interested in this issue or have work in progress, please comment here to be reassigned. Thank you!"

  6. Reusable Structure: I will ensure that it will be a reusable action.

@AlexVelezLl
Copy link
Member

Hey @SukhvirKooner! Thanks for your interest in contributing to Kolibri! I will assign this to you, please let us know if you have any question :)

@MisRob
Copy link
Member Author

MisRob commented Nov 13, 2024

Thanks @SukhvirKooner, when you're ready, could you open

(1) The first PR with the reusable action to the https://github.com/learningequality/.github repository
(2) The second one to https://github.com/learningequality/test-actions repository. We will pretend that test-actions is kolibri repo so we can test it out more easily before going to production. After all works well, we could move it to other repos.

If you could set the test interval for unassignment to be 10 minutes or so, that'd help too.

@MisRob
Copy link
Member Author

MisRob commented Nov 13, 2024

@SukhvirKooner And before proceeding to this ^, I'd highly recommend you develop and test on your own two test repositories at first - it's much easier development wise since we can't give you admin access and you will need to test everything somehow.

@SukhvirKooner
Copy link

Thank you for the guidance, @MisRob . I’ll start by setting up two test repositories on my end to develop and test the action. Once it's working as expected, I'll proceed with opening the first PR to the .github repository with the reusable action, and then the second PR to test-actions for further testing. I’ll set the unassignment interval to 10 minutes to make it easier to observe the results.

I'll ask questions if needed ,
& keep you updated on the progress!

@SukhvirKooner
Copy link

Pull Requests Created

  • PR 1: Reusable Code for Unassign Inactive Issues
    This PR introduces a GitHub Action to automatically unassign users from issues that have been inactive for a specified duration.

  • PR 2: Unassign inactive Users
    This PR implements a GitHub Action to automatically unassign inactive issues based on a predefined period of inactivity. This action will help maintain cleaner issue assignments and prevent outdated issues from cluttering the project.

@MisRob
Copy link
Member Author

MisRob commented Nov 21, 2024

Thanks @SukhvirKooner :)!

@SukhvirKooner
Copy link

Hi @MisRob , let me know if you need any help with testing in these repositories or getting the Actions up and running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code help wanted Open source contributors welcome javascript Pull requests that update Javascript code P2 - normal Priority: Nice to have python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

3 participants