-
Notifications
You must be signed in to change notification settings - Fork 10
Added v2 to v3 result transformation that includes package changes #1079
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
Conversation
src/codemodder/codetf/v3/codetf.py
Outdated
| try: | ||
| changeset: v2ChangeSet = next(cs for cs in result.changeset if cs.fixedFindings) | ||
| except StopIteration: | ||
| logger.debug("No fixedFinding in the given Result") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StopIteration could be raised from either result.changeset being empty or it's not empty but none of the changesets have a. fixefinding so the debug statement isn't quite accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I'll fix that
src/codemodder/codetf/v3/codetf.py
Outdated
| generation_metadata = GenerationMetadata( | ||
| strategy=Strategy.ai if changeset.ai else Strategy.deterministic, | ||
| ai=from_v2_aimetadata(changeset.ai) if changeset.ai else None, | ||
| provisional=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this function always be called from non-provisional contexts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No clue, not sure why this flag exists in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provisional=True is "magic"... maybe we no longer make this distinction ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be derived from the v2 changeset the same way as these other metadata fields.
| provisional=False, | |
| provisional=changeset.provisional, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance that for our purposes it makes more sense to pass in these metadata fields as parameters to this new function? For the use case I'm thinking of, I'd argue that the answer is yes.
src/codemodder/codetf/v3/codetf.py
Outdated
| generation_metadata = GenerationMetadata( | ||
| strategy=Strategy.ai if changeset.ai else Strategy.deterministic, | ||
| ai=from_v2_aimetadata(changeset.ai) if changeset.ai else None, | ||
| provisional=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be derived from the v2 changeset the same way as these other metadata fields.
| provisional=False, | |
| provisional=changeset.provisional, |
src/codemodder/codetf/v3/codetf.py
Outdated
| """ | ||
| # Find the changeset with a fixedFinding | ||
| try: | ||
| changeset: v2ChangeSet = next(cs for cs in result.changeset if cs.fixedFindings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed findings can belong to individual Change entries of a change set as well, so you need to check there too, both here and below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are usually replicated. That is, the changeset fixedFindings should always include the ones contained in the changes.
I'll make it check each individual change in any case.
src/codemodder/codetf/v3/codetf.py
Outdated
| generation_metadata = GenerationMetadata( | ||
| strategy=Strategy.ai if changeset.ai else Strategy.deterministic, | ||
| ai=from_v2_aimetadata(changeset.ai) if changeset.ai else None, | ||
| provisional=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any chance that for our purposes it makes more sense to pass in these metadata fields as parameters to this new function? For the use case I'm thinking of, I'd argue that the answer is yes.
|



No description provided.