dotnet / issue-labeler

An issue labeler bot for use in dotnet repositories.
MIT License
22 stars 20 forks source link

Refactor labeler code to allow usage without Azure dependencies (+ other small fixes) #36

Closed Eilon closed 2 years ago

Eilon commented 2 years ago

Ideally, look at each commit individually. Most are just a few lines. The big one is the refactoring that has this useful comment:

Refactor Predictor code so it can be used without Azure dependencies

  1. New LabelPredictor project has all the ML logic and GitHub awareness, but no dependencies on Azure queues, blobs, or KeyVault.
  2. New interfaces in LabelPredictor project, along with default "local file" based providers
  3. Original IssueLabeler Web API project implements the interfaces to be Azure-enabled.

By default there should be no behavior changes at all - everything should work exactly as it did before. But you can swap the commented code in Startup.cs to change the behavior for local testing, or use the LabelPredictor project in other scenarios that don't use Azure storage.

The refactoring is 95% just moving code and renaming some types. The few small changes were to add the new interfaces and localize the Azure dependencies into Azure-aware types. Then there was a bit of new code for the "local file" implementations of those interfaces (which is quite trivial).

Eilon commented 2 years ago

@maryamariyan - these are the changes that I showed you yesterday.

Eilon commented 2 years ago

License headers updated. When you're ready to merge, please use rebase instead of squash because some of the individual commits in this PR are useful as-is and I'd rather not merge them. Thank you!

Eilon commented 2 years ago

image