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

Fix logout to give base profile precedence over parent profile #3076

Merged
merged 16 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

- Fixed behavior of logout action when token is defined in both base profile and parent profile. [#3076](https://github.com/zowe/zowe-explorer-vscode/issues/3076)

## `3.0.0-next.202409132122`

### New features and enhancements

- Added optional `patternMatches` property to the `IZoweDatasetTreeNode` interface to cache pattern matches from an applied filter search. [#1164](https://github.com/zowe/zowe-explorer-vscode/issues/1164)

### Bug fixes

- Fix extender's ability to fetch profile information from ProfilesCache for SSH profile types.

## `3.0.0-next.202409091409`

### Bug fixes
Expand Down
45 changes: 4 additions & 41 deletions packages/zowe-explorer-api/src/profiles/ProfilesCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,54 +145,17 @@ export class ProfilesCache {

public async refresh(apiRegister?: IRegisterClient): Promise<void> {
const allProfiles: imperative.IProfileLoaded[] = [];
try {
const mProfileInfo = await this.getProfileInfo();
if (!mProfileInfo.getTeamConfig().exists) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the workaround above was not being used after the merge from next?
either way, thanks for cleaning it up 🙏🏽

const allTypes = this.getAllProfileTypes(apiRegister?.registeredApiTypes() ?? []);
allTypes.push("base");
for (const type of allTypes) {
const tmpAllProfiles: imperative.IProfileLoaded[] = [];
// Step 1: Get all profiles for each registered type
const profilesForType = mProfileInfo.getAllProfiles(type).filter((temp) => temp.profLoc.osLoc?.length > 0);
if (profilesForType && profilesForType.length > 0) {
for (const prof of profilesForType) {
// Step 2: Merge args for each profile
const profAttr = this.getMergedAttrs(mProfileInfo, prof);
// Work-around. TODO: Discuss with imperative team
const profileFix = this.getProfileLoaded(prof.profName, prof.profType, profAttr);
// set default for type
if (prof.isDefaultProfile) {
this.defaultProfileByType.set(type, profileFix);
}

// Step 3: Update allProfiles list
tmpAllProfiles.push(profileFix);
}
allProfiles.push(...tmpAllProfiles);
this.profilesByType.set(type, tmpAllProfiles);
}
}
this.allProfiles = allProfiles;
this.allTypes = allTypes;
for (const oldType of [...this.profilesByType.keys()].filter((type) => !allProfiles.some((prof) => prof.type === type))) {
this.profilesByType.delete(oldType);
this.defaultProfileByType.delete(oldType);
}
// check for proper merging of apiml tokens
this.checkMergingConfigAllProfiles();
this.profilesForValidation = [];
} catch (error) {
this.log.error(error as string);
const mProfileInfo = await this.getProfileInfo();
if (!mProfileInfo.getTeamConfig().exists) {
return;
}
const allTypes = this.getAllProfileTypes(apiRegister?.registeredApiTypes() ?? []);
allTypes.push("ssh");
allTypes.push("base");
for (const type of allTypes) {
const tmpAllProfiles: imperative.IProfileLoaded[] = [];
// Step 1: Get all profiles for each registered type
const profilesForType = mProfileInfo.getAllProfiles(type).filter((temp) => temp.profLoc.osLoc.length !== 0);
const profilesForType = mProfileInfo.getAllProfiles(type).filter((temp) => temp.profLoc.osLoc?.length > 0);
if (profilesForType && profilesForType.length > 0) {
for (const prof of profilesForType) {
// Step 2: Merge args for each profile
Expand Down
11 changes: 11 additions & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

- Fixed behavior of logout action when token is defined in both base profile and parent profile. [#3076](https://github.com/zowe/zowe-explorer-vscode/issues/3076)

## `3.0.0-next.202409132122`

### New features and enhancements

- Implemented support for favoriting a data set search that contains member wildcards. [#1164](https://github.com/zowe/zowe-explorer-vscode/issues/1164)
- Resolved `TypeError: Cannot read properties of undefined (reading 'direction')` error for favorited items. [#3067](https://github.com/zowe/zowe-explorer-vscode/pull/3067)

### Bug fixes

- Fix issue with outdated SSH credentials stored securely in the SSH profile causing errors. [#2901](https://github.com/zowe/zowe-explorer-vscode/issues/2901)

## `3.0.0-next.202409091409`

### Bug fixes
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.