GitTools / GitReleaseManager

Tool for creating and exporting releases for software applications hosted on GitHub
https://gittools.github.io/GitReleaseManager/docs/
MIT License
309 stars 39 forks source link

#492 feat: renaming label Name using RenameFrom in Configuration #493

Closed davidzwa closed 1 year ago

davidzwa commented 1 year ago

Description

Introduce a change to the label command and service method to rename existing labels using an optional RenameFrom property. This property is then used to rename the label with the UpdateLabel OctoKit API call. If the RenameFrom property does not match any existing label, the associated label will still be deleted as we're used to, but also a warning is thrown to make the user aware that they might have lost a label in the process.

Related Issue

492

Motivation and Context

It makes integrating existing repos or migrating already GRM equipped repos to new label formats easier. Instead of

How Has This Been Tested?

Could not get that to work (yet). Waiting for feedback first, hope to update the PR accordingly.

Checklist:

gep13 commented 1 year ago

Oooo, this is a very interesting idea!

This isn't an area that GitReleaseManager was originally intended to move into, but I can see a use for this!

Let me take this for a spin at some point, and provide some feedback.

davidzwa commented 1 year ago

Oooo, this is a very interesting idea!

This isn't an area that GitReleaseManager was originally intended to move into, but I can see a use for this!

Let me take this for a spin at some point, and provide some feedback.

Thanks for the interest! Logically the code needs to be scrutinized: I had not setup Rider to be able to run the tests in the test runner. I guess some setup with Cake is involved? At least I saw test failures in terminal test runs.

One point of doubt: I think labels should never be removed (just keep the warning), or a configuration flag could be added to avoid removal for existing repos. Example: I lost all the label references in my test repo because they were removed, even though the same labels were recreated in the end. Therefore all issues involved were dangling/orphaned. I would love to help make GRM be suitable for adapting to existing repos, instead of the repo adjusting to GRM. What do you think?