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

resetting local objects do not move them to the package #2706

Closed
arcanist123 opened this issue May 26, 2019 · 7 comments
Closed

resetting local objects do not move them to the package #2706

arcanist123 opened this issue May 26, 2019 · 7 comments

Comments

@arcanist123
Copy link

arcanist123 commented May 26, 2019

It looks like reset local command does not move objects between packages. I have come up with the solution that deletes/recreates the objects
How to reproduce:
create a package with a single class and put it to online repository. then reassign the class to some other package. Done - you will never be able to reset locally such a package
it looks like the #842 is already referencing this issue, but is closed with workaround. The workaround is creating a lot of manual work if objects are scattered between packages.

@larshp
Copy link
Member

larshp commented May 26, 2019

hmm, I'm pretty sure this works

@arcanist123
Copy link
Author

it works if the package you are reassigning the class to, belongs to the same repository. if not, I was not able to collect all the objects into one transport
2019-05-26 19_37_07-photon_201812_wsp - NPL_DEV - Eclipse IDE

I encountered it when I tried to install the abap2xlsx. i already had the old version via transport but tried to get the new one, by installing it as a local package. To my surprise, I was not able to - the objects simply were not coming into the new package

@larshp
Copy link
Member

larshp commented May 27, 2019

Generally abapGit does not overwrite something outside the target package unless the user confirms this is okay, this is important in case multiple repos have objects with identical names

The code in
https://github.com/larshp/abapGit/blob/6560cbe539d366a850abf9568007bb0261504c90/src/zcl_abapgit_objects.clas.abap#L1122
might need some changes

also see
https://docs.abapgit.org/development/api.html
image

@arcanist123
Copy link
Author

arcanist123 commented May 27, 2019

perhapce I am not understanding what kind of changes are required. As per my understanding, the current implementation will call the zif_abapgit_oo_object_fnc~create method only if the user agrees to overwrite the class in the different package. The current implementation will then happily overwrite the file in the different package (and will do nothing if the user does not agree to overwrite the class).
What the current current implementation will not do is the following - the object from the external package will not move to the repository package. In general, since there are package interfaces (not sure if they are implemented), this can lead to the syntax errors - the new version of the class can use the other class that is only accessible from within the package itself. Thus the issue raised.
The linked pull request is re-mediating this issue - it enables the class that is being overwritten to be also relocated to the repository package in case the user agree to overwrite the class. I am not sure if you want to additionally have another screen that will request the user to select the objects that are to be relocated - but i guess this could be done.

@larshp
Copy link
Member

larshp commented May 28, 2019

okay, just not sure what the as-is scenario is, what is exactly happening when the user tries to do this, guess I'll test it when I get time

@larshp
Copy link
Member

larshp commented Aug 8, 2019

fm SEO_CLASS_* should not be needed to relocate to a different package, plus we need a generic solution that works for all object types

@mbtools
Copy link
Member

mbtools commented Jun 26, 2022

current version properly reassigns objects to packages on pull (https://github.com/abapGit/abapGit/blob/main/src/objects/zcl_abapgit_objects.clas.abap#L220)

@mbtools mbtools closed this as completed Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants