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

Fixes a number of errors in the bndrun handling #6401

Merged

Conversation

pkriens
Copy link
Member

@pkriens pkriens commented Dec 11, 2024

Some of the changes we made to handle the UI of inherited properties were not correctly
handling all cases. These shortcomings were hidden because we reread the properties
from the file system.

The issue is that the BndEditModel is about the properties in the document while
the resolver handles properties after processing. So we needed to setup a processor
that properly reflected:

  • The correct class hierarchy (there are macros in the Processor subclasses)
  • Handled deleted properties
  • And provided updated values for properties

For this I hadded a sub-Processor to the bndrun. This subprocessor contained all the
document values (e.g. -include is in there) and intercepted access to the deleted
keys.

However, we accidentially reread the properties of the bndrun sub processor from file. This
worked fine in the workspace but the LauncUtils lets the Maven handler muck around to
add a repository. Unfortuantely, this also set the base directory of the bndrun to a
temporary directory for unknown reasons. So when the properties were read and an
include was found it could not find it.

Then there was an unrelated problem that I think was also masked. It turns out the UI
was updating the model with requirements even if requirements were not changed or
added. This created a null key in the bndrun that never existed. Since this example
used the -runrequirements key in an include file, it hid the original value. And
weridly it caused an NPE later.

So uncomfortable many changes ... I guess we need to test this well and probably release
a 7.2 soon.

Fixes #6393
Fixes #6394
Fixes #6394


Signed-off-by: github-actions [email protected]

github-actions added 2 commits December 11, 2024 17:57
---
 Signed-off-by: github-actions <[email protected]>

Signed-off-by: github-actions <[email protected]>
---
 Signed-off-by: github-actions <[email protected]>

Signed-off-by: github-actions <[email protected]>
@pkriens pkriens requested a review from chrisrueger December 13, 2024 08:23
@pkriens
Copy link
Member Author

pkriens commented Dec 13, 2024

@chrisrueger could you take this for a spin?

I added a small feature to the BndEditModel. You can now instantiate it with 'effective'. It makes the BndEditModel read only but it shows the effective properties. I quickly tried it in the UI and it is really nice, it shows you all the effective properties with inheritance and includes. However, it needs of course UI support to activate it and to disable the UI so no changes can be made. But if you look for a weekend project ...

@chrisrueger
Copy link
Contributor

chrisrueger commented Dec 13, 2024

@chrisrueger could you take this for a spin?

Yes, I try a quick test later.

I added a small feature to the BndEditModel. You can now instantiate it with 'effective'. It makes the BndEditModel read only but it shows the effective properties. I quickly tried it in the UI and it is really nice, it shows you all the effective properties with inheritance and includes.

Sounds pretty nice. Doesn't the pom.xml editor of Eclipse also have something similar?

However, it needs of course UI support to activate it and to disable the UI so no changes can be made. But if you look for a weekend project ...

I can have a look. Let's see which weekend it'll be ;)

@chrisrueger
Copy link
Contributor

Works good so far. I tested with the reproducer of @sad-poet and our own project.

---
 Signed-off-by: github-actions <[email protected]>

Signed-off-by: github-actions <[email protected]>
@pkriens pkriens merged commit 8e5cfa7 into bndtools:master Dec 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants