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

Allow inline scripts in SCRIPT transformation #3249

Merged
merged 1 commit into from
Mar 12, 2023

Conversation

J-N-K
Copy link
Member

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

Closes #3243

Inline scripts are identified by starting with | which is fine since that is neither an allowed character on nearly all file systems nor for UIDs. Additionally, the old JS transformation also defined inline scripts in this way, so it is already a known concept.

Signed-off-by: Jan N. Klug github@klug.nrw

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Dec 22, 2022
@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/93

@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-milestone-discussion/145133/21

Signed-off-by: Jan N. Klug <github@klug.nrw>
@J-N-K J-N-K force-pushed the feature-inlinescripting branch from fd96e90 to faeda60 Compare March 11, 2023 22:10
@J-N-K J-N-K marked this pull request as ready for review March 11, 2023 22:44
@J-N-K J-N-K requested a review from a team as a code owner March 11, 2023 22:44
@J-N-K
Copy link
Member Author

J-N-K commented Mar 11, 2023

SCRIPT(dsl:|input.length):%s works fine

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! It will be even more useful now you can use this with any scripting language. 🙂

@wborn wborn merged commit 95e04fc into openhab:main Mar 12, 2023
@wborn wborn added this to the 4.0 milestone Mar 12, 2023
@J-N-K J-N-K deleted the feature-inlinescripting branch March 12, 2023 11:01
@dandjo
Copy link

dandjo commented Apr 18, 2023

Not working with SCRIPT(js:my_script.script):%s, as it did with MS1. But JS(my_script.script):%s is back.
Should be documented somewhere.

@rkoshak
Copy link

rkoshak commented Apr 18, 2023

But JS(my_script.script):%s is back.
Should be documented somewhere.

It's mentioned on the milestone thread (https://community.openhab.org/t/openhab-4-0-milestone-discussion/145133/186), the snapshot thread (https://community.openhab.org/t/openhab-4-0-snapshot-discussion/142322/320), and the docs have been updated (https://next.openhab.org/docs/configuration/transformations.html#script-transformation).

@dandjo
Copy link

dandjo commented Apr 18, 2023

Thanks Richard. A short list of breaking changes here migrating from 4.0.0-M1 or 3.4.X would be great. Would have saved me hours of work trying to figure out why SCRIPT(js:foobar.script) stopped working.

@rkoshak
Copy link

rkoshak commented Apr 18, 2023

The PR that made the change is listed there though. It's #3292.

For the milestones I believe the release notes are completely auto generated from the titles of the issues/prs. I'm not sure there is a place/opportunity to add a custom list of breaking changes for a milestone release.

And then you have to ask is the list breaking changes from M1 or breaking changes from 3.4.2? If the latter, this update actually reverses a breaking change instead of reintroducing one.

@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/preparation-for-oh-4-0-how-to-find-my-js-transformations/146233/5

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Signed-off-by: Jan N. Klug <github@klug.nrw>
GitOrigin-RevId: 95e04fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow inline scripting in SCRIPT transformation
5 participants