-
Notifications
You must be signed in to change notification settings - Fork 83
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
Support version ranges and no versions for units in target definitions #1245
Support version ranges and no versions for units in target definitions #1245
Conversation
Test Results 285 files ± 0 285 suites ±0 50m 51s ⏱️ + 1m 13s For more details on these errors, see this check. Results for commit 12bdc13. ± Comparison against base commit c6325a1. ♻️ This comment has been updated with latest results. |
I guess support for this in tycho is implemented separately. |
Yes that's the only drawback this will immediately make the target file incompatible to any older Eclipse or Tycho version :-\ Theoretically there is a "target version" processing instruction, so maybe we should try to use that to make at least PDE aware of the incompatibility? |
Just one thing about the UI I think in such a case we should adapt the labelprovider to show the range + the resolved version. Also then we need some UI to edit the version (range) e.g. in the wizard there could be an additional radio option to use:
and of course the most challenging thing will be if one edit such a location so it retains the exiting version ranges. |
a60c49a
to
6d0064d
Compare
My plan is to add an extra column labeled As a side-note: That items are displayed three times also happens without this change for me and is something I'll look into separately. I also considered adding a separate column with a check-box This is probably not a perfect solution, but this dialog is quite difficult so I'm happy if there is a working solution that's no too bad. |
I would simply call it either "version" or "version range", btw. the displayed range in the screenshot looks wrong should it be |
From what I recall from a few weeks ago, if there are multiple locations and item will be shown once per location leading to what look like duplicates. (I tried to explain to the user that these aren't really duplicates in the sense of duplicated artifacts; that took some convincing!) |
I would argue that they are actual duplicates (in this context) as P2 will only pick up one anyways and one can't specify the location where to load it from. |
6d0064d
to
0a157c1
Compare
With all the other preceding PRs this is now in a state where I think it's complete.
I think that's in the nature of such change. But as long as one does not use the new possibilities, everything continues to work as it used to be. Therefore I'm not sure specifying a new version is necessary, especially since it's not trivial to add handling for a new version and implementing the procedure for the user to switch to the new version respectively stay on the old version. This would require quite a lot of extra code and special-handling. But I'll provide a PR to support it in Tycho.
But there is already a version column and version range does not fit as well if one uses
I only had one location with multiple repos. I looked a bit into it but this UI in general is difficult. |
I mean this one here I have never checked how it works but somehow PDE can already handle older target versions and then works slightly different. I just noticed that accidentally in the past where some features didn't work as I somehow created an older target version with some wizard.
Maybe we than should probably drop support for "versioned" target file format?
Maybe we should rename the old one to "Resolved Version" and switch the order, and name it then "Specified Version" or "Provided Version". |
0a157c1
to
b407740
Compare
Yes, but as far as I know this is just for reading and not considered while writing. And this is necessary because with older formats the target definition used a different structure. I have no further refined the code so that specified empty versions are preserved in order to increase compatibility. With the current implementation this has the effect that if one adds units through the UI the explicit empty version is added back. But I assume if one manages a target through the UI, that person does not really care if it can save typing the empty version. And if some time has passed and support for no versions exists long enough we could change PDE the automatically remove empty versions on the next change.
That's another issue we can think of later. I have to check first since when the latest version exists. But yes dropping support for older versions would allow us to remove quite some code.
Since that UI is mainly inherited from P2 I actually would like to do as few changes as possible. And since the UI actually lists available Unit I find it somehow fitting to keep the name of that column as version (since it the version of the artifact). As said the dialog is actually from P2 to select software to install. It is not too bad to use it in PDE if one specifies exact version, but with version ranges and empty versions that's all not ideal. But as said above from my POV these new features are mainly for working from the source tab and the editor is for me only secondary. That being said, we could also name the new column |
b407740
to
2168f2c
Compare
I have now tests for the resolution and serialization of units without version and with version range. Given these tests pass (🤞🏽) and there are no major objections I'll submit this tomorrow, Wednesday evening. |
701add5
to
c9ed6df
Compare
c9ed6df
to
12bdc13
Compare
Test failures are unrelated, submitting. Thanks to everyone who participated in this discussion. |
Support in Tycho for this is added via |
This is an early draft to add support for version ranges and no versions for
unit
elements in target-definitions.This allows users to omit the
version
attribute in aunit
element (which is equivalent to the value0.0.0
) or to specify a range (in the usual OSGi synax) as its value.For example:
Resolves to
This also contains two commits with code clean-ups in the target handling that I plan to provide as separate PR soon.
There are still a few things to work out regarding removal of IUs and Updating the target and the UI should probably also be adapted, but the most basic functionality is already working.
Fixes #757