Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when mapping version to tag, ask user confirmation when mapping is low-confidence #284

Open
copernico opened this issue Nov 8, 2021 · 3 comments

Comments

@copernico
Copy link
Contributor

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

@amilankovich-slab
Copy link
Collaborator

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

@amilankovich-slab
Copy link
Collaborator

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.

@copernico
Copy link
Contributor Author

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants