dotnet / issue-labeler

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

Allow configuration of a label to apply when no area label is determined #53

Closed jeffhandley closed 1 year ago

jeffhandley commented 1 year ago

Fixes #27

Allows configuration by repository for an optional label to apply when no area can be determined. When such a label is configured, that label is applied instead of adding a comment saying the issue/pr needs an area label. When no such label is configured, the comment is still added as it is today.

I've also retargeted from net5.0 to net7.0.

@maryamariyan or @Eilon -- This needs your confirmation that I'm reading the options correctly such that we can use Azure App Configuration to specify {owner}:{repo}:no_area_determined_label as a string and that will get loaded. And/or, I'll need help from @dakersnar to deploy and test this.

jeffhandley commented 1 year ago

I figured out how to do local development/testing which then enabled me walk through the code in better detail and understand it much further. I've refined the implementation to add the needs-area-label label in a better way.

  1. There's configuration for whether or not comments can be applied
  2. There's configuration for whether or not labels can be applied
  3. I moved the logic for adding the needs-area-label label to be conditional based on whether labels can be applied
  4. And if such a label is added, the logic recognizes that the label was added and therefore it doesn't try to add the comment
danmoseley commented 1 year ago

@mkArtakMSFT FYI. although I'm not sure whether you decided to use this labeler (I have no opinion)