Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/deploy-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const { createHash } = require('node:crypto')

/**
* @typedef {object} DeployConfig
* @property {boolean} [isLocalDev] local dev flag // todo: remove
* @property {FilterEntities} [filterEntities] add filters to deploy only specified OpenWhisk entities
* @property {boolean} [useForce] force deploy of actions
*/
Expand All @@ -51,7 +50,6 @@ async function deployActions (config, deployConfig = {}, logFunc) {
throw new Error('cannot deploy actions, app has no backend')
}

const isLocalDev = deployConfig.isLocalDev // todo: remove
const useForce = deployConfig.useForce
const log = logFunc || console.log
let filterEntities = deployConfig.filterEntities
Expand Down Expand Up @@ -147,7 +145,7 @@ async function deployActions (config, deployConfig = {}, logFunc) {
)
// enrich actions array with urls
if (Array.isArray(deployedEntities.actions)) {
const actionUrlsFromManifest = utils.getActionUrls(config, config.actions.devRemote, isLocalDev)
const actionUrlsFromManifest = utils.getActionUrls(config, config.actions.devRemote)
deployedEntities.actions = deployedEntities.actions.map(action => {
const retAction = deepCopy(action)
const url = actionUrlsFromManifest[action.name]
Expand Down
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1835,11 +1835,12 @@ function checkOpenWhiskCredentials (config) {
*
* @param {object} appConfig app config
* @param {boolean} isRemoteDev remote dev
* @param {boolean} isLocalDev local dev
* @param {boolean} _isLocalDev local dev UNUSED
* @param {boolean} legacy default false add backwards compatibility for urls keys.
* @returns {object} urls of actions
*/
function getActionUrls (appConfig, /* istanbul ignore next */ isRemoteDev = false, /* istanbul ignore next */ isLocalDev = false, legacy = false) {
function getActionUrls (appConfig, /* istanbul ignore next */ isRemoteDev = false, /* istanbul ignore next */ _isLocalDev = false, legacy = false) {
const isLocalDev = false // TODO: clean this all up ... for now the argument is ignored
// sets action urls [{ name: url }]
const config = replacePackagePlaceHolder(appConfig)
const cleanApihost = removeProtocolFromURL(config.ow.apihost)
Expand Down
9 changes: 0 additions & 9 deletions test/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ global.fakeConfig = {
auth: 'fake:auth'
}
},
local: {
runtime: {
defaultApihost: 'https://adobeioruntime.net',
// those must match the once set by dev cmd
apihost: 'http://localhost:3233',
namespace: 'guest',
auth: '23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'
}
},
creds: {
runtime: {
defaultApihost: 'https://adobeioruntime.net',
Expand Down
10 changes: 5 additions & 5 deletions test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2002,11 +2002,11 @@ describe('getActionUrls', () => {

test('some non web actions, with ui, local dev, custom apihost (localhost), no custom hostname', () => {
const expected = {
'sample-app-1.0.0/action': 'http://localhost:3030/api/v1/web/fake_ns/sample-app-1.0.0/action',
'sample-app-1.0.0/action-sequence': 'http://localhost:3030/api/v1/fake_ns/sample-app-1.0.0/action-sequence',
'sample-app-1.0.0/action-zip': 'http://localhost:3030/api/v1/web/fake_ns/sample-app-1.0.0/action-zip',
'pkg2/thataction': 'http://localhost:3030/api/v1/web/fake_ns/pkg2/thataction',
'pkg2/thatsequence': 'http://localhost:3030/api/v1/web/fake_ns/pkg2/thatsequence'
'sample-app-1.0.0/action': 'https://localhost:3030/api/v1/web/fake_ns/sample-app-1.0.0/action',
'sample-app-1.0.0/action-sequence': 'https://localhost:3030/api/v1/fake_ns/sample-app-1.0.0/action-sequence',
'sample-app-1.0.0/action-zip': 'https://localhost:3030/api/v1/web/fake_ns/sample-app-1.0.0/action-zip',
'pkg2/thataction': 'https://localhost:3030/api/v1/web/fake_ns/pkg2/thataction',
'pkg2/thatsequence': 'https://localhost:3030/api/v1/web/fake_ns/pkg2/thatsequence'
}
config.ow.apihost = 'localhost:3030'
delete config.manifest.full.packages.__APP_PACKAGE__.sequences['action-sequence'].web
Expand Down