Skip to content

Commit

Permalink
Merge branch 'main' into feat/save-sort
Browse files Browse the repository at this point in the history
Signed-off-by: Buckminsterfullerene02 <[email protected]>
  • Loading branch information
Buckminsterfullerene02 authored Mar 6, 2025
2 parents 96ad743 + 8e57200 commit 696ff7e
Show file tree
Hide file tree
Showing 93 changed files with 3,919 additions and 1,543 deletions.
2 changes: 1 addition & 1 deletion .github/release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
{
name: "release/3.*",
channel: "latest",
level: "patch"
level: "minor"
}
// {
// name: "next",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
audit:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
jobs:
processLabelAction:
name: Process Label Action
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
changelog:
if: ${{ contains( github.event.pull_request.labels.*.name, 'no-changelog') != true }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/circular-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
circular-deps:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
analyze:
name: Analyze with CodeQL
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
jobs:
release:
if: github.event_name == 'workflow_dispatch' || github.ref_protected
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-by-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
rfr_add_date:
name: "Post merge-by date as comment"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-by-table.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:
rfr_add_date:
name: "Build table and notify users"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
discussions: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
stale:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/stale@v9
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
jobs:
update-project:
name: Move project item
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: zowe-actions/shared-actions/project-move-item@main
if: ${{ github.event.issue && fromJSON(env.ISSUE_STATUSES)[github.event.label.name] }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/zowe-explorer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
node-version: [18.x, 20.x, 22.x]
# order operating systems from best to worst
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-latest, ubuntu-22.04, macos-latest]

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')

Expand Down Expand Up @@ -56,17 +56,17 @@ jobs:

- name: Unlock Keyring
id: unlock-keyring
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
uses: t1m0thyj/unlock-keyring@v1

- name: Integration tests
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
run: xvfb-run pnpm test:integration --exclude "Activation.feature"
working-directory: packages/zowe-explorer

- name: Upload test results
uses: actions/upload-artifact@v4
if: always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
with:
name: zowe-explorer-results
path: |
Expand All @@ -75,7 +75,7 @@ jobs:
- name: Upload API test results
uses: actions/upload-artifact@v4
if: always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
with:
name: zowe-explorer-api-results
path: packages/zowe-explorer-api/results/
Expand All @@ -87,12 +87,12 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Package VSIX
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
run: pnpm package
working-directory: packages/zowe-explorer

- name: Archive VSIX artifact
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
uses: actions/upload-artifact@v4
with:
name: zowe-explorer-vsix
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/zowe-explorer-ftp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
matrix:
node-version: [18.x, 20.x, 22.x]
# order operating systems from best to worst
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-latest, ubuntu-22.04, macos-latest]

if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, '[ci skip]')

Expand All @@ -53,25 +53,25 @@ jobs:

- name: Upload test results
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
with:
name: zowe-explorer-ftp-extension-results
path: packages/zowe-explorer-ftp-extension/results/

# Run codecov upload for only one run
# - name: Upload Results to Codecov
# if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
# if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
# uses: codecov/codecov-action@v3
# with:
# env_vars: OS,NODE

- name: Package VSIX
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
run: pnpm package
working-directory: packages/zowe-explorer-ftp-extension

- name: Archive VSIX artifact
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
if: matrix.os == 'ubuntu-22.04' && matrix.node-version == '20.x'
uses: actions/upload-artifact@v4
with:
name: zowe-explorer-ftp-extension-vsix
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.1.0-SNAPSHOT",
"version": "3.2.0-SNAPSHOT",
"command": {
"version": {
"forcePublish": true,
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-plugin-zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to the "eslint-plugin-zowe-explorer" package will be documen

### Bug fixes

## `3.1.1`

## `3.1.0`

## `3.0.3`

## `3.0.2`
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-zowe-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-zowe-explorer",
"version": "3.1.0-SNAPSHOT",
"version": "3.2.0-SNAPSHOT",
"description": "Custom ESLint Rules for ZOWE Explorer",
"keywords": [
"eslint",
Expand Down
18 changes: 16 additions & 2 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t

### New features and enhancements

- Added new `copyDataSetCrossLpar` API to provide ability to copy/paste data sets across LPARs. [#3012](https://github.com/zowe/zowe-explorer-vscode/issues/3012)
- Added new `fetchAttributes` API to `IZoweUSSTreeNode` to fetch latest attributes for UNIX files. [#3238](https://github.com/zowe/zowe-explorer-vscode/issues/3238)
- Added new `directConnectLogin` and `directConnectLogout` to the ZoweVsCodeExtension class. [#3346](https://github.com/zowe/zowe-explorer-vscode/issues/3346)
- Added new optional `refreshFavorites` to IZoweTree interface. [#3470](https://github.com/zowe/zowe-explorer-vscode/issues/3470)

### Bug fixes

- Fixes an issue where properties of the `TableViewProvider` class were not accessible when the class was extended by developers. [#3456](https://github.com/zowe/zowe-explorer-vscode/pull/3456)
- Fixed issue where the `AuthHandler.waitForUnlock` function could hang indefinitely if the profile is never unlocked. Now, as a safety measure, the function returns after a 30-second timeout. This function should be used alongside the `AuthHandler.isProfileLocked` function to verify that the profile is unlocked before making API requests. [#3480](https://github.com/zowe/zowe-explorer-vscode/pull/3480)

## `3.1.1`

## `3.1.0`

### New features and enhancements

- Update Zowe SDKs to `8.10.4` to get the latest enhancements from Imperative and the z/OS Files SDK. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added new `searchDataSets` API to provide the ability to search all data sets and PDS members that match a pattern for a string. [#3306](https://github.com/zowe/zowe-explorer-vscode/pull/3306)
- Added support for extenders to obtain an updated Session that will includes VS Code proxy settings values if set, `getProfileSessionWithVscProxy`. [#3010](https://github.com/zowe/zowe-explorer-vscode/issues/3010)
Expand All @@ -15,8 +31,6 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t
- Added an `AuthHandler` class with functions for locking/unlocking profiles, prompting for credentials and SSO login support. Extenders can now lock profiles after an authentication error, ensuring that an invalid profile is not used asynchronously until the error is resolved. [#3329](https://github.com/zowe/zowe-explorer-vscode/issues/3329)
- Added individual user settings for MVS, TSO, and Unix commands. [#3079](https://github.com/zowe/zowe-explorer-vscode/pull/3079)

### Bug fixes

## `3.0.3`

### Bug fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,60 @@ import { AuthPromptParams } from "@zowe/zowe-explorer-api";

const TEST_PROFILE_NAME = "lpar.zosmf";

describe("AuthHandler.disableLocksForType", () => {
it("removes the profile type from the list of profile types w/ locks enabled", () => {
AuthHandler.disableLocksForType("zosmf");
expect((AuthHandler as any).enabledProfileTypes.has("zosmf")).toBe(false);
});
});

describe("AuthHandler.enableLocksForType", () => {
it("adds the profile type to the list of profile types w/ locks enabled", () => {
AuthHandler.enableLocksForType("sample-type");
expect((AuthHandler as any).enabledProfileTypes.has("sample-type")).toBe(true);

// cleanup for other tests
(AuthHandler as any).enabledProfileTypes.delete("sample-type");
});
});

describe("AuthHandler.waitForUnlock", () => {
it("calls Mutex.waitForUnlock if the profile lock is present", async () => {
// Used so that `setTimeout` can be invoked from 30sec timeout promise
jest.useFakeTimers();
const mutex = new Mutex();
const isLockedMock = jest.spyOn(mutex, "isLocked").mockReturnValueOnce(true);
const waitForUnlockMock = jest.spyOn(mutex, "waitForUnlock").mockResolvedValueOnce(undefined);
(AuthHandler as any).profileLocks.set(TEST_PROFILE_NAME, mutex);
await AuthHandler.waitForUnlock(TEST_PROFILE_NAME);
expect(isLockedMock).toHaveBeenCalled();
expect(waitForUnlockMock).toHaveBeenCalled();
(AuthHandler as any).profileLocks.clear();
});
it("does nothing if the profile lock is not in the profileLocks map", async () => {
const waitForUnlockMock = jest.spyOn(Mutex.prototype, "waitForUnlock");
await AuthHandler.waitForUnlock(TEST_PROFILE_NAME);
expect(waitForUnlockMock).not.toHaveBeenCalled();
});
});

describe("AuthHandler.unlockAllProfiles", () => {
it("unlocks all profiles in the AuthHandler.profileLocks map", async () => {
const mutexAuthPrompt = new Mutex();
const mutexProfile = new Mutex();
const releaseAuthPromptMutex = jest.spyOn(mutexAuthPrompt, "release");
const releaseProfileMutex = jest.spyOn(mutexProfile, "release");
(AuthHandler as any).authPromptLocks.set(TEST_PROFILE_NAME, mutexAuthPrompt);
(AuthHandler as any).profileLocks.set(TEST_PROFILE_NAME, mutexProfile);

AuthHandler.unlockAllProfiles();
expect(releaseAuthPromptMutex).toHaveBeenCalledTimes(1);
expect(releaseProfileMutex).toHaveBeenCalledTimes(1);
(AuthHandler as any).authPromptLocks.clear();
(AuthHandler as any).profileLocks.clear();
});
});

describe("AuthHandler.isProfileLocked", () => {
it("returns true if the profile is locked", async () => {
await AuthHandler.lockProfile(TEST_PROFILE_NAME);
Expand All @@ -34,6 +88,17 @@ describe("AuthHandler.isProfileLocked", () => {
});

describe("AuthHandler.lockProfile", () => {
it("does not acquire a Mutex if the profile type doesn't have locks enabled", async () => {
const acquireMutex = jest.spyOn(Mutex.prototype, "acquire");
await AuthHandler.lockProfile({
profile: {},
type: "sample-type",
message: "",
failNotFound: false,
});
expect(acquireMutex).not.toHaveBeenCalled();
});

it("assigns and acquires a Mutex to the profile in the profile map", async () => {
await AuthHandler.lockProfile(TEST_PROFILE_NAME);
expect((AuthHandler as any).profileLocks.has(TEST_PROFILE_NAME)).toBe(true);
Expand Down Expand Up @@ -157,3 +222,12 @@ describe("AuthHandler.unlockProfile", () => {
expect(reloadWorkspaceMock).toHaveBeenCalledWith(TEST_PROFILE_NAME);
});
});

describe("AuthHandler.shouldHandleAuthError", () => {
it("returns true if a credential prompt was not yet shown to the user", async () => {
await expect(AuthHandler.shouldHandleAuthError(TEST_PROFILE_NAME)).resolves.toBe(true);
});
it("returns false if the user is currently responding to a credential prompt", async () => {
await expect(AuthHandler.shouldHandleAuthError(TEST_PROFILE_NAME)).resolves.toBe(false);
});
});
Loading

0 comments on commit 696ff7e

Please sign in to comment.