Skip to content

Conversation

@blag
Copy link
Contributor

@blag blag commented Feb 16, 2021

This PR starts a contributed debug pack that is useful for debugging StackStorm itself.

Right now it only has a few actions:

  • pythonpath returns the PYTHONPATH and the value of sys.path

  • python_version returns the current Python version in a dictionary/object:

    {
      "version": "...",  // from Python's sys.version_info
      "details": {
        "major": ...,  // from Python's sys.version_info.major
        "minor": ...,  // from Python's sys.version_info.minor
        "micro": ...,  // from Python's sys.version_info.micro
        "releaselevel": ...,  // from Python's sys.version_info.releaselevel
        "serial": ...,  // from Python's sys.version_info.serial
      }
    }
  • print_ctx prints the passed-in context dictionary to stdout

I'm sure more ideas will spring up from time to time, and this pack is a good place to add them.

We will need to add some tests, and I think we will eventually want to install this pack by default to help users.

Edit: Updated description with additional actions

@blag blag added this to the 3.5.0 milestone Feb 16, 2021
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Feb 16, 2021
@cognifloyd
Copy link
Member

We just reformatted the code with black. (Hooray!) And this PR got caught in the cross fire. (Arrgh!)
Just merge master to get the black config, and then you can reformat this with black.

@Kami
Copy link
Member

Kami commented Apr 5, 2021

IIRC, we already have a bunch of actions like that in examples pack (and even the one which does exactly the same thing as the one you added) so we should decide what to do - likely the best course of actions is to move all such actions into the new debug + rectify duplication (especially since examples pack is already quite large).

It may require some end to end tests to be updated though.

And overall I like the idea of including it by default - that may be possible with debug pack since it would be much smaller than the examples one.

@amanda11 amanda11 modified the milestones: 3.5.0, 3.6.0 May 4, 2021
@cognifloyd
Copy link
Member

@blag, can you reformat with black and rebase on / merge in master?
I would love to see this in 3.6.0

@blag
Copy link
Contributor Author

blag commented Jul 27, 2021

@Kami Yes, we have the examples pack, but I think we overestimate how useful that is for users, since there's examples for everything in there. I think we should be really judicious about what we move into the debug pack, especially if we're going to install it by default.

Copy link
Contributor

@amanda11 amanda11 left a comment

Choose a reason for hiding this comment

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

LGTM - but just a query on copyright header statement...

@pull-request-size pull-request-size bot added size/L PR that changes 100-499 lines. Requires some effort to review. and removed size/M PR that changes 30-99 lines. Good size to review. labels Jul 30, 2021
@blag
Copy link
Contributor Author

blag commented Jul 30, 2021

I've added a few more actions if people would like to review them.

@cognifloyd
Copy link
Member

debug.python_version and debug.print_ctx look like good, generally useful utilities. Nice!

@blag
Copy link
Contributor Author

blag commented Aug 11, 2021

Possibly blocked by 5257.

Edit: Nope, posted this comment on the wrong PR.

Copy link
Contributor

@amanda11 amanda11 left a comment

Choose a reason for hiding this comment

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

LGTM

@blag blag merged commit 004b7cf into master Aug 12, 2021
@blag blag deleted the add-debug-contrib-pack branch August 12, 2021 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement feature proposal size/L PR that changes 100-499 lines. Requires some effort to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants