Skip to content

Commit f66283f

Browse files
Stubbed out localDev param (#213)
1 parent d97a4a2 commit f66283f

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

src/deploy-actions.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const { createHash } = require('node:crypto')
3333

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

54-
const isLocalDev = deployConfig.isLocalDev // todo: remove
5553
const useForce = deployConfig.useForce
5654
const log = logFunc || console.log
5755
let filterEntities = deployConfig.filterEntities
@@ -147,7 +145,7 @@ async function deployActions (config, deployConfig = {}, logFunc) {
147145
)
148146
// enrich actions array with urls
149147
if (Array.isArray(deployedEntities.actions)) {
150-
const actionUrlsFromManifest = utils.getActionUrls(config, config.actions.devRemote, isLocalDev)
148+
const actionUrlsFromManifest = utils.getActionUrls(config, config.actions.devRemote)
151149
deployedEntities.actions = deployedEntities.actions.map(action => {
152150
const retAction = deepCopy(action)
153151
const url = actionUrlsFromManifest[action.name]

src/utils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,11 +1835,12 @@ function checkOpenWhiskCredentials (config) {
18351835
*
18361836
* @param {object} appConfig app config
18371837
* @param {boolean} isRemoteDev remote dev
1838-
* @param {boolean} isLocalDev local dev
1838+
* @param {boolean} _isLocalDev local dev UNUSED
18391839
* @param {boolean} legacy default false add backwards compatibility for urls keys.
18401840
* @returns {object} urls of actions
18411841
*/
1842-
function getActionUrls (appConfig, /* istanbul ignore next */ isRemoteDev = false, /* istanbul ignore next */ isLocalDev = false, legacy = false) {
1842+
function getActionUrls (appConfig, /* istanbul ignore next */ isRemoteDev = false, /* istanbul ignore next */ _isLocalDev = false, legacy = false) {
1843+
const isLocalDev = false // TODO: clean this all up ... for now the argument is ignored
18431844
// sets action urls [{ name: url }]
18441845
const config = replacePackagePlaceHolder(appConfig)
18451846
const cleanApihost = removeProtocolFromURL(config.ow.apihost)

test/jest.setup.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,6 @@ global.fakeConfig = {
114114
auth: 'fake:auth'
115115
}
116116
},
117-
local: {
118-
runtime: {
119-
defaultApihost: 'https://adobeioruntime.net',
120-
// those must match the once set by dev cmd
121-
apihost: 'http://localhost:3233',
122-
namespace: 'guest',
123-
auth: '23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'
124-
}
125-
},
126117
creds: {
127118
runtime: {
128119
defaultApihost: 'https://adobeioruntime.net',

test/utils.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,11 +2002,11 @@ describe('getActionUrls', () => {
20022002

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

0 commit comments

Comments
 (0)