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

Feature: Autopost certain issues to #contribution-opportunities #589

Open
2 of 4 tasks
Asartea opened this issue Aug 23, 2024 · 1 comment
Open
2 of 4 tasks

Feature: Autopost certain issues to #contribution-opportunities #589

Asartea opened this issue Aug 23, 2024 · 1 comment
Labels
Status: Needs Review This issue/PR needs an initial or additional review

Comments

@Asartea
Copy link
Contributor

Asartea commented Aug 23, 2024

Complete the following REQUIRED checkboxes:

- [ ] The title of this issue follows the command name: brief description of request format, e.g. /help: add optional @user parameter

The following checkbox is OPTIONAL:

  • I would like to be assigned this issue to work on it

1. Description:

Based on @01zulfi 's work in #338 as well as my own playing around (because I wanted an excuse to play with Redis), I propose a new service to post new contribution opportunities to #contribution-opportunities automatically (defining contribution opportunities as "an open issue, without assignee, which has the Status: Help Wanted label, and is within the subset of repo's targeted (see Discussion point 2).

I propose it will work as follows:

  • A new class is created in services/
  • Using cron it starts itself every time x amount of time has elapsed (see Discussion point 1)
    • (in order to start it up, a new line in ready.js could instantiate a new instance of the class and tell it to start scheduling itself)
  • For every repo checked (see Discussion point 2) it runs the following steps:
    • It queries the GitHub API for issues which match these criteria:
      • State: Open
      • Assignee: nil
      • Label: "Status: Help Wanted"
    • For each issue it performs the following steps:
      • Check if the issue is cached in Redis. If so, skip it
      • Extract the title and URL
      • Check if it's a good first issue by seeing if "Type: Good First Issue" is in the labels
      • Use this information to generate a new message
      • Put the message in an array of messages to send
    • Then, for every message in the array:
      • Send it to #contribution-opportunities
      • Cache the issue for 10 days in Redis
  • (Optional) A new slash command is added to force an immediate refresh (this might be useful for use cases like a bunch of chores/epics drop, but this is largely dependent on how long the interval between runs is)

Discussion points

  1. How long should the interval between each run be? wip contributing message service #338 had it at once a week, but I think that's too long. For some personal testing, I had it at every 12h[1], but that might be too often. On the other hand, the fallback for "no issues are available" would be to do nothing, so the impact is relatively low.
  2. Which repo(s) should be checked? TheOdinProject/curriculum is the only repo where issues will generally be doable by every learner, but this repo and TheOdinProject/theodinproject also regularly generate help wanted issues, and those might be more interesting for NodeJS/Rails people respectively

[1] I'd ideally like the interval to be something that isn't whole days, to avoid it always posting at midnight for some people

2. Acceptance Criteria:

  • All discussion points + any other feedback is resolved
  • Based on that, the functionality above is implemented, with any necessary changes
@Asartea Asartea added the Status: Needs Review This issue/PR needs an initial or additional review label Aug 23, 2024
@MaoShizhong
Copy link
Contributor

@TheOdinProject/maintainers Any thoughts on this idea?

I don't think I know enough about the potential implementation details to comment much further, plus I'm not personally sure about ideas for the 2 discussion point questions. So I'll ideally defer to greater experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review This issue/PR needs an initial or additional review
Projects
None yet
Development

No branches or pull requests

2 participants