Added v2 to v3 result transformation that includes package changes#1079
Added v2 to v3 result transformation that includes package changes#1079andrecsilva merged 3 commits intomainfrom
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.
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.
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.
will this function always be called from non-provisional contexts?
There was a problem hiding this comment.
No clue, not sure why this flag exists in the first place.
There was a problem hiding this comment.
provisional=True is "magic"... maybe we no longer make this distinction ?
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.