adobe / aio-cli-lib-console Goto Github PK
View Code? Open in Web Editor NEWA library providing command line primitives to interract with the Adobe Developer Console.
Home Page: https://www.adobe.io
License: Apache License 2.0
A library providing command line primitives to interract with the Adobe Developer Console.
Home Page: https://www.adobe.io
License: Apache License 2.0
As a developer / project creator, I can have 2 objectives when creating a project:
During the project creation, I should be offered either just 1 workspace (production
for quick app deployment) or 3 workspaces (production
, staging
and dev
for a clean setup matching also the CI/CD provided)
When a project is created, 2 workspaces are proposed by default: production
and staging
.
If I did not follow a formal training or studied the doc, I do not change the workspace setup (= default is what I should need). Then when I use the cli to create the app and map it to my project, I am asked which workspace I should use: production
or staging
?
staging
workspace.dev
workspace or I will select the staging
which in the future will lead to confusion (how do I switch now to the dev
workspace). Also in this scenario, the CI/CD proposed by default is great, but
stagingand
productionare clearly not to be "touched" by a developer which makes the
dev` workspace mandatory.Conclusion: whatever is your objective, the initial workspaces setup does not match a real life scenario: either the project creator has to delete the staging
workspace or add a required dev
namespace.
These lines:
aio-cli-lib-console/lib/index.js
Lines 349 to 353 in aaf8835
When subscribing to a service with credential type OAuth S2S, we only search for existing credentials of type OAuth S2S (similarly for type JWT). If it doesn't exist for that specific type, we create one of that type.
What the logic should be is:
For an enterprise credential (either OAuth S2S or JWT), check whether there exists a credential of (type OAuth S2S OR type JWT). If no credential exists for either type, we create one of the specified type.
This similar to what is here (lib used to install templates): https://github.com/adobe/aio-lib-console-project-installation/blob/f3c43efded9a1c19c49021632bd9c604fcbb4c48/src/lib/configure-apis.js#L137-L153
CLIs should never require to prompt, to work also with non TTY environments (e.g. CICD).
This is also true for resource creation (create Workspace, Project, add services, ..).
For operations that require many inputs, consider using --input json input files
See related discussion in adobe/generator-aio-app#134
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN [email protected] requires a peer of inquirer@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @adobe/[email protected] requires a peer of eslint-plugin-node@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @adobe/[email protected] requires a peer of eslint-plugin-jsdoc@^21.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] - 6.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
The call to get info on the project ( via consoleApi succeeds, and we get the Production
workspace.
Upon selecting Production
further api calls fail.
๐ฅ๐ aio app use
You are currently in:
1. Org: Adobe IO
2. Project: TwoExtensions
3. Workspace: Stage
? Switch to a new Adobe Developer Console configuration: B. Switch to another Workspace in the current Project
? Select Workspace: Production
โ Retrieving services supported by the Organization... โบ Error: [CoreConsoleAPISDK:ERROR_GET_SERVICES_FOR_ORG] 500 - Internal Server Error ({"id":"9a4760ca-c974-490d-ad0a-f45062f7b5aa"})
โ Retrieving services supported by the Organization...%
System:
OS: macOS 11.4
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 22.79 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.22.1 - ~/.nvm/versions/node/v12.22.1/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.20.1 - ~/.nvm/versions/node/v12.22.1/bin/npm
Virtualization:
Docker: 20.10.5 - /usr/local/bin/docker
npmGlobalPackages:
@adobe/aio-cli: 8.1.0
When creating an app with aio app create
, the console.json
file is created and contains a lot of secrets. It is obvious that the file cannot be committed (which could potentially happen if you do not pay attention or not aware of the file content), and I have been told by @meryllblanchet that the file is useless anyway.
The file is not there when the app has been created.
The file is there, introduces a security risk and is confusing for the developer.
If there is an error during execution and resources where created before, those should be deleted before throwing the error to leave a clean state.
For example, the user selects create new project
which creates a new Console Project, a Stage Workspace and enables Runtime on the Production and Stage Workspace, now suppose there is an error when creating the Stage Workspace, then the User will be left with a partially created Project in Console that would need manual deltion
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.