diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index 34c46825c..000000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Setup action" -description: "Prepares for execution - set up Java, Kotlin, Gradle" - -inputs: - jdkVersion: - description: "JDK version" - required: false - default: "11" - -runs: - using: "composite" - steps: - - name: Set up JDK ${{ inputs.jdkVersion }} - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: ${{ inputs.jdkVersion }} - - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - gradle-version: 7.6.1 - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - shell: bash - - - name: Bootstrap gradlew - run: ./gradle/bootstrap/bootstrap_gradlew.sh - shell: bash diff --git a/.github/actions/sonar/action.yml b/.github/actions/sonar/action.yml index 2eed51c1e..737802165 100644 --- a/.github/actions/sonar/action.yml +++ b/.github/actions/sonar/action.yml @@ -6,7 +6,7 @@ runs: using: composite steps: - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.sonar/caches key: ${{ runner.os }}-sonar @@ -15,8 +15,8 @@ runs: - name: Code coverage and publish results shell: bash run: > - ./gradlew --info sonarqube + ./gradlew --info sonar -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=512m" -Dresults="build/reports/tests/test,build/test-results/test,build/reports/kover/html" - -Psonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN + -Psonar.host.url=$SONAR_HOST_URL -Dsonar.token=$SONAR_TOKEN -Dsonar.coverage.jacoco.xmlReportPaths="build/reports/kover/xml/report.xml" diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml deleted file mode 100644 index 1fa5d26be..000000000 --- a/.github/workflows/build-deploy.yml +++ /dev/null @@ -1,114 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Build with Gradle + Deploy - -on: - push: - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout of github repository - uses: actions/checkout@v3 - - - name: Setup of environment - uses: ./.github/actions/setup - - - name: Check repopository content - shell: bash - run: pwd && ls -la - - - name: Cache Gradle packages - uses: actions/cache@v1 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - - name: Build with Gradle - run: gradle wrapper && ./gradlew buildPlugin - shell: bash - - - name: Run tests - run: ./gradlew test - shell: bash - - - name: Sonarcloud scans - uses: ./.github/actions/sonar - env: - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} - - - name: Publish built plugin - uses: actions/upload-artifact@v3 - with: - name: builtPlugin - path: ./build/distributions/ - - - # deploy: - # needs: build - - # runs-on: XBY_IJMP_machine - - # concurrency: built-plugin - # environment: - # name: built-plugin - # TODO: use secrets! - # url: http://178.172.233.157/plugin-builds/${{steps.extract_branch.outputs.BRANCH_NAME}}/${{ steps.generate_file_name.outputs.NEW_FILE_NAME }} - - # steps: - # - name: Extract branch name - # id: extract_branch - # shell: bash - # run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT - - # - name: Check current directory - # shell: bash - # run: pwd && ls -la - - # - name: Download artifacts - # uses: actions/download-artifact@v3 - # with: - # name: builtPlugin - # path: ./build/distributions/ - - # - name: Check plugin built availability - # shell: bash - # run: ls -la ./build/distributions - - # - name: Get name of build plugin archive - # id: getting_file_name - # shell: bash - # run: > - # CURRENT_FILE_NAME_PATH=$(echo $(find build -name "zowe-explorer*")) && - # echo "Name of current file: $CURRENT_FILE_NAME_PATH" && - # echo "CURRENT_FILE_NAME_PATH=$CURRENT_FILE_NAME_PATH" >> $GITHUB_OUTPUT - - # - name: Generate new name for built plugin - # id: generate_file_name - # shell: bash - # run: > - # TEMP_VAR=${{ steps.getting_file_name.outputs.CURRENT_FILE_NAME_PATH }} - # NEW_FILE_NAME="$(echo ${TEMP_VAR%.zip*})."$(date +"%Y-%m-%dT%H:%M:%S%:z" | tr ':' _)".zip" && - # NEW_FILE_NAME=${NEW_FILE_NAME##*/} && - # echo "Name of new file: $NEW_FILE_NAME" && - # echo "NEW_FILE_NAME=$NEW_FILE_NAME" >> $GITHUB_OUTPUT - - # - name: Move built plugin to destination folder - # shell: bash - # run: > - # mkdir -p /var/www/plugin-builds/${{ steps.extract_branch.outputs.BRANCH_NAME }} && - # mv ${{ steps.getting_file_name.outputs.CURRENT_FILE_NAME_PATH }} /var/www/plugin-builds/${{ steps.extract_branch.outputs.BRANCH_NAME }}/${{ steps.generate_file_name.outputs.NEW_FILE_NAME }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..bac65558a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,165 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Build + Test&Sonar + Verify + +on: [push, workflow_dispatch] + +permissions: + contents: read + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + outputs: + pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} + steps: + + - name: Checkout the plugin GitHub repository + uses: actions/checkout@v4 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 11 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + + - name: Check repository content + shell: bash + run: pwd && ls -la + + - name: Fetch Gradle properties + id: properties + env: + AUTO_SNAPSHOT_VERSION: false + shell: bash + run: | + PROPERTIES="$(./gradlew properties --console=plain -q)" + + echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT + + # prepare list of IDEs to use by plugin verifier: + ./gradlew listProductsReleases + + - name: Build plugin + shell: bash + run: ./gradlew buildPlugin + + - name: Prepare Plugin Artifact + id: artifact + shell: bash + run: | + cd ${{ github.workspace }}/build/distributions + FILENAME=`ls *.zip` + unzip "$FILENAME" -d content + echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT + echo "zip artifact name:" + echo "$FILENAME" + + - name: Publish built plugin to artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.artifact.outputs.filename }} + path: ./build/distributions/content/*/* + + test_and_sonar: + needs: [build] + runs-on: ubuntu-latest + steps: + + - name: Checkout the plugin GitHub repository + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 11 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + + - name: Run tests + shell: bash + run: ./gradlew test + + - name: Publish tests result to artifacts + uses: actions/upload-artifact@v4 + with: + name: tests-report + path: ${{ github.workspace }}/build/reports/tests + + - name: Publish code coverage report to artifacts + uses: actions/upload-artifact@v4 + with: + name: code-coverage-report + path: ${{ github.workspace }}/build/reports/kover/html + + - name: SonarCloud scans + continue-on-error: true + uses: ./.github/actions/sonar + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} + + verify: + if: ${{ contains(github.ref, 'refs/heads/release/') }} + needs: [build] + runs-on: ubuntu-latest + steps: + + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + large-packages: false + + - name: Checkout the plugin GitHub repository + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 11 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + + - name: Setup Plugin Verifier IDEs Cache + uses: actions/cache@v4 + with: + path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides + key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} + + - name: Verify plugin against IntelliJ IDEA IDE's + continue-on-error: true + shell: bash + run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} + + - name: Collect Plugin Verifier Result + uses: actions/upload-artifact@v4 + with: + name: plugin-verifier-report + path: ${{ github.workspace }}/build/reports/pluginVerifier diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..ff7ad772f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,120 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time. +# After the build stage is finished, it is ready to be published to the respective public repositories +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Release + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + + - name: Checkout the plugin GitHub repository + uses: actions/checkout@v4 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 11 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + + - name: Fetch Gradle properties + id: properties + shell: bash + run: | + PROPERTIES="$(./gradlew properties --console=plain -q)" + PLUGIN_VERSION_FULL="$(echo "$PROPERTIES" | grep "^pluginVersion:" | cut -f2- -d ' ')" + PLUGIN_VERSION_SEMVER="$(echo "$PLUGIN_VERSION_FULL" | grep -Po '\d{1,}\.\d{1,}\.\d{1,}')" + CURR_COMMIT="$(git rev-parse HEAD)" + + echo "pluginVersionFull: $PLUGIN_VERSION_FULL" + echo "pluginVersionSemVer: $PLUGIN_VERSION_SEMVER" + echo "currCommit: $CURR_COMMIT" + + echo "pluginVersionFull=$PLUGIN_VERSION_FULL" >> $GITHUB_OUTPUT + echo "pluginVersionSemVer=$PLUGIN_VERSION_SEMVER" >> $GITHUB_OUTPUT + echo "currCommit=$CURR_COMMIT" >> $GITHUB_OUTPUT + + - name: Publish Plugin + env: + ZOWE_INTELLIJ_MARKET_TOKEN: ${{ secrets.ZOWE_INTELLIJ_MARKET_TOKEN }} + INTELLIJ_SIGNING_CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_SIGNING_CERTIFICATE_CHAIN }} + INTELLIJ_SIGNING_PRIVATE_KEY: ${{ secrets.INTELLIJ_SIGNING_PRIVATE_KEY }} + INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD }} + run: ./gradlew publishPlugin + + - name: Prepare release notes + id: release_notes + shell: bash + run: | + CHANGELOG="$(./gradlew getChangelog -q)" + + echo 'version_release_notes<> $GITHUB_OUTPUT + echo "$CHANGELOG" >> $GITHUB_OUTPUT + echo 'EOF' >> $GITHUB_OUTPUT + + echo "Release notes to be added:" + echo "$CHANGELOG" + + - name: Create new tag and release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git tag ${{ steps.properties.outputs.pluginVersionFull }} + git push origin ${{ steps.properties.outputs.pluginVersionFull }} + gh release create ${{ steps.properties.outputs.pluginVersionFull }} --title ${{ steps.properties.outputs.pluginVersionFull }} --target ${{ steps.properties.outputs.currCommit }} -F- < - ./gradlew --info sonarqube - -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=512m" - -Dresults="build/reports/tests/test,build/test-results/test,build/reports/jacoco/test/html" - -Psonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN - -Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_PASSWORD - -Dsonar.coverage.jacoco.xmlReportPaths="build/reports/jacoco.xml" - env: - ARTIFACTORY_USE RNAME: ${{ secrets.ARTIFACTORY_USERNAME }} - ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index c7884e537..7d4249988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,17 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. -## `1.2.0 (2024-xx-yy)` +## [Unreleased] -* Feature: TSO CLI PA1 button functionality added ([48834cac](https://github.com/zowe/zowe-explorer-intellij/commit/48834cac)) -* Feature: Allocation units clarification added ([1ff218e4](https://github.com/zowe/zowe-explorer-intellij/commit/1ff218e4)) -* Feature: Now after allocating a dataset, a notification is shown instead of a dialog window ([20343651](https://github.com/zowe/zowe-explorer-intellij/commit/20343651)) -* Feature: VFS_CHANGES topic rework for encoding purposes ([3adaded3](https://github.com/zowe/zowe-explorer-intellij/commit/3adaded3)) -* Feature: Close all files in editor, related to the file/folder/dataset/member being deleted ([8a0d9980](https://github.com/zowe/zowe-explorer-intellij/commit/8a0d9980)) +### Features +* Feature: GitHub issue #171: TSO CLI PA1 button functionality added ([48834cac](https://github.com/zowe/zowe-explorer-intellij/commit/48834cac)) +* Feature: GitHub issue #172: Allocation units clarification added ([1ff218e4](https://github.com/zowe/zowe-explorer-intellij/commit/1ff218e4)) +* Feature: GitHub issue #173: Now after allocating a dataset, a notification is shown instead of a dialog window ([20343651](https://github.com/zowe/zowe-explorer-intellij/commit/20343651)) +* Feature: GitHub issue #174: VFS_CHANGES topic rework for encoding purposes ([3adaded3](https://github.com/zowe/zowe-explorer-intellij/commit/3adaded3)) +* Feature: GitHub issue #175: Close all files in editor, related to the file/folder/dataset/member being deleted ([8a0d9980](https://github.com/zowe/zowe-explorer-intellij/commit/8a0d9980)) + +### Bugfixes * Bugfix: GitHub issue #159: Zowe config detection doesn't work correctly ([c73226f6](https://github.com/zowe/zowe-explorer-intellij/commit/c73226f6)) * Bugfix: Warning during working set creation without masks/job filters is missing ([4fd0b22c](https://github.com/zowe/zowe-explorer-intellij/commit/4fd0b22c)) @@ -24,7 +27,9 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: TSO EXEC command without operands causes the CLI to hang ([d071960a](https://github.com/zowe/zowe-explorer-intellij/commit/d071960a)) * Bugfix: Connection is not fully reset to the last successful state and it causes errors ([f6d5a72e](https://github.com/zowe/zowe-explorer-intellij/commit/f6d5a72e)) -## `1.1.2 (2024-01-22)` +## [1.1.2-221] (2024-01-22) + +### Bugfixes * Bugfix: Sync action does not work after file download ([bfb125d7](https://github.com/zowe/zowe-explorer-intellij/commit/bfb125d7)) * Bugifx: "Skip This Files" doesn't work when uploading local file to PDS ([749b2d4b](https://github.com/zowe/zowe-explorer-intellij/commit/749b2d4b)) @@ -38,7 +43,9 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: Conflicting VFS and content storage name ([3a2c8d60](https://github.com/zowe/zowe-explorer-intellij/commit/3a2c8d60)) * Bugfix: GitHub issue #167: Zowe explorer config is not converted ([b5eae7a2](https://github.com/zowe/zowe-explorer-intellij/commit/b5eae7a2)) -## `1.1.1 (2023-11-23)` +## [1.1.1-221] (2023-11-23) + +### Bugfixes * Bugfix: Dataset color does not change when cutting ([fa6f6ae5](https://github.com/zowe/zowe-explorer-intellij/commit/fa6f6ae5)) @@ -67,7 +74,9 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: GitHub issue #162: Sync does not work on files and datasets in autosync ([da93cf9b](https://github.com/zowe/zowe-explorer-intellij/commit/da93cf9b)) -## `1.1.0 (2023-09-07)` +## [1.1.0-221] (2023-09-07) + +### Features * Feature: GitHub issue #14: UX: Edit WS mask ([0d358d0d](https://github.com/zowe/zowe-explorer-intellij/commit/0d358d0d)) @@ -122,6 +131,7 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Feature: Unit tests ([019bef00](https://github.com/zowe/zowe-explorer-intellij/commit/019bef00), [fa903c1c](https://github.com/zowe/zowe-explorer-intellij/commit/fa903c1c), [709a5e2f](https://github.com/zowe/zowe-explorer-intellij/commit/709a5e2f), [07ecd283](https://github.com/zowe/zowe-explorer-intellij/commit/07ecd283), [93febb62](https://github.com/zowe/zowe-explorer-intellij/commit/93febb62), [517c2cff](https://github.com/zowe/zowe-explorer-intellij/commit/517c2cff), [29cd85e4](https://github.com/zowe/zowe-explorer-intellij/commit/29cd85e4), [3850fcec](https://github.com/zowe/zowe-explorer-intellij/commit/3850fcec), [5646963e](https://github.com/zowe/zowe-explorer-intellij/commit/5646963e), [be3b5086](https://github.com/zowe/zowe-explorer-intellij/commit/be3b5086), [5043f5da](https://github.com/zowe/zowe-explorer-intellij/commit/5043f5da), [fdf67e1c](https://github.com/zowe/zowe-explorer-intellij/commit/fdf67e1c)) +### Bugfixes * Bugfix: GitHub issue #138: Job is identified as successful while it ends with RC=12 ([99491858](https://github.com/zowe/zowe-explorer-intellij/commit/99491858)) @@ -158,13 +168,16 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: ClassCastException: class java.util.ArrayList cannot be cast to class com.intellij.openapi.vfs.VirtualFile ([cdc0a458](https://github.com/zowe/zowe-explorer-intellij/commit/cdc0a458)) -## `1.0.2 (2023-06-13)` +## [1.0.2-221] (2023-06-13) + +### Features * Feature: Returned support for IntelliJ 2022.1 ([6329c788](https://github.com/zowe/zowe-explorer-intellij/commit/6329c788)) * Feature: Focus on dataset name field in allocation dialog ([fccb77f9](https://github.com/zowe/zowe-explorer-intellij/commit/fccb77f9)) +### Bugfixes * Bugfix: Memory leak bug ([644c9fa1](https://github.com/zowe/zowe-explorer-intellij/commit/644c9fa1)) * Bugfix: GitHub issue #132: IDE internal error - @@ -185,10 +198,13 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: Unknown file type after delete member after move ([02b8090f](https://github.com/zowe/zowe-explorer-intellij/commit/02b8090f)) -## `1.0.1 (2023-04-18)` +## [1.0.1] (2023-04-18) + +### Features * Feature: Support for IntelliJ 2023.1 +### Bugfixes * Bugfix: Runtime Exception in Zowe Explorer when delete dataset ([6a2458f2](https://github.com/zowe/zowe-explorer-intellij/commit/6a2458f2)) @@ -219,10 +235,13 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. PDS ([ec94b39e](https://github.com/zowe/zowe-explorer-intellij/commit/ec94b39e)) * Bugfix: USS file empty after rename ([71c49b24](https://github.com/zowe/zowe-explorer-intellij/commit/71c49b24)) -## `1.0.0 (2023-03-21)` +## [1.0.0] (2023-03-13) + +### Breaking changes * Breaking: Java 17 usage introduced. Plugin requires to use it with IntelliJ version >= 2022.3 +### Features * Feature: GitHub issue #31: Support for CHMOD operation ([3a166173](https://github.com/zowe/zowe-explorer-intellij/commit/3a166173)) @@ -258,6 +277,7 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. CrudableTestSpec ([3ff0ab36](https://github.com/zowe/zowe-explorer-intellij/commit/3ff0ab36)) * Feature: Unit tests: jUnit to Kotest ([0fa8a1d6](https://github.com/zowe/zowe-explorer-intellij/commit/0fa8a1d6)) +### Bugfixes * Bugfix: Unit tests are broken ([e2f12c92](https://github.com/zowe/zowe-explorer-intellij/commit/e2f12c92)) * Bugfix: GitHub issue #55: Error in event log when copy member to PDS that does not have enough @@ -319,8 +339,6 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. dialog ([8504564c](https://github.com/zowe/zowe-explorer-intellij/commit/8504564c)) * Bugfix: Typo in message for incorrect directory quantity in allocate dataset ([8504564c](https://github.com/zowe/zowe-explorer-intellij/commit/8504564c)) -* Bugfix: Typo in message for incorrect directory quantity in allocate - dataset ([8504564c](https://github.com/zowe/zowe-explorer-intellij/commit/8504564c)) * Bugfix: Unhandled error type for jobs ([47ea9f94](https://github.com/zowe/zowe-explorer-intellij/commit/47ea9f94)) * Bugfix: Automatic refresh does not work correctly for job filter after purge job via context menu ([47ea9f94](https://github.com/zowe/zowe-explorer-intellij/commit/47ea9f94)) @@ -338,14 +356,15 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. exist ([7cee23f3](https://github.com/zowe/zowe-explorer-intellij/commit/7cee23f3)) * Bugfix: Policy agreement is gone wild ([d600f58e](https://github.com/zowe/zowe-explorer-intellij/commit/d600f58e)) * Bugfix: Exception while opening TSO CLI ([540bfa80](https://github.com/zowe/zowe-explorer-intellij/commit/540bfa80)) -* Bugfix: Exception during IDE startup with - plugin ([5dbc9f27](https://github.com/zowe/zowe-explorer-intellij/commit/5dbc9f27)) -## `0.3.1 (2022-11-30)` +## [0.3.1] (2022-11-30) + +### Features * Feature: Unit tests for utils module ([16fae1fb](https://github.com/zowe/zowe-explorer-intellij/commit/16fae1fb)) ([683185bb](https://github.com/zowe/zowe-explorer-intellij/commit/683185bb)) +### Bugfixes * Bugfix: DnD does not work properly ([e5dfa3a3](https://github.com/zowe/zowe-explorer-intellij/commit/e5dfa3a3)) * Bugfix: Copy DS member to USS folder does not @@ -355,10 +374,13 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: Ctrl+C/Ctrl+V does not work if copy file from remote to local ([e5601e7f](https://github.com/zowe/zowe-explorer-intellij/commit/e5601e7f)) -## `0.3.0 (2022-11-18)` +## [0.3.0] (2022-11-18) + +### Breaking changes * Breaking: Kotlin DSL v2 usage introduced. Plugin requires to use it with IntelliJ version >= 2022.1 +### Features * Feature: Configurable batch size to load filter smoothly ([928baba](https://github.com/zowe/zowe-explorer-intellij/commit/928baba)) @@ -380,6 +402,7 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Feature: Source code documentation added ([636411e](https://github.com/zowe/zowe-explorer-intellij/commit/636411e) , [11bb7dd](https://github.com/zowe/zowe-explorer-intellij/commit/11bb7dd)) +### Bugfixes * Bugfix: File cache conflict if open JCL to edit it in JES explorer second time ([b3962de](https://github.com/zowe/zowe-explorer-intellij/commit/b3962de)) @@ -424,3 +447,12 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file. * Bugfix: GitHub issue #16: Error creating zOSMF connection * Bugfix: GitHub issue #85: The windows 'Add Working Set'/'Edit Working Set' are automatically resized if z/OSMF connection with very long name is added + +[1.1.2-221]: https://github.com/zowe/zowe-explorer-intellij/compare/1.1.1-221...1.1.2-221 +[1.1.1-221]: https://github.com/zowe/zowe-explorer-intellij/compare/1.1.0-221...1.1.1-221 +[1.1.0-221]: https://github.com/zowe/zowe-explorer-intellij/compare/1.0.2-221...1.1.0-221 +[1.0.2-221]: https://github.com/zowe/zowe-explorer-intellij/compare/1.0.1...1.0.2-221 +[1.0.1]: https://github.com/zowe/zowe-explorer-intellij/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/zowe/zowe-explorer-intellij/compare/0.3.1...1.0.0 +[0.3.1]: https://github.com/zowe/zowe-explorer-intellij/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/zowe/zowe-explorer-intellij/commits/0.3.0 diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..98b22ae63 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,12 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 1.2.x | :white_check_mark: | +| < 1.2 | :x: | + +## Reporting a Vulnerability + +Please direct all security issues to [ukalesnikau@ibagroup.eu](mailto:ukalesnikau@ibagroup.eu?subject=Vulnerability%20report). The team lead will reply to acknowledge receipt of the vulnerability and coordinate remediation with the affected project and version. diff --git a/build.gradle.kts b/build.gradle.kts index 37a55d794..6db85f263 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,20 +9,25 @@ */ import kotlinx.kover.api.KoverTaskExtension +import org.jetbrains.changelog.Changelog import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.time.LocalDate +import java.time.ZoneId +import java.time.format.DateTimeFormatter -buildscript { - dependencies { - classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1") - } -} +fun properties(key: String) = providers.gradleProperty(key) +fun environment(key: String) = providers.environmentVariable(key) +fun dateValue(pattern: String): String = + LocalDate.now(ZoneId.of("Europe/Warsaw")).format(DateTimeFormatter.ofPattern(pattern)) plugins { - id("org.sonarqube") version "3.3" + id("org.sonarqube") version "5.0.0.4638" id("org.jetbrains.intellij") version "1.17.2" + id("org.jetbrains.changelog") version "2.2.0" kotlin("jvm") version "1.9.22" java id("org.jetbrains.kotlinx.kover") version "0.6.1" + id("org.owasp.dependencycheck") version "9.1.0" } val sonarLinksCi: String by project @@ -31,8 +36,8 @@ apply(plugin = "kotlin") apply(plugin = "org.jetbrains.intellij") apply(from = "gradle/sonar.gradle") -group = "org.zowe" -version = "1.2.0-221" +group = properties("pluginGroup").get() +version = properties("pluginVersion").get() val remoteRobotVersion = "0.11.22" val okHttp3Version = "4.12.0" val kotestVersion = "5.8.1" @@ -82,10 +87,35 @@ dependencies { } intellij { - version.set("2022.1") + version.set(properties("platformVersion").get()) +} + +// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin +changelog { + version.set(properties("pluginVersion").get()) + header.set(provider { "${version.get()} (${dateValue("yyyy-MM-dd")})" }.get()) + groups.set(listOf("Breaking changes", "Features", "Bugfixes", "Deprecations", "Security")) + keepUnreleasedSection.set(false) + itemPrefix.set("*") + repositoryUrl.set(properties("pluginRepositoryUrl").get()) + sectionUrlBuilder.set { repositoryUrl, currentVersion, previousVersion, isUnreleased: Boolean -> + repositoryUrl + when { + isUnreleased -> when (previousVersion) { + null -> "/commits" + else -> "/compare/$previousVersion...HEAD" + } + + previousVersion == null -> "/commits/$currentVersion" + else -> "/compare/$previousVersion...$currentVersion" + } + } } tasks { + wrapper { + gradleVersion = properties("gradleVersion").get() + } + withType { kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() @@ -98,29 +128,25 @@ tasks { } patchPluginXml { - sinceBuild.set("221.5080") - untilBuild.set("222.*") + version.set(properties("pluginVersion").get()) + sinceBuild.set(properties("pluginSinceBuild").get()) + untilBuild.set(properties("pluginUntilBuild").get()) + + val changelog = project.changelog // local variable for configuration cache compatibility + // Get the latest available change notes from the changelog file changeNotes.set( - """ - New features: -
    -
  • None at the moment
  • -
-
- Fixed bugs: -
    -
  • Sync action does not work after file download
  • -
  • "Skip This Files" doesn't work when uploading local file to PDS
  • -
  • "Use new name" doesn't work for copying partitioned dataset to USS folder
  • -
  • "Use new name" doesn't work for copying sequential dataset to partitioned dataset
  • -
  • "Use new name" doesn't work when uploading local file to PDS
  • -
  • Editing two members with the same name does not update the content for one of the members
  • -
  • Topics handling
  • -
  • Zowe config v2 handling
  • -
  • JES Explorer bug when ABEND job is being displayed
  • -
  • Conflicting VFS and content storage name
  • -
  • GitHub issue #167: Zowe explorer config is not converted
  • -
""" + properties("pluginVersion") + .map { pluginVersion -> + with(changelog) { + renderItem( + (getOrNull(pluginVersion) ?: getUnreleased()) + .withHeader(false) + .withEmptySections(false), + Changelog.OutputType.HTML, + ) + } + } + .get() ) } @@ -151,6 +177,10 @@ tasks { ) } + koverHtmlReport { + finalizedBy("koverXmlReport") + } + val createOpenApiSourceJar by registering(Jar::class) { // Java sources from(sourceSets.main.get().java) { @@ -169,6 +199,30 @@ tasks { from(createOpenApiSourceJar) { into("lib/src") } } + signPlugin { + certificateChain.set(environment("INTELLIJ_SIGNING_CERTIFICATE_CHAIN").map { it }) + privateKey.set(environment("INTELLIJ_SIGNING_PRIVATE_KEY").map { it }) + password.set(environment("INTELLIJ_SIGNING_PRIVATE_KEY_PASSWORD").map { it }) + } + + publishPlugin { + dependsOn("patchChangelog") + token.set(environment("ZOWE_INTELLIJ_MARKET_TOKEN").map { it }) + // The pluginVersion is based on the SemVer (https://semver.org) + // Read more: https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel + channels.set( + properties("pluginVersion") + .map { + listOf( + it.substringAfter('-', "") + .substringAfter('-', "") + .substringBefore('.') + .ifEmpty { "stable" } + ) + } + .map { it }) + } + downloadRobotServerPlugin { version.set(remoteRobotVersion) } diff --git a/gradle.properties b/gradle.properties index 7d6c0a374..5413b7b20 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,26 @@ +# +# This program and the accompanying materials are made available under the terms of the +# Eclipse Public License v2.0 which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-v20.html +# +# SPDX-License-Identifier: EPL-2.0 +# +# Copyright IBA Group 2020 +# + org.gradle.jvmargs=-Xss1M + +# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension +platformVersion = 2022.1 + +# SemVer format -> https://semver.org +pluginVersion = 1.2.0-221 +pluginGroup = org.zowe +pluginRepositoryUrl = https://github.com/zowe/zowe-explorer-intellij + +# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html +pluginSinceBuild = 221.5080 +pluginUntilBuild = 222.* + +# Gradle Releases -> https://github.com/gradle/gradle/releases +gradleVersion = 8.7.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa..afba10928 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 508322917..20db9ad5c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/test/kotlin/org/zowe/explorer/editor/EditorTestSpec.kt b/src/test/kotlin/org/zowe/explorer/editor/EditorTestSpec.kt index 424fa1f79..eff97736e 100644 --- a/src/test/kotlin/org/zowe/explorer/editor/EditorTestSpec.kt +++ b/src/test/kotlin/org/zowe/explorer/editor/EditorTestSpec.kt @@ -510,34 +510,6 @@ class EditorTestSpec : WithApplicationShouldSpec({ assertSoftly { descriptors?.isEmpty() shouldBe true } } - should("check file when getting decoder error") { - - text = "qwe��rty" - - var decoderResultIsError = false - var pointer = 0 - every { decoderMock.decode(any(), any(), any()) } answers { - val back = secondArg() - val str = text.substring(pointer) - val pos = str.indexOfFirst { it !in 'A'..'z' } - if (pos != -1) { - decoderResultIsError = true - pointer += pos - back.position(pointer) - pointer++ - } else { - decoderResultIsError = false - back.put(str) - } - decoderResultMock - } - every { decoderResultMock.isError } answers { decoderResultIsError } - - val descriptors = lossyEncodingInspection.checkFile(psiFileMock, inspectionManagerMock, isOnTheFly) - - assertSoftly { descriptors?.size shouldBe 1 } - assertSoftly { descriptors?.get(0)?.textRangeInElement shouldBe TextRange(3, 5) } - } should("check file where not all characters are decoded back") { text = "qwerty."