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

Feat/patch management #432

Merged
merged 23 commits into from
Nov 15, 2023
Merged

Conversation

lukasrothenberger
Copy link
Collaborator

  • adds patch generator
  • adds patch applicator
  • adds line_mapping initialization & bookkeeping

@goerlibe
Copy link
Collaborator

goerlibe commented Nov 4, 2023

hardcoded clang and clang++ strings in CodeGenerator cause failure for me.
On my side I changed it to clang++-11 so I can continue on the GUI, but we should read it from our build_config

@goerlibe
Copy link
Collaborator

goerlibe commented Nov 4, 2023

it would be helpful if the patch applicator would return an error code != 0 if applying the suggestions was not successful.
For now I will look if stdout contains "not successful."

@lukasrothenberger
Copy link
Collaborator Author

lukasrothenberger commented Nov 6, 2023

it would be helpful if the patch applicator would return an error code != 0 if applying the suggestions was not successful. For now I will look if stdout contains "not successful."

@goerlibe
what should be returned in case an already applied suggestion is to be applied?
0, since no issue arises, or 1 since it "can not" be applied?

fix proposed in 2378bd0

@lukasrothenberger
Copy link
Collaborator Author

lukasrothenberger commented Nov 6, 2023

hardcoded clang and clang++ strings in CodeGenerator cause failure for me. On my side I changed it to clang++-11 so I can continue on the GUI, but we should read it from our build_config

@goerlibe
proposed fix in c91eaca

@goerlibe
Copy link
Collaborator

goerlibe commented Nov 6, 2023

it would be helpful if the patch applicator would return an error code != 0 if applying the suggestions was not successful. For now I will look if stdout contains "not successful."

@goerlibe what should be returned in case an already applied suggestion is to be applied? 0, since no issue arises, or 1 since it "can not" be applied?

fix proposed in 2378bd0

I am honestly fine with both. I think returning an error is more intuitive though, because the user tried to have something done and nothing was done.

Maybe we can use different error codes for different errors (e.g. 1=already_applied, 2=patch_failed, >=2 indicates a yet unknown error) and document them in the argparse interface.

Another (additional) option is to use stdout/stderr: I can show the output of stdout in an error message in the GUI and we can use stderr for the detailed error information (targeted at developers). This has the advantage that we do not need to update the GUI if we add more types of errors. Disadvantage is that we have to keep stdout clean.

@goerlibe
Copy link
Collaborator

goerlibe commented Nov 9, 2023

rollback of simple_gpu resulted in a wrong line_mapping with the start_line being mapped to -1

@goerlibe
Edit: should be fixed by 8a11c29 and 8de3f0d

@goerlibe
Copy link
Collaborator

goerlibe commented Nov 9, 2023

I can currently not apply more than one suggestion at once, not sure if I am doing something wrong, though

by "at once" I mean "after another", i.e. two consecutive calls to the discopop_patch_applicator with different ids

@goerlibe
Copy link
Collaborator

goerlibe commented Nov 9, 2023

it would be nice if the patch_generator generates the applied_suggestions.json with an empty array.

@goerlibe:
Added in bdfaf62.

btw is there a reason for the entries being strings? they could be simple numbers, right?
@goerlibe: If I remember correctly, there was a compatibility reason, but I can not reproduce it in detail at the moment, sorry.

@lukasrothenberger lukasrothenberger merged commit 39092b3 into release/3.0.0 Nov 15, 2023
3 checks passed
@lukasrothenberger lukasrothenberger deleted the feat/patch_management branch November 15, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

modify code generator to create patches for identified suggestions
2 participants