ZE API: cannot append properties to a custom profile with user-specific config file
See original GitHub issueDescribe the bug
I have created an additional zowe.config.user.json
file to accompany my zowe.config.json
with existing profiles (see examples in the Additional context section). The idea is to append some user specific fields to the existing profile from global team config using the user-specific config.
But on the initialization of Zowe Explorer API I keep getting the error:
'ProfInfoErr: Failed to find property rejectUnauthorized in the profile base_def'
(to be precise: during the profiles reloading ZoweVsCodeExtension.getZoweExplorerApi().getExplorerExtenderApi().reloadProfiles()
)
In the same time Zowe CLI seems to work good with this setup.
The only workaround I found so far is to duplicate the base_def
profile in the user-specific config, in this case it is possible to pass the profiles reloading and to use the merged profile successfully.
Expected behavior
ZE API should allow to retrieve the profiles merged from global and user configs.
Desktop (please complete the following information):
- OS: MacOS
- Zowe Explorer Version: 2.2.0
- (Optional) Zowe CLI Version: 7.4.0
- (Optional) Are you using Secure Credential Store? Yes
Additional context
We have a zowe.config.json
with some custom profiles:
{
"$schema": "./zowe.schema.json",
"profiles": {
"base_def": {
"type": "base",
"properties": {
"rejectUnauthorized": false
},
"secure": [
"user",
"password"
]
},
"test": {
"type": "endevor",
"properties": {
"host": "test.com",
"port": 1234,
"protocol": "http",
"basePath": "/"
},
"secure": []
},
"test-location": {
"type": "endevor-location",
"properties": {
"instance": "INST",
"environment": "ENV",
"system": "SYS",
"subsystem": "SBS",
"stageNumber": "1",
"type": "*"
},
"secure": []
},
"test-zosmf": {
"type": "zosmf",
"properties": {
"host": "1.2.3.4",
"port": 43,
"protocol": "https"
},
"secure": [
"user",
"password"
]
},
},
"defaults": {
"base": "base_def",
"endevor": "test",
"endevor-location": "test-location",
"zosmf": "test-zosmf"
},
"autoStore": true
}
And a zowe.config.user.json
:
{
"$schema": "./zowe.schema.json",
"profiles": {
"test-location": {
"type": "endevor-location",
"properties": {
"ccid": "develop1",
"comment": "Changes by develop1"
},
"secure": []
}
},
"defaults": {},
"autoStore": true
}
Both are in .zowe
directory.
Zowe CLI output:
❯ zowe config ls
profiles:
base_def:
type: base
properties:
rejectUnauthorized: false
user: (secure value)
password: (secure value)
secure:
- user
- password
test:
type: endevor
properties:
host: test.com
port: 1234
protocol: http
basePath: /
secure:
(empty array)
test-location:
type: endevor-location
properties:
instance: INST
environment: ENV
system: SYS
subsystem: SBS
stageNumber: 1
type: *
ccid: develop1
comment: Changes by develop1
secure:
(empty array)
test-zosmf:
type: zosmf
properties:
host: 1.2.3.4
port: 43
protocol: https
secure:
- user
- password
defaults:
base: base_def
endevor: test
endevor-location: test-location
zosmf: test-zosmf
autoStore: true
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top GitHub Comments
Hi @zFernand0
Good news, I have tested the latest ZE v2.3.0 with our extension and team/user config setup, described above, and now it is initialized properly without errors, yay! Thank you for the help 😃
I have noticed some kind of a related issue for ZE though. Now it does not respect a base profile specified in the User config on the global level (in
~/.zowe
folder), but it seems that it respects it on the project level (if an opened VSCode workspace folder includes Team and User configs). In the same time I tried the same setup with Zowe CLI v7.6.2 and it work fine with the global level User configs too.I must say I do not know where exactly it is expected for User config to be located (probably, most of the time on the project level, not on the global one), but since Zowe CLI support both scenarios, I would expect ZE to do the same. And we actually have some customers who might be interested to specify their base profile in User config, not to be shareable with anyone else.
Examples:
~/.zowe/zowe.config.json
config:And
~/.zowe/zowe.config.user.json
config:Zowe CLI output:
I have even tried this weird flow and it worked:
zowe.config.json
andzowe.config.user.json
configs in~/.zowe
folder.~/.zowe
folder in VSCode (with Open Folder dialog): and now it detects the base profile information.Because of this scenario I have an assumption about that it works only with the project level configs and not global ones. But maybe something else is involved. In the same time Zowe CLI works in all cases, whether you are in the
~/.zowe
folder or in any else.This sounds related to zowe/imperative#881
@roman-kupriyanov, once ZE v2.3 is out, could you confirm if the issue still persists?