Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imperative: ProfileInfo APIs do not isolate operations by layers #2357

Open
zFernand0 opened this issue Nov 8, 2024 · 1 comment
Open

imperative: ProfileInfo APIs do not isolate operations by layers #2357

zFernand0 opened this issue Nov 8, 2024 · 1 comment
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-high Bug for which there may be workaround but limits the usage of the Zowe for major use cases

Comments

@zFernand0
Copy link
Member

Describe the bug

In Zowe Explorer, it is possible to need some degree of isolation between layers in a loadedConfig, even when homeDir and projectDir are specified.

Assume the following config files.

// ~/.zowe/zowe.config.json
{
  "profiles": {
    "global_apiml": { "type":"zosmf", "properties": {"basepath": "global" } },
    "global_base":  { "type":"base",  "properties":{"host":"LPAR_111", "port": 1234, "tokenValue":"XYZ"} },
  },
  "defaults": { "zosmf": "global_apiml",  "base": "global_base" }
}

// ~/Desktop/myProjectDir/zowe.config.json
{
  "profiles": {
    "project_apiml": { "type":"zosmf", "properties": {"basepath": "project" } },
    "project_base":  { "type":"base",  "properties":{"host":"LPAR_222", "port": 5678, "tokenValue": "ABC" } },
  },
  "defaults": { "zosmf": "project_apiml",  "base": "project_base" }
}

Expected and actual results

Assuming this pseudoCode below

const pi /*profile info instance */ = new ProfileInfo("zowe");
await pi.readProfilesFromDisk({ homeDir: "~/.zowe", projectDir:"~/Desktop/myProjectDir" });
const globalApiml = pi.getAllProfiles("zosmf").find(prof => prof.name === "global_apiml");
const profileArgs = pi.mergeArgsForProfile(globalApiml);

I would expect profileArgs to be:

{
  "basepath": "global",
  "host": "LPAR_111",
  "port": 1234,
  "tokenValue": "XYZ"
}

but instead we get:

{
  "basepath": "global",
  "host": "LPAR_222",
  "port": 5678,
  "tokenValue": "ABC"
}

Describe your environment

Zowe V3
Zowe CLI (and SDKs): v8.6.0

Additional context

Related to:

@zFernand0 zFernand0 added bug Something isn't working new The issue wasn't triaged yet labels Nov 8, 2024
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@zFernand0 zFernand0 changed the title imperative: ProfileInfo APIs do not isolate update... operations by layers/workspaces imperative: ProfileInfo APIs do not isolate operations by layers Nov 8, 2024
@JTonda JTonda added priority-medium Not functioning - next quarter if capacity permits severity-high Bug for which there may be workaround but limits the usage of the Zowe for major use cases and removed new The issue wasn't triaged yet labels Nov 11, 2024
@zowe-robot zowe-robot moved this from New Issues to Medium Priority in Zowe CLI Squad Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-high Bug for which there may be workaround but limits the usage of the Zowe for major use cases
Projects
Status: Medium Priority
Development

No branches or pull requests

2 participants