when mapping version to tag, ask user confirmation when mapping is low-confidence
I guess we should change the "else" here: https://github.com/SAP/project-kb/blob/prospector-assuremoss/prospector/git/version_to_tag.py#L124 to produce a BIG warning instead of trying hard to offer some matching -- the user should provide the mapping manually in this case
If I remove the current best effort mapping from the else branch we lose some functionality captured by a test: FAILED git/test_git.py::test_get_tag_for_version
If I remove the current best effort mapping from the else branch we lose some functionality captured by a test: FAILED git/test_git.py::test_get_tag_for_version
I can make the test pass by running pytest with the -s flag and supplying the good solution (STRUTS_2_3_9) in interactive mode.
We agreed to separate the code implementing the interactive part from the code computing the values (perfect matches, suggestions). Sample (pseudo-)code follows:
class ResultsWithSuggestions:
List with "matches" (exact or high-confidence results)
List with suggestions (potantially good suggestions)
def compute(..., ..) -> ResultsWithSuggestions:
return ...
def compute_2(..., ..) -> ResultsWithSuggestions:
return ...
result = compute(a,b,c)
if not result.has_matches():
return interactively_ask_user(result.get_suggestions())
else:
return result.get_matches()