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

Allow opt-out of adding stdout/stderr env variables for remote command #451

Merged
merged 13 commits into from
Jun 17, 2024

Conversation

julsemaan
Copy link
Contributor

@julsemaan julsemaan commented May 24, 2024

Context

At the moment, stdout and stderr of previous runs are passed as environment variables on future invocations. When stdout or stderr is too large, this cause an error.

Proposed change

#355 fixed it for local commands, this fixed it for remote commands. See #285 for full details on the issue

See this comment for details around local vs remote functionality : #285 (comment)

@julsemaan
Copy link
Contributor Author

I wasn't able to successfully write a test for this one given I couldn't use the preview mode and it was trying to actually SSH into hosts. I'm lacking understanding of how to properly mock this within this plugin. Not sure if the PR can still be merged without the test.

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@thomas11
Copy link
Contributor

Thanks for the PR @julsemaan!

The change is simple enough that we could get away without a test. But if you wanted to try your hand at it, I've had success with spinning up a local, in-process SSH server and testing that way. The PR isn't merged yet but you can see it here.

@julsemaan
Copy link
Contributor Author

Hey! If I can get away without a test, I'll take it 😄

I could always implement a test in a follow-up (pinky promess?). I'll be able to reuse some of your code vs doing some copy/pasta

@thomas11
Copy link
Contributor

Sure, I think we can get away with that :)

However, I just noticed that your change is missing adding the new property to Annotate for the description and setting the default to true.

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@julsemaan
Copy link
Contributor Author

Sure, I think we can get away with that :)

However, I just noticed that your change is missing adding the new property to Annotate for the description and setting the default to true.

Good catch, just pushed the change

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@mikhailshilkov
Copy link
Member

@julsemaan For any current reviewers and future readers, could you please update the description of your PR to include a detailed explanation of your change and motivation for doing it?

Here are some example of good PR descriptions: pulumi/pulumi-kubernetes-operator#575, pulumi/pulumi-github#280, pulumi/pulumi#13066.

Thank you for your contribution!

@julsemaan
Copy link
Contributor Author

@julsemaan For any current reviewers and future readers, could you please update the description of your PR to include a detailed explanation of your change and motivation for doing it?

Here are some example of good PR descriptions: pulumi/pulumi-kubernetes-operator#575, pulumi/pulumi-github#280, pulumi/pulumi#13066.

Thank you for your contribution!

Hey! That's done, I could suggest to have a PR template so that contributors know more precisely what is expected to provide when opening a PR. Github makes this quite easy, see https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository

@thomas11
Copy link
Contributor

@julsemaan, on second thought, I believe we should include test coverage here. If you just copy roughly lines 23-53 from here, that should give you the setup to use SSH in your test.

@theneva
Copy link
Contributor

theneva commented Jun 11, 2024

Hi, @julsemaan! Thank you so much for implementing the fix 😄

Given that this whole thing stems from my feature request, and you never asked to dive into the remote command resource, I went ahead and wrote a test that I think does the job. I sent a pull request to your fork here: julsemaan#1

@thomas11 Do you think the test I wrote looks okay? (If yes, I believe you are also able to pull my commit into this PR, assuming Julien turned maintainer edits on.)

Add a test for opting remote commands out of PULUMI_COMMAND_STDOUT env var
@julsemaan
Copy link
Contributor Author

@theneva , thanks for doing the test :) I just pulled it into this branch

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@julsemaan julsemaan requested a review from thomas11 June 11, 2024 16:18
provider/tests/provider_test.go Outdated Show resolved Hide resolved
provider/tests/provider_test.go Outdated Show resolved Hide resolved
@theneva
Copy link
Contributor

theneva commented Jun 13, 2024

@thomas11 Thanks for the review! I tried following your feedback here: https://github.com/julsemaan/pulumi-command/pull/2/files.

Since I don't have push access to the main repo or Julien's fork, this workflow kind of sucks for everyone involved… I think it's easiest if you just look at the PR I sent to Julien's branch in case you have more feedback, so that they don't have to jump for every feedback loop.

(Sorry for all the notifications, @julsemaan 😅)

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@thomas11
Copy link
Contributor

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

@thomas11
Copy link
Contributor

/run-acceptance-tests

@pulumi-bot
Copy link
Contributor

@thomas11 thomas11 merged commit fc0d188 into pulumi:master Jun 17, 2024
8 checks passed
@thomas11
Copy link
Contributor

Merged! Thank you very much for all your efforts, @julsemaan and @theneva!

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.

5 participants