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

[4 of #107] replace destructuring with input member access #124

Merged
merged 1 commit into from
Dec 20, 2020

Conversation

bollwyvl
Copy link
Contributor

This finishes the work in #123 by removing the huge object destructuring in setup, and uses inputs.<action input> throughout. It also removes the configuration checks which will have already been handled at parsing time by inputs. This allows for dropping a few imports 🎉.

Follow-ons:

This further reveals condaConfig, and the rest of the "mutable state" during the run is down to:

  const condaConfig = { ...inputs.condaConfig };
  let useBundled: boolean = true;
  let useMamba: boolean = false;

though additional mutable variables get added further down. However, the only part of the condaConfig that gets changed is channels, and actually gets co-mingled with what is read from an environment. Looks like #120 bears on this as well.

Proposal

From 107

**
 * Options that may change during the course of discovery/installation/configuration
 */
export interface IDynamicOptions {
  useBundled: boolean;
  useMamba?: boolean;
  envSpec?: IEnvSpec;
}

There might be a better name, but it's a little easier to demonstrate when the surrounding code is brought over: it replaces most function specs with (inputs, dynamicOptions). Things get a little messy with mamba, etc. but that lies further ahead...

@goanpeca
Copy link
Member

Hi @bollwyvl thanks for working on this. IDynamicOptions sounds good. Do you want to add that to this PR or a separate one?

Cheers!

@bollwyvl
Copy link
Contributor Author

Unless you'd prefer to see the larger story, I feel like +91 −165 is a good place to stop on this one (as it was mostly stuff not done in part 3, due to those other changes). The next one will start to touch a lot more files, but generally in a good way.

@goanpeca goanpeca merged commit 21dbde1 into conda-incubator:master Dec 20, 2020
@goanpeca
Copy link
Member

Let's iterate on this then :)

@goanpeca goanpeca added this to the v2.1.0 milestone Dec 20, 2020
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