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

Adapt addons to core watch service changes #14004

Merged
merged 4 commits into from
Feb 13, 2023
Merged

Conversation

J-N-K
Copy link
Member

@J-N-K J-N-K commented Dec 18, 2022

@wborn wborn added this to the 4.0 milestone Dec 18, 2022
@jlaur jlaur removed this from the 4.0 milestone Dec 19, 2022
@J-N-K
Copy link
Member Author

J-N-K commented Dec 20, 2022

@jpg0 @florian-h05 Can you have a look at the changes in JS Scripting?
@jimtng @ccutrer an you have a look at the changes in JRuby Scripting?

Unfortunately it's not so easy to test because it requires a full distribution build with the core changes.

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-0-snapshot-discussion/142322/22

@florian-h05
Copy link
Contributor

Having a glance (at GitHub web) at JS Scripting, the changes look reasonable and good to me, but I will try to have a look at this in IntelliJ tomorrow.
I guess since it is not easy to test this, we should merge if it looks good and then see what happens. We are in the early days of a new openHAB major release, IMO no one should expect the SNAPSHOTs to work as fine as usual.

@ccutrer
Copy link
Contributor

ccutrer commented Dec 20, 2022

Unfortunately it's not so easy to test because it requires a full distribution build with the core changes.

I see, cause of the change in the BOM's pom.xml.

Are there any docs on how to do a full dist build? I've run into this before when I was trying to move the Jinja dependency for Home Assistant. I failed, and have never gotten back to it (and I've kept myself plenty busy with other things).

Copy link
Contributor

@ccutrer ccutrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JRuby portion looks fine to me, minus the minor typo. I'll try to figure out how to test it within the next few days.

@J-N-K
Copy link
Member Author

J-N-K commented Dec 20, 2022

@ccutrer I do a local openhab-core build, then an openhab-addons and openhab-webui build (only if changes may affect UI). The last step is an openhab-distro build which produces a .zip for the core installation and a .kar for add-ons. I have a modified update script which updates my the test installation on my dev machine from a file (instead of the remote repository).

@florian-h05
Copy link
Contributor

@J-N-K Any chance you can provide the core ZIP to us?
AFAIK addons KAR shouldn’t be required, an addon jar should be enough and I can build the addon on my own.

Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from one bug, the JS Scripting code looks good to me, thanks!
I trust you that you tested it, I won't test myself unless someone provides me the distro build (or just the core ZIP).

Please have a look at my comments.


super.activate();
if (Files.isRegularFile(this.libraryPath)) {
Copy link
Contributor

@florian-h05 florian-h05 Dec 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (Files.isRegularFile(this.libraryPath)) {
if (Files.isRegularFile(Path.of(this.LIB_PATH))) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debatable if it is more clear if we use libraryPath which is what is used by the WatchService itself or Path.of(LIB_PATH). Technically it is the same. The constructor calls super(watchService, LIB_PATH) and there libraryPath is assigned to Path.of(LIB_PATH).

@ccutrer
Copy link
Contributor

ccutrer commented Dec 21, 2022

@ccutrer I do a local openhab-core build, then an openhab-addons and openhab-webui build (only if changes may affect UI). The last step is an openhab-distro build which produces a .zip for the core installation and a .kar for add-ons. I have a modified update script which updates my the test installation on my dev machine from a file (instead of the remote repository).

Hmm, a full core build is failing for me with

[ERROR] Failed to execute goal on project org.openhab.core.model.core: Could not resolve dependencies for project org.openhab.core.bundles:org.openhab.core.model.core:jar:4.0.0-SNAPSHOT: Failed to collect dependencies at org.openhab.core.bom:org.openhab.core.bom.compile-model:pom:4.0.0-SNAPSHOT -> org.eclipse.xtext:org.eclipse.xtext.generator:jar:2.29.0 -> org.eclipse.xtext:org.eclipse.xtext.xtext.generator:jar:2.29.0 -> org.eclipse.emf:org.eclipse.emf.mwe.utils:jar:1.8.0 -> org.eclipse.emf:org.eclipse.emf.mwe.core:jar:[1.8.0]: No versions available for org.eclipse.emf:org.eclipse.emf.mwe.core:jar:[1.8.0] within specified range

@J-N-K
Copy link
Member Author

J-N-K commented Dec 21, 2022

Can you try building with mvn clean install -U? I would suggest to wait until I fixes the Nashorn missing issue in AbstractScriptFileWatcher.

@wborn
Copy link
Member

wborn commented Dec 21, 2022

full core build is failing for me

I had the same issue yesterday and fixed it by removing all cached Eclipse artifacts from my local Maven repo in ~/.m2/repository/org/eclipse

@jpg0
Copy link
Contributor

jpg0 commented Dec 23, 2022

Awesome that this has been refactored! When working on this to support more advanced watching for JSScripting, it was pretty obvious that the existing code was really struggling to incorporate the changes. As long as the tests are passing then I'm happy (as they were already pretty extensive as I remember).

@J-N-K J-N-K force-pushed the watchservice branch 2 times, most recently from 709a71c to 70c8ae7 Compare January 5, 2023 12:59
@jlaur jlaur removed the awaiting other PR Depends on another PR label Feb 12, 2023
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the merge conflicts and address the review comment @J-N-K?

Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Signed-off-by: Jan N. Klug <github@klug.nrw>
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@wborn wborn merged commit d613641 into openhab:main Feb 13, 2023
@wborn wborn added this to the 4.0 milestone Feb 13, 2023
@J-N-K J-N-K deleted the watchservice branch February 13, 2023 15:48
SMHRambo pushed a commit to SMHRambo/openhab-addons that referenced this pull request Feb 14, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
renescherer pushed a commit to renescherer/openhab-addons that referenced this pull request Mar 23, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
FordPrfkt pushed a commit to FordPrfkt/openhab-addons that referenced this pull request Apr 20, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants