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 passing peril instance to inline runner #475

Merged
merged 1 commit into from Oct 5, 2020

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Oct 5, 2020

This tries to fix the logic around appending "Peril context" before executing inline runner. Current logic checks for sandbox property but this is never set, so appending peril context is never executed.

From user perspective - this should fix accessing environment variables via peril.env.*, which is currently not working (peril objects is just {}, it doesn't even have .env field)

Closes #474

Comment on lines -105 to +114
if (dangerRuntimeEnv.sandbox) {
// Mutates runtimeEnv.sandbox
await appendPerilContextToDSL(installationRun.iID, undefined, dangerRuntimeEnv.sandbox, peril)
if (dangerRuntimeEnv) {
// Mutates runtimeEnv
await appendPerilContextToDSL(installationRun.iID, undefined, dangerRuntimeEnv, peril)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actual fix - rest of the PR is either forced prettier re-formatting or very minor (not critical) adjustments

Copy link
Member

Choose a reason for hiding this comment

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

It's fine, you can add the param ?w=1 to the PR to get whitespace changes removed from the diff, which made it easier to review

@@ -107,8 +107,7 @@ export async function appendPerilContextToDSL(
sandbox.danger.github.utils = recreateGitHubUtils(api)
}

const anySandbox = sandbox as any
anySandbox.peril = peril
sandbox.peril = peril
Copy link
Contributor Author

@pieh pieh Oct 5, 2020

Choose a reason for hiding this comment

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

changes in this file are not critical - I should be able revert them without any problems if desired (to keep PR a bit leaner)

@orta
Copy link
Member

orta commented Oct 5, 2020

Cool, yeah, looks good to me 👍🏻

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.

environment variable marked in peril.settings.json are not passed to runner
2 participants