dlapiduz / govcode.org

Government Open Source Project Explorer
MIT License
63 stars 20 forks source link

Adds a new "HelpWantedCount" field to the Repository model. #30

Closed marcesher closed 9 years ago

marcesher commented 10 years ago

This field is calculated by looking at all labels for all open issues, and increments if strings "help wanted", "wants help", or "needs help" are found. These labels can be any case and can contain punctuation; i.e. "NEEDS_HELP" would also suffice.

The user interface can use this field to signal to the user that the Repository has issues the organization would like help with.

Organizations can label their issues in this manner and consequently more easily surface their needs for help to govcode users.

Addresses #29

dlapiduz commented 10 years ago

@marcesher What would you think about having an "importIssues" function. There we can bring in all the open issues (and update ones that were closed) and get the "help-wanted" count.

That way we have all the stuff in place to do what we want with any issue...

marcesher commented 10 years ago

@dlapiduz That makes sense to me. I can try to make time to add it this weekend.

Meanwhile, on the UI side, we still have two problems that won't be solved by importing issues:

1) need to pick a better icon to indicate help wanted 2) if the org name is too long, the help wanted icon and count can get cut off. Any ideas how to deal with that?

marcesher commented 10 years ago

@dlapiduz I took a first crack at importing issues, and it was easy as expected. There are some tradeoffs:

  1. This adds a ton of time onto the import because every repo trips the current "Sleep" logic.
  2. I'm currently storing the labels as a comma-delimited string instead of as a postgresql array field. I initially started with an array field but went back to string b/c the array wasn't nearly as easy to work with with gorm... possibly you can get it working but for me it was a PITA.

I have some refactoring to do and then I'll update this PR for review. I'm not changing the API in any way right now... the repo model still exports a HelpWantedIssueCount value; the difference is in how that field is populated.

marcesher commented 10 years ago

@dlapiduz these pull requests have been updated with the new Issue storage. The UI remains unchanged.

Once we get all this merged and working on govcode.org, I want to pitch to you a small change to the import that will clear out some bugs I've found.

dlapiduz commented 9 years ago

Merged manually