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

[jrubyscripting] Check if gems are installed before installing them #13151

Merged
merged 2 commits into from
Aug 7, 2022

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Jul 20, 2022

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

@ccutrer ccutrer requested a review from boc-tothefuture as a code owner July 20, 2022 21:30
@ccutrer
Copy link
Contributor Author

ccutrer commented Jul 20, 2022

cc @jimtng

@ccutrer
Copy link
Contributor Author

ccutrer commented Jul 20, 2022

hmm, @jimtng brings up a good point that this would defeat auto-update on restart. will have to think on it...

@ccutrer ccutrer force-pushed the jruby_avoid_duplicate_gem_installs branch from 21bb0a9 to ce25f52 Compare July 26, 2022 15:07
@ccutrer
Copy link
Contributor Author

ccutrer commented Jul 26, 2022

@jimtng : okay, updated now with support for auto-update, and a config option for if you even want auto-update behavior. I am using bundler/inline now (the only way I could figure out how to get it to check-before-installing). I had to pass an explicit true to gemfile in order for it to check for updates every time, instead of only using local gems. It seems to be working for me, but I don't remember what issues we had with bundler/inline before.

@ccutrer ccutrer force-pushed the jruby_avoid_duplicate_gem_installs branch from ce25f52 to 13546ac Compare July 26, 2022 23:24
Copy link
Contributor

@jimtng jimtng left a comment

Choose a reason for hiding this comment

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

I almost forgot - please update the README file to document the new check_update option for file-based configuration

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer force-pushed the jruby_avoid_duplicate_gem_installs branch from 13546ac to 2d5771d Compare July 27, 2022 15:44
@ccutrer
Copy link
Contributor Author

ccutrer commented Jul 27, 2022

README updated

Copy link
Contributor

@jimtng jimtng left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Thanks! Besides the README formatting issue, all LGTM.

bundles/org.openhab.automation.jrubyscripting/README.md Outdated Show resolved Hide resolved
@jlaur
Copy link
Contributor

jlaur commented Jul 31, 2022

@boc-tothefuture - do you also want to have a look?

Copy link
Contributor

@boc-tothefuture boc-tothefuture left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: jimtng <2554958+jimtng@users.noreply.github.com>
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Thanks!

@jlaur jlaur merged commit 70eb7dc into openhab:main Aug 7, 2022
@jlaur jlaur added this to the 3.4 milestone Aug 7, 2022
@jlaur jlaur changed the title [jrubyscripting] check if gems are installed before installing them [jrubyscripting] Check if gems are installed before installing them Aug 8, 2022
@jimtng
Copy link
Contributor

jimtng commented Aug 12, 2022

@kaikreuzer this didn't get mentioned in the 3.4 M1 announcement https://github.com/openhab/openhab-distro/releases/tag/3.4.0.M1

@jlaur
Copy link
Contributor

jlaur commented Aug 13, 2022

this didn't get mentioned in the 3.4 M1 announcement https://github.com/openhab/openhab-distro/releases/tag/3.4.0.M1

This is because it lacks a bug or enhancement label, which I didn't notice previously. I guess it should be enhancement due to the "org.openhab.automation.jrubyscripting:check_update" addition? I'm adding that, so it will be included in the final 3.4 release notes. Feel free to change it.

@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Aug 13, 2022
ccutrer added a commit to ccutrer/openhab-addons that referenced this pull request Aug 27, 2022
jlaur pushed a commit that referenced this pull request Aug 28, 2022
@ccutrer ccutrer deleted the jruby_avoid_duplicate_gem_installs branch September 26, 2022 20:12
leifbladt pushed a commit to leifbladt/openhab-addons that referenced this pull request Oct 15, 2022
…penhab#13151)

* [jrubyscripting] check if gems are installed before installing them

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
leifbladt pushed a commit to leifbladt/openhab-addons that referenced this pull request Oct 15, 2022
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
…penhab#13151)

* [jrubyscripting] check if gems are installed before installing them

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
…penhab#13151)

* [jrubyscripting] check if gems are installed before installing them

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
openhab#13328)

fixes boc-tothefuture/openhab-jruby#634;
regression from openhab#13151

Signed-Off-By: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
marcelGoerentz pushed a commit to marcelGoerentz/openhab-addons that referenced this pull request Nov 14, 2022
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
…penhab#13151)

* [jrubyscripting] check if gems are installed before installing them

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
…penhab#13151)

* [jrubyscripting] check if gems are installed before installing them

this avoids unecessary downloads and overwrites, or even more importantly
errors if the GEM_HOME is not writable by the openhab user.

this also adds a configuration option for if you want to check for
updates every time configuration is applied (or openhab restarts). this
is useful if your OpenHAB system can't access the internet regularly.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
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 for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants