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

Reckless update #6158

Merged
merged 11 commits into from Apr 15, 2023
Merged

Conversation

endothermicdev
Copy link
Collaborator

@endothermicdev endothermicdev commented Apr 7, 2023

Removes an extraneous web request, and unnecessary config rewrites. Adds an installer class to support resolution/installation of dependencies and specification of necessary binaries for additional languages.

Based on #6110

Changelog-Changed: Added support for node.js plugin installation via reckless

Copy link
Collaborator

@ShahanaFarooqui ShahanaFarooqui left a comment

Choose a reason for hiding this comment

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

@endothermicdev The code has mostly been executed really well and I enjoyed testing it. Looking forward to use it soon in applications. Below are my testing results:

  • Works well with symlink and the file both.
  • "if LIGHTNING_CLI_CALL is None" did throw an error for me.
    Changing the check to "if LIGHTNING_CLI_CALL == [None]" fixed the issue and found the cli.
  • tools/reckless -l "/.../.lightning" -c "/.../.lightning/config" --network "testnet" search "c-lightning-rest"
    Error: Unable to locate source for plugin c-lightning-rest. Should add case sensitive message?
  • source rm/source rem/source remove/source add: These commands do not throw any error/info message if called without params.
  • tools/reckless -l "/.../.lightning" -c "/.../.lightning/config" --network "testnet" source add https://github.com/Ride-The-Lightning/c-lightning-REST
    Can we add a success message or return a list of sources once successful?
  • tools/reckless -l "/.../.lightning" -c "/.../.lightning/config" --network "testnet" source remove "https://github.com/Ride-The-Lightning/c-lightning-REST"
    Error: File "/home/shahana/workspace/lightning/tools/reckless", line 208, in obtain_config
    assert isinstance(config_path, str)
    AssertionError
    Remove is not working for all sources.
  • tools/reckless -l "/.../.lightning" -c "/.../.lightning/config" --network "testnet" source add dummy
    Didn't throw any error but didn't add dummy in the sources list as well
  • Call enable before install: tools/reckless -l "/.../.lightning" -c "/.../.lightning/config" --network "testnet" enable c-lightning-REST
    File "/home/shahana/workspace/lightning/tools/reckless", line 350, in init
    raise Exception(f"Could not find a reckless directory for {name}")
    Exception: Could not find a reckless directory for c-lightning-REST
  • Should npm install be executed with --omit=dev option.
  • <Popen: returncode: None args: ['npm', 'install']> shows "dependencies installed successfully" message but <Popen: returncode: None args: ['pip', 'install', '-e', '.']>
    shows "error encountered installing dependencies"
  • tools/reckless -l "/.../.lightning" -c "/.../.lightning/config" --network "testnet" -v install donations
    Error: No file/folder found for package cln-plugins-donations
  • I was unable to install the c-lightning-REST plugin without commenting plugin test code from line 532 till 545. Install works as expected after that.
  • Should universal_newlines be changed to text as it is deprecated since Python 3.7.

Please note that I spent most of my time on testing the plugin rather than reviewing the code as @cdecker will do it much better than me :).

@endothermicdev
Copy link
Collaborator Author

Did some cleanup and addressed several of these points @ShahanaFarooqui. I'll take another look at some of the failure responses (though these often only show up with the verbose flag.)

"pip install -e ." installs from the pyproject.toml file, which I believe is generally geared toward developer usage (i.e., poetry install.) I debated whether I should include this method at all as it's only a fallback when a requirements.txt is missing. It works sometimes, but it less reliable outside of a separate virtual environment. Maybe it's best to not include this? Alternatively it could provide a warning and prompt the user to ask the developer for a requirement.txt.

@endothermicdev endothermicdev force-pushed the reckless-update branch 4 times, most recently from 8f815d8 to 67012ae Compare April 13, 2023 21:44
@ShahanaFarooqui
Copy link
Collaborator

ACK 67012ae

Also cleans up verbose logic
This abstracts the installation procedure to allow generic operations
such as dependency installation to be performed for languages.
Also removes support for pip editable install using pyproject.toml
`pip install -e .` This was a fallback method when a requirements
file was not present, but was hacky and often failed anyway.

reckless: remove installation via pyproject.toml

This method relied on pip install in editable mode (hacky) and often
failed to complete anyhow.  We should instead encourage a requirements
file to be created/used for user installation.
Also adds a timeout when testing a plugin.  Previously the behavior
of pyln-client was relied upon to exit if not communicating with
lightningd, however, this behavior is not universal.

Changlelog-Changed: reckless now installs node.js plugins
When enabling or disabling a plugin, the entrypoint is inferred
from the user provided name. A canonical name should be used, which
the installer entrypoint formats help to determine (this generally strips
the file extension if one is provided.)
Adds a test to validate case matching.
@ShahanaFarooqui
Copy link
Collaborator

Changelog-Changed: Added support for node.js plugin installation via reckless

ACK 9daa6cb

@ShahanaFarooqui ShahanaFarooqui merged commit f731695 into ElementsProject:master Apr 15, 2023
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants