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

fix(cli): Fixes bug with command 'ps -x' (sudo) #3051

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

sbosio
Copy link
Contributor

@sbosio sbosio commented Oct 22, 2024

Description

The command

heroku sudo ps -x -a <private-space-app>

fails currently for Private Space apps because the extended property on the JSON response has many of its properties set to null, giving a TypeError when trying to coerce the null port number to a string.

Here we correct the type definition, allowing for null values on all of the extended properties and handling that case appropriately when building the output table display.

SOC2 Compliance

Slack thread for reference
GUS Work Item

@sbosio sbosio requested a review from a team as a code owner October 22, 2024 15:02
Copy link
Contributor

@eablack eablack left a comment

Choose a reason for hiding this comment

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

Hmm, I'm still seeing an error when i try to run this with your branch:

Screenshot 2024-10-22 at 1 57 48 PM

is it possible we need to add another optional chain here? https://github.com/heroku/cli/pull/3051/files#diff-5d43d9c03ed768f9c4f93c44502238c8961bba579421ce39c334cbdfe20b1f0eR65

@sbosio
Copy link
Contributor Author

sbosio commented Oct 23, 2024

Hmm, I'm still seeing an error when i try to run this with your branch:

Screenshot 2024-10-22 at 1 57 48 PM is it possible we need to add another optional chain here? https://github.com//pull/3051/files#diff-5d43d9c03ed768f9c4f93c44502238c8961bba579421ce39c334cbdfe20b1f0eR65

No, the problem is sudo that will parse arguments and build a command again with the right headers, but using heroku and not ./bin/run, thus effectively using the unpatched version of the ps -x command.

Run tests with:

HEROKU_HEADERS='{"x-heroku-sudo": true}' ./bin/run ps -x -a particleboard-staging

It will require a few times for your 2FA method, but ultimately it will work.

@sbosio sbosio requested a review from eablack October 23, 2024 14:11
Copy link
Contributor

@eablack eablack left a comment

Choose a reason for hiding this comment

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

:shipit:

@sbosio sbosio merged commit eeef085 into main Oct 23, 2024
8 checks passed
@sbosio sbosio deleted the sbosio/fix-ps-x branch October 23, 2024 16:56
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.

2 participants