Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adobe/aio-cli-plugin-app
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 13.1.0
Choose a base ref
...
head repository: adobe/aio-cli-plugin-app
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 13.1.1
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Nov 15, 2024

  1. do not force login if deploy with --no-publish (#819)

    purplecabbage authored Nov 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    31b7a9e View commit details
  2. 13.1.1

    purplecabbage committed Nov 15, 2024
    Copy the full SHA
    fff2504 View commit details
Showing with 61 additions and 40 deletions.
  1. +29 −29 README.md
  2. +1 −1 package.json
  3. +1 −2 src/commands/app/deploy.js
  4. +23 −8 src/lib/app-helper.js
  5. +7 −0 test/commands/lib/app-helper.test.js
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ DESCRIPTION
Create, run, test, and deploy Adobe I/O Apps
```

_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/index.js)_
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/index.js)_

## `aio app add`

@@ -90,7 +90,7 @@ DESCRIPTION
Add a new component to an existing Adobe I/O App
```

_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/index.js)_
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/index.js)_

## `aio app add action`

@@ -115,7 +115,7 @@ ALIASES
$ aio app add actions
```

_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/action.js)_
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/action.js)_

## `aio app add ci`

@@ -133,7 +133,7 @@ DESCRIPTION
Add CI files
```

_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/ci.js)_
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/ci.js)_

## `aio app add event`

@@ -158,7 +158,7 @@ ALIASES
$ aio app add events
```

_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/event.js)_
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/event.js)_

## `aio app add extension`

@@ -184,7 +184,7 @@ ALIASES
$ aio app add extensions
```

_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/extension.js)_
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/extension.js)_

## `aio app add service`

@@ -208,7 +208,7 @@ ALIASES
$ aio app add services
```

_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/service.js)_
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/service.js)_

## `aio app add web-assets`

@@ -229,7 +229,7 @@ DESCRIPTION
Add web assets support
```

_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/add/web-assets.js)_
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/add/web-assets.js)_

## `aio app build`

@@ -259,7 +259,7 @@ DESCRIPTION
Use the --force-build flag to force a build even if one already exists.
```

_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/build.js)_
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/build.js)_

## `aio app create [PATH]`

@@ -281,7 +281,7 @@ DESCRIPTION
Create a new Adobe I/O App with default parameters
```

_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/create.js)_
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/create.js)_

## `aio app delete`

@@ -299,7 +299,7 @@ DESCRIPTION
Delete a component from an existing Adobe I/O App
```

_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/delete/index.js)_
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/delete/index.js)_

## `aio app delete action [ACTION-NAME]`

@@ -325,7 +325,7 @@ ALIASES
$ aio app delete actions
```

_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/delete/action.js)_
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/delete/action.js)_

## `aio app delete ci`

@@ -344,7 +344,7 @@ DESCRIPTION
Delete existing CI files
```

_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/delete/ci.js)_
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/delete/ci.js)_

## `aio app delete extension`

@@ -370,7 +370,7 @@ ALIASES
$ aio app delete extensions
```

_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/delete/extension.js)_
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/delete/extension.js)_

## `aio app delete service`

@@ -394,7 +394,7 @@ ALIASES
$ aio app delete services
```

_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/delete/service.js)_
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/delete/service.js)_

## `aio app delete web-assets`

@@ -413,7 +413,7 @@ DESCRIPTION
Delete existing web assets
```

_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/delete/web-assets.js)_
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/delete/web-assets.js)_

## `aio app deploy`

@@ -459,7 +459,7 @@ DESCRIPTION
Use the --force-deploy flag to force deploy changes, regardless of production Workspace being published in Exchange.
```

_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/deploy.js)_
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/deploy.js)_

## `aio app get-url [ACTION]`

@@ -482,7 +482,7 @@ DESCRIPTION
Get action URLs
```

_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/get-url.js)_
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/get-url.js)_

## `aio app info`

@@ -504,7 +504,7 @@ DESCRIPTION
Display settings/configuration in use by an Adobe I/O App
```

_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/info.js)_
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/info.js)_

## `aio app init [PATH]`

@@ -543,7 +543,7 @@ DESCRIPTION
Create a new Adobe I/O App
```

_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/init.js)_
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/init.js)_

## `aio app install PATH`

@@ -566,7 +566,7 @@ DESCRIPTION
This command will support installing apps packaged by 'aio app pack'.
```

_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/install.js)_
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/install.js)_

## `aio app list`

@@ -584,7 +584,7 @@ DESCRIPTION
List components for Adobe I/O App
```

_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/list/index.js)_
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/list/index.js)_

## `aio app list extension`

@@ -609,7 +609,7 @@ ALIASES
$ aio app list extensions
```

_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/list/extension.js)_
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/list/extension.js)_

## `aio app logs`

@@ -633,7 +633,7 @@ DESCRIPTION
Fetch logs for an Adobe I/O App
```

_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/logs.js)_
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/logs.js)_

## `aio app pack [PATH]`

@@ -655,7 +655,7 @@ DESCRIPTION
This command will support packaging apps for redistribution.
```

_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/pack.js)_
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/pack.js)_

## `aio app run`

@@ -679,7 +679,7 @@ DESCRIPTION
Run an Adobe I/O App
```

_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/run.js)_
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/run.js)_

## `aio app test`

@@ -707,7 +707,7 @@ DESCRIPTION
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
```

_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/test.js)_
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/test.js)_

## `aio app undeploy`

@@ -732,7 +732,7 @@ DESCRIPTION
Undeploys an Adobe I/O App
```

_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/undeploy.js)_
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/undeploy.js)_

## `aio app use [CONFIG_FILE_PATH]`

@@ -779,5 +779,5 @@ DESCRIPTION
page in https://developer.adobe.com/console/
```

_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.0/src/commands/app/use.js)_
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.1.1/src/commands/app/use.js)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@adobe/aio-cli-plugin-app",
"description": "Create, Build and Deploy Adobe I/O Applications",
"version": "13.1.0",
"version": "13.1.1",
"author": "Adobe Inc.",
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
"dependencies": {
3 changes: 1 addition & 2 deletions src/commands/app/deploy.js
Original file line number Diff line number Diff line change
@@ -43,7 +43,6 @@ class Deploy extends BuildCommand {

// if there are no extensions, then set publish to false
flags.publish = flags.publish && !isStandaloneApp

if (
(!flags.publish && !flags['web-assets'] && !flags.actions)
) {
@@ -53,7 +52,7 @@ class Deploy extends BuildCommand {

try {
const aioConfig = (await this.getFullConfig()).aio
const cliDetails = await getCliInfo()
const cliDetails = await getCliInfo(flags.publish)

// 1. update log forwarding configuration
// note: it is possible that .aio file does not exist, which means there is no local lg config
31 changes: 23 additions & 8 deletions src/lib/app-helper.js
Original file line number Diff line number Diff line change
@@ -180,15 +180,30 @@ function wrapError (err) {
return new Error(message)
}

/** @private */
async function getCliInfo () {
await context.setCli({ 'cli.bare-output': true }, false) // set this globally

/**
* getCliInfo
*
* @private
*
* @param {boolean} useForce - if true, user will be forced to login if not already logged in
* @returns {Promise<{accessToken: string, env: string}>} accessToken and env
*/
async function getCliInfo (useForce = true) {
const env = getCliEnv()

aioLogger.debug(`Retrieving CLI Token using env=${env}`)
const accessToken = await getToken(CLI)

let accessToken
await context.setCli({ 'cli.bare-output': true }, false) // set this globally
if (useForce) {
aioLogger.debug('Retrieving CLI Token using force=true')
accessToken = await getToken(CLI)
} else {
aioLogger.debug('Retrieving CLI Token using force=false')
// in this case, the user might be logged in, but we don't want to force them
// we just check the config for the token ( we still use the cli context so we don't need to know
// the inner workings of ims-lib and where it stores access tokens)
// todo: this is a workaround, we should have a better way to check if the user is logged in (in ims-lib)
const contextConfig = await context.getCli()
accessToken = contextConfig?.access_token?.token
}
return { accessToken, env }
}

7 changes: 7 additions & 0 deletions test/commands/lib/app-helper.test.js
Original file line number Diff line number Diff line change
@@ -906,6 +906,13 @@ describe('getCliInfo', () => {
{ accessToken: 'stoken', env: 'stage' }
)
})
test('useForceFalse', async () => {
libEnv.getCliEnv.mockReturnValue('prod')
libIms.getToken.mockResolvedValue('asdasd')
const res = await appHelper.getCliInfo(false)
expect(res).toEqual({ accessToken: undefined, env: 'prod' })
expect(libIms.getToken).toHaveBeenCalledTimes(0)
})
})

describe('createWebExportFilter', () => {