github / safe-settings

ISC License
561 stars 137 forks source link

plugins/environments.js: Fix creation of new environments #616

Open klutchell opened 2 months ago

klutchell commented 2 months ago

Currently if environments do not exist in the target repository, they cannot be created if all properties are not populated.

This PR performs a lint of the environments plugin file (first commit) before adding new test cases to cover the creation of environments that do not exist.

The command eslint --fix ./lib/plugins/environments.js was used to lint the plugin and some variable names were updated to camel case manually.

stevoland commented 2 months ago

@klutchell Would you mind saying why you decided to close? Thanks

klutchell commented 2 months ago

@klutchell Would you mind saying why you decided to close? Thanks

I might reopen, but I noticed that running this build in production was able to create new environments but did not add any environment variables. I quickly closed the PR until I can verify that it's not doing more harm than good.

I suspect setting of environment variables is also broken in some way, I just want to check that I didn't introduce the issue.

klutchell commented 1 month ago

I suspect this is resolved by https://github.com/github/safe-settings/pull/612, marking as draft for now

klutchell commented 3 weeks ago

This is ready for review & merge now, I've confirmed locally that it is able to create new environments and add variables.

klutchell commented 3 weeks ago

How does this change look to you @decyjphr ?