piranha icon indicating copy to clipboard operation
piranha copied to clipboard

Output summary at the end of execution

Open mkr-plse opened this issue 5 years ago • 13 comments

When Piranha is run, output the summary of the run that includes the configuration under which it ran, the number of APIs considered for refactoring, the number of APIs refactored, etc. Related - issue #207

mkr-plse avatar Apr 07 '20 12:04 mkr-plse

hii..I am trying to integrate piranha using maven.Also I have configured all the required jar files inside pom.xml file.Also the maven test result is getting successful.But where can I get the expected output?? I m not able to analyse where the output is generated.Please help me with this

manishamishra2715 avatar Apr 08 '20 12:04 manishamishra2715

When you build it with the given options in the instruction, the refactoring should happen in place and whatever you provided as source must have been updated.

mkr-plse avatar Apr 08 '20 12:04 mkr-plse

Thanks for quick response...actually the source is not getting updated. I am running by project->Run As->maven test.Also tried with pom.xml->Run As->maven test.Is this the correct approach? can you please guide me , which one to run?

manishamishra2715 avatar Apr 08 '20 13:04 manishamishra2715

Almost reached the solution referring the previous solutions to the issue raised

manishamishra2715 avatar Apr 08 '20 15:04 manishamishra2715

Glad it’s almost working! Two tips for the future:

  1. If you’re having a problem with Piranha, please either open a new issue or comment on an issue reflecting the same problem. This issue is about something different.

  2. If you’re having a build system integration problem, please provide output from running on the command line. Unfortunately we don’t have time to support IDE integrations at the moment.

msridhar avatar Apr 08 '20 15:04 msridhar

yes sure...thanks for info :)

manishamishra2715 avatar Apr 08 '20 15:04 manishamishra2715

It would also be helpful to output "near misses" during execution. Makes it easier to identify if the returnType or receiverType is slightly off, for instance. Or if the properties file path was specified incorrectly.

Does it make sense to log these in an optionally specified file or would that be too much overhead?

pranavsb avatar Jun 04 '20 12:06 pranavsb

Great idea. We can do two things here: a) By default, we will print the summary of what happened as part of the refactoring. b) Optionally, if the user specifies an option, we can log the activity of the refactoring process at the appropriate granularity.

The latter will be more expensive but will only be used for debugging the process of refactoring.

mkr-plse avatar Jun 04 '20 12:06 mkr-plse

Could this also work independently from the in-place removals?

That is, run Piranha and only get this summary, and don't modify any files.

j1nma avatar Aug 07 '22 20:08 j1nma

Yes. Polyglot Piranha allows one to express match-only rules (That change is under PR now) . So we can get this summary without replacements too.

ketkarameya avatar Aug 07 '22 20:08 ketkarameya

❤️. Can we expect this sometime this year?

j1nma avatar Aug 07 '22 20:08 j1nma

Oh yea ! My plan is to do it much much sooner. This is also an internal requirement so ...

ketkarameya avatar Aug 07 '22 20:08 ketkarameya

@j1nma I have added the functionality you requested for. Can you try now?

Basically you have to create match-only rules for your feature flag API. So u can build upon stale_feature_flag_cleanup_demos and match_only_demos. Tip: You can convert the stale_feature_flag_cleanup_demos to just return you the matches (Without rewriting the code) by deleting the rules.replace and rules.replace_node.

ketkarameya avatar Sep 12 '22 14:09 ketkarameya