adobe / adobe/aio-cli

Align configuration support across plugins

Open
#256 10 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
95
Forks
45
PR merge metrics
No merged PRs in 30d

Description

This issue updates and generalizes the discussion in https://github.com/adobe/aio-cli-plugin-console/issues/149 to the whole CLI.

This is the result of an internal team discussion, points mentioned here were brought by @Himavanth @meryllblanchet @purplecabbage @rajarju @shazron @sandeep-paliwal

## Problem statement

We observed a confusion from our users when working with the `global` (`~/.config/aio`) and `local` (`.env` and `.aio`) configuration. Plugins do not all support `global` and `local` configurations in the same way.

More precisely what we call `local` configuration is actually the `app` configuration, and what we call `global` configuration is the `cli` configuration.

## Identified issues - Propositions

### Configuration display

`aio where` shows only the `cli` console configuration, for example
```
> aio where
You are currently in:
1. Org: company
2. Project: coolproject
3. Workspace: Production
```

This brings confusion when running the command from an application folder. Instead a better solution would be to print out the `cli` and the `app` config (if any).

```
> aio where

Your application is in:
1. Org: company2
2. Project: coolproject2
3. Workspace: Stage

Your CLI is in:
1. Org: company
2. Project: coolproject
3. Workspace: Production
```

Or

```
> aio where

Your are not in an application folder

Your CLI is in:
1. Org: company
2. Project: coolproject
3. Workspace: Production
```

Also note that `aio where` is not the only command that prints the Console configuration. The same happens in `aio login`, `aio-cli-plugin-events` and other places that we need to review.

As mentioned in https://github.com/adobe/aio-cli-plugin-console/issues/149 there might be an opportunity to unify the config output logic in a single library.

### `aio app use` rewrites `cli` config

Updates to the `app` configuration via `aio app use` in a local application folder, will overwrite the global `cli` config, this should not happen.

### `aio console workspace select` should import credentials for `aio-cli-plugin-runtime`

The Runtime plugin supports both the `app` and `cli` configuration, however selecting a new `workspace` via `aio console select workspace` does not import the Runtime credentials, meaning the Runtime credentials must be set manually in `~/.config/aio`. There is an opportunity for improvement here.

### Support for multiple environments (1st party)

Adobe internally uses multiple environments to test its services. Our `app` and `cli` configuration system should be capable of holding multiple simultaneous configs for each environment, for example a `stage` and `prod` config could live together.

## Investigate and unify experience

On top of the issues mentioned above, a review on how each plugin interacts with the `app` and the `cli` configuration is necessary to identify what could be done to unify the configuration experience.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.