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

Idea: CLI argument for dev debug #1625

Open
3 tasks
deathbybandaid opened this issue May 30, 2019 · 4 comments
Open
3 tasks

Idea: CLI argument for dev debug #1625

deathbybandaid opened this issue May 30, 2019 · 4 comments
Labels
Feature Long-term Planning Things that need to happen at some point in the future, but need to NOT happen soon. Low Priority

Comments

@deathbybandaid
Copy link
Contributor

deathbybandaid commented May 30, 2019

08:39 <deathbybandaid> what if there was a sopel argument that could gather some basic
                       info regarding the OS environment, python version, etc,,, that
                       uploads to a pastebin (or something) 
08:40 <deathbybandaid> `SecretAttribute` config options could be kept safe?
08:41 <deathbybandaid> upload as `[REDACTED]`
08:46 <+dgw> Sounds like a good feature idea for helpel

Task list by @dgw:

  • Add platform/OS version to --version output
  • More paths/search locations/etc. either in --version or a new CLI arg
  • Detailed debug output (config values, etc.) to a pastebin through a new CLI command or tool
@dgw dgw added the Feature label May 30, 2019
@dgw
Copy link
Member

dgw commented Dec 12, 2019

Part of this is already there in the --version argument's output:

$ sopel --version
Sopel 7.0.0.dev0 (running on Python 3.6.8)
https://sopel.chat/

If it's just printing the OS platform/version, that probably should exist in the version output too.

More detailed stuff like the path Sopel's running from, search directories for config/plugins/etc., and maybe other stuff could go in another CLI arg (no idea right now what we'd name it).

Pastebinning detailed configuration and other in-the-weeds debug stuff probably belongs as an 8.0 thing, pending #1600 happening (so we can very reliably avoid dumping out keys/passwords/secrets).

@dgw dgw added this to the 7.1.0 milestone Dec 12, 2019
@dgw dgw added the Long-term Planning Things that need to happen at some point in the future, but need to NOT happen soon. label Dec 12, 2019
@dgw dgw modified the milestones: 7.1.0, 8.0.0 Oct 18, 2020
@dgw
Copy link
Member

dgw commented Oct 18, 2020

Punt. But who among us honestly thought this would get done for 7.1? I mean really.

@dgw dgw removed this from the 8.0.0 milestone Jul 14, 2022
@dgw dgw changed the title (rough idea) sopel argument for dev debug Idea: CLI argument for dev debug Jul 14, 2022
@deathbybandaid
Copy link
Contributor Author

Stealing some code from another project that I worked on

    def is_docker(self):
        path = "/proc/self/cgroup"
        if not os.path.isfile(path):
            return False
        with open(path) as f:
            for line in f:
                if re.match("\d+:[\w=]+:/docker(-[ce]e)?/\w+", line):
                    return True
            return False

    def is_virtualenv(self):
        # return True if started from within a virtualenv or venv
        base_prefix = getattr(sys, "base_prefix", None)
        # real_prefix will return None if not in a virtualenv enviroment or the default python path
        real_prefix = getattr(sys, "real_prefix", None) or sys.prefix
        return base_prefix != real_prefix

I think somewhere in the sopel code we also have a check for Windows/Linux/Darwin, as well as a check for if the user is root/Administrator

        opersystem = platform.system()
        system_alias = platform.release()

@deathbybandaid
Copy link
Contributor Author

It might also be helpful for the debug command to list installed sopel plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Long-term Planning Things that need to happen at some point in the future, but need to NOT happen soon. Low Priority
Projects
None yet
Development

No branches or pull requests

3 participants