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

[automation] Script file watchers now reusable for language-specific versions #2593

Merged
merged 1 commit into from
Dec 12, 2021

Conversation

jpg0
Copy link
Contributor

@jpg0 jpg0 commented Dec 6, 2021

Extracted reusable parts of script watching to allow language-specific instantiations:

  • Moved to non-internal package
  • Extracted logic into non-osgi-component classes
  • Added back in basic osgi-component versions

This change is specifically to prepare for JS-specific scripts to operate as standard NodeJS which is slightly different to the existing openHAB mechanism, as discussed with @kaikreuzer. No functionality change to core with this change, except the creation of the script directory if not already present. PR to use this functionality in openhab-addons to follow.

Signed-off-by: Jonathan Gilbert jpg@trillica.com

@jpg0
Copy link
Contributor Author

jpg0 commented Dec 6, 2021

Related PR to actually use this: openhab/openhab-addons#11719

@jpg0 jpg0 force-pushed the reusable-file-watchers branch from 1612e6c to d8089fc Compare December 6, 2021 17:39
@digitaldan
Copy link
Contributor

@cweitkamp and @kaikreuzer we have a number of changes we are trying to get in to provide proper support for the GraalVM script engine. This PR as well as #2595 will allow us to use both Nashorn and GraalVM, side by side, in both UI rules as well as files. Right now the two engines kinda clobber each other and are hurting us more then helping when you try and install GraalVM. This should really help us start to transition to GraalVM as our preferred scripting engine and eventually remove Nashorn in a graceful way over time.

@jpg0 jpg0 force-pushed the reusable-file-watchers branch from d8089fc to 0b17a7f Compare December 8, 2021 20:16
@jpg0 jpg0 changed the title Script file watchers now reusable for language-specific versions [automation] Script file watchers now reusable for language-specific versions Dec 8, 2021
@digitaldan
Copy link
Contributor

Any chance of a review or feedback @kaikreuzer @cweitkamp ? Thanks!

Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

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

Thanks. I support the idea behind this PR. I like to see a review from @kaikreuzer as this has been discussed with him earlier.

I left two questions for my personal understanding.

@cweitkamp cweitkamp added automation enhancement An enhancement or new feature of the Core labels Dec 9, 2021
@digitaldan
Copy link
Contributor

@kaikreuzer bump!

@kaikreuzer kaikreuzer requested a review from cweitkamp December 11, 2021 21:50
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Thanks, code looks good to me, but I haven't tested it - I assume you did.
Just some minor style comments below and also waiting for @cweitkamp's approval of it.

@digitaldan
Copy link
Contributor

Thanks! Yes i have been testing it for about a week without issues.

Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback. I am fine with the code.

Two minor style comments left before this can be merged. We can focus on functionality now. Missing nullness annotations can be added later.

…ic versions

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
@jpg0 jpg0 force-pushed the reusable-file-watchers branch from 0b17a7f to dddc8b0 Compare December 12, 2021 10:43
@@ -111,6 +103,21 @@ public void deactivate() {
super.deactivate();
}

@Override
public void activate() {

Copy link
Member

Choose a reason for hiding this comment

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

remove this empty line

@jpg0
Copy link
Contributor Author

jpg0 commented Dec 12, 2021

So this builds and tests fine on my machine, is the failing build is due to flakiness in the integration tests? If so should I force re-push with no material changes to force another build? Or can we ignore it?

@kaikreuzer
Copy link
Member

As the PR build on Jenkins succeeded, I guess we can ignore it.

@kaikreuzer kaikreuzer merged commit 2883dfb into openhab:main Dec 12, 2021
@kaikreuzer kaikreuzer added this to the 3.2 milestone Dec 12, 2021
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
…ic versions (openhab#2593)

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
GitOrigin-RevId: 2883dfb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants