diff --git a/.editorconfig b/.editorconfig index 1a424d53..a67170dd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,6 @@ indent_style = space insert_final_newline = false max_line_length = 120 tab_width = 4 + +[{*.yaml,*.yml}] +indent_size = 2 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..632ce30c --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,162 @@ + +# Contributing to GitHub Actions Manager + +First off, thanks for taking the time to contribute! ❀️ + +All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. πŸŽ‰ + +> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: +> - Star the project +> - Tweet about it +> - Refer this project in your project's readme +> - Mention the project at local meetups and tell your friends/colleagues + + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [I Have a Question](#i-have-a-question) +- [I Want To Contribute](#i-want-to-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Suggesting Enhancements](#suggesting-enhancements) + - [Your First Code Contribution](#your-first-code-contribution) + - [Improving The Documentation](#improving-the-documentation) +- [Style guides](#style-guides) + - [Commit Messages](#commit-messages) +- [Join The Project Team](#join-the-project-team) + + +## Code of Conduct + +This project and everyone participating in it is governed by the +[GitHub Actions Manager Code of Conduct](https://github.com/cunla/ghactions-manager/blob/main/CODE_OF_CONDUCT.md). +By participating, you are expected to uphold this code. Please report unacceptable behavior +to . + + +## I Have a Question + +> If you want to ask a question, we assume that you have read the available [Documentation](https://github.com/cunla/ghactions-manager). + +Before you ask a question, it is best to search for existing [Issues](https://github.com/cunla/ghactions-manager/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. + +If you then still feel the need to ask a question and need clarification, we recommend the following: + +- Open an [Issue](https://github.com/cunla/ghactions-manager/issues/new). +- Provide as much context as you can about what you're running into. +- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. + +We will then take care of the issue as soon as possible. + + + +## I Want To Contribute + +> ### Legal Notice +> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. + +### Reporting Bugs + + +#### Before Submitting a Bug Report + +A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. + +- Make sure that you are using the latest version. +- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://github.com/cunla/ghactions-manager). If you are looking for support, you might want to check [this section](#i-have-a-question)). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/cunla/ghactions-manager/issues?q=label%3Abug). +- Also make sure to search the internet (including Stack Overflow) to see if users outside the GitHub community have discussed the issue. +- Collect information about the bug: + - Stack trace (Traceback) + - OS, Platform and Version (Windows, Linux, macOS, x86, ARM) + - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. + - Possibly your input and the output + - Can you reliably reproduce the issue? And can you also reproduce it with older versions? + + +#### How Do I Submit a Good Bug Report? + +> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead, sensitive bugs must be sent by email to . + + +We use GitHub issues to track bugs and errors. If you run into an issue with the project: + +- Open an [Issue](https://github.com/cunla/ghactions-manager/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) +- Explain the behavior you would expect and the actual behavior. +- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. +- Provide the information you collected in the previous section. + +Once it's filed: + +- The project team will label the issue accordingly. +- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. +- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution). + + + + +### Suggesting Enhancements + +This section guides you through submitting an enhancement suggestion for GitHub Actions Manager, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. + + +#### Before Submitting an Enhancement + +- Make sure that you are using the latest version. +- Read the [documentation](https://github.com/cunla/ghactions-manager) carefully and find out if the functionality is already covered, maybe by an individual configuration. +- Perform a [search](https://github.com/cunla/ghactions-manager/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. + + +#### How Do I Submit a Good Enhancement Suggestion? + +Enhancement suggestions are tracked as [GitHub issues](https://github.com/cunla/ghactions-manager/issues). + +- Use a **clear and descriptive title** for the issue to identify the suggestion. +- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. +- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. +- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. +- **Explain why this enhancement would be useful** to most GitHub Actions Manager users. You may also want to point out the other projects that solved it better and which could serve as inspiration. + + + +### Your First Code Contribution +Import the project as a gradle project to IntelliJ. +IntelliJ should do the rest. You can choose the `Run Plugin` configuration, +and it will start the plugin. + + +### Improving The Documentation +Feel free to create pull requests with new documentation under `docs/` directory or in existing `.md` files. + +## Style guides +### Commit Messages +Adopted from [How to write a commit message](https://cbea.ms/git-commit/) +1. Separate subject from body with a blank line +2. Limit the subject line to 50 characters +3. Capitalize the subject line +4. Do not end the subject line with a period +5. Use the imperative mood in the subject line +6. Wrap the body at 72 characters +7. Use the body to explain what and why vs. how + +## Join The Project Team +Write [me on LinkedIn](https://www.linkedin.com/in/daniel-moran-8a096a15/) if you want to join the +project team. + + +## Attribution +This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..6f0c2b69 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +--- +github: cunla +polar: cunla diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..a4c81707 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' +--- +### Describe the bug +A clear and concise description of what the bug is. +Add a screenshot if it is relevant. + +**Describe the bug:** + + +### Steps to reproduce + + +### Expected behavior + + + +### Additional context + +Plugin version: +IDE: +OS: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..11fc491e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9be205f5..b04f9c8a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,7 +11,7 @@ updates: interval: "daily" # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" - directory: "/" + directory: ".github/" target-branch: "next" schedule: interval: "daily" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..5453fafe --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,55 @@ +--- +name-template: 'v$RESOLVED_VERSION 🌈' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: 'πŸš€ Features' + labels: + - 'feature' + - 'enhancement' + - title: 'πŸ› Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' + - title: '⬆️ Dependency Updates' + label: 'dependencies' +change-template: '- $TITLE (#$NUMBER)' +change-title-escapes: '\<*_&' +autolabeler: + - label: 'chore' + files: + - '*.md' + - '.github/*' + - label: 'bug' + title: + - '/fix/i' + - label: 'dependencies' + files: + - 'poetry.lock' +version-resolver: + major: + labels: + - 'breaking' + minor: + labels: + - 'feature' + - 'enhancement' + patch: + labels: + - 'chore' + - 'dependencies' + - 'bug' + default: patch +template: | + # Changes + + $CHANGES + + ## Contributors + We'd like to thank all the contributors who worked on this release! + + $CONTRIBUTORS + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0b68590..c34cd75c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,6 @@ # GitHub Actions Workflow created for testing and preparing the plugin release in following steps: # - validate Gradle Wrapper, # - run 'test' and 'verifyPlugin' tasks, -# - run Qodana inspections, # - run 'buildPlugin' task and prepare artifact for the further tests, # - run 'runPluginVerifier' task, # - create a draft release. @@ -10,18 +9,19 @@ # # GitHub Actions reference: https://help.github.com/en/actions # -## JBIJPPTPL name: Build on: # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests) push: - branches: [main] + branches: + - master # Trigger the workflow on any pull request pull_request: + branches: + - master jobs: - # Run Gradle Wrapper Validation Action to verify the wrapper's checksum # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks # Build plugin and provide the artifact for the next workflow jobs @@ -33,42 +33,29 @@ jobs: changelog: ${{ steps.properties.outputs.changelog }} steps: + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v4 # Validate wrapper - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1.0.4 + uses: gradle/wrapper-validation-action@v2.1.1 - # Setup Java 11 environment for the next steps + # Setup Java 17 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: zulu - java-version: 11 + java-version: 17 cache: gradle - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - PROPERTIES="$(./gradlew properties --console=plain -q)" - VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" - NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" - CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - - echo "::set-output name=version::$VERSION" - echo "::set-output name=name::$NAME" - echo "::set-output name=changelog::$CHANGELOG" - echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" - - ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier - # Run tests - name: Run Tests run: ./gradlew test @@ -76,14 +63,37 @@ jobs: # Collect Tests Result of failed tests - name: Collect Tests Result if: ${{ failure() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: tests-result path: ${{ github.workspace }}/build/reports/tests + - name: plugin verifier + run: | + ./gradlew runPluginVerifier + + # Set environment variables + - name: Export Properties + id: properties + shell: bash + run: | + PROPERTIES="$(./gradlew properties --console=plain -q)" + VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" + CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" + + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT + + echo "changelog<> $GITHUB_OUTPUT + echo "$CHANGELOG" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier + + # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v4 with: path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} @@ -95,15 +105,11 @@ jobs: # Collect Plugin Verifier Result - name: Collect Plugin Verifier Result if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: pluginVerifier-result path: ${{ github.workspace }}/build/reports/pluginVerifier - # Run Qodana inspections - - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v4.2.5 - # Prepare plugin archive content for creating artifact - name: Prepare Plugin Artifact id: artifact @@ -113,46 +119,28 @@ jobs: FILENAME=`ls *.zip` unzip "$FILENAME" -d content - echo "::set-output name=filename::${FILENAME:0:-4}" + echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT # Store already-built plugin as an artifact for downloading - name: Upload artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 with: name: ${{ steps.artifact.outputs.filename }} path: ./build/distributions/content/*/* # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered - releaseDraft: + update_release_draft: name: Release Draft - if: github.event_name != 'pull_request' + permissions: + # write permission is required to create a GitHub release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write needs: build runs-on: ubuntu-latest steps: - - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v2.4.0 - - # Remove old release drafts by using the curl request for the available releases with draft flag - - name: Remove Old Release Drafts + - uses: release-drafter/release-drafter@v6.0.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh api repos/{owner}/{repo}/releases \ - --jq '.[] | select(.draft == true) | .id' \ - | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} - - # Create new release draft - which is not publicly visible and requires manual acceptance - - name: Create Release Draft - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create v${{ needs.build.outputs.version }} \ - --draft \ - --title "v${{ needs.build.outputs.version }}" \ - --notes "$(cat << 'EOM' - ${{ needs.build.outputs.changelog }} - EOM - )" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bcf2d5d..c99f9aaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,46 +12,25 @@ jobs: release: name: Publish Plugin runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v4 with: ref: ${{ github.event.release.tag_name }} - # Setup Java 11 environment for the next steps + # Setup Java 17 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: zulu - java-version: 11 + java-version: 17 cache: gradle - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d' - ${{ github.event.release.body }} - EOM - )" - - CHANGELOG="${CHANGELOG//'%'/'%25'}" - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" - - echo "::set-output name=changelog::$CHANGELOG" - - # Update Unreleased section with the current release note - - name: Patch Changelog - if: ${{ steps.properties.outputs.changelog != '' }} - env: - CHANGELOG: ${{ steps.properties.outputs.changelog }} - run: | - ./gradlew patchChangelog --release-note="$CHANGELOG" - # Publish the plugin to the Marketplace - name: Publish Plugin env: @@ -63,25 +42,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* - - # Create pull request - - name: Create Pull Request - if: ${{ steps.properties.outputs.changelog != '' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VERSION="${{ github.event.release.tag_name }}" - BRANCH="changelog-update-$VERSION" - - git config user.email "action@github.com" - git config user.name "GitHub Action" - - git checkout -b $BRANCH - git commit -am "Changelog update - $VERSION" - git push --set-upstream origin $BRANCH - - gh pr create \ - --title "Changelog update - \`$VERSION\`" \ - --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ - --base main \ - --head $BRANCH diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 3108cf1f..411f1628 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -33,14 +33,14 @@ jobs: # Check out current repository - name: Fetch Sources - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v4 - # Setup Java 11 environment for the next steps + # Setup Java 17 environment for the next steps - name: Setup Java - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: zulu - java-version: 11 + java-version: 17 cache: gradle # Run IDEA prepared for UI testing @@ -49,7 +49,7 @@ jobs: # Wait for IDEA to be started - name: Health Check - uses: jtalk/url-health-check-action@v2 + uses: jtalk/url-health-check-action@v4 with: url: http://127.0.0.1:8082 max-attempts: 15 diff --git a/.gitignore b/.gitignore index e2e5d94e..103330c5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ .idea .qodana build +notes.txt +.fleet +.DS_Store +.run +.env diff --git a/.run/Run Qodana.run.xml b/.run/Run Qodana.run.xml deleted file mode 100644 index 9603583a..00000000 --- a/.run/Run Qodana.run.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - true - true - false - - - \ No newline at end of file diff --git a/.run/Run Plugin Tests.run.xml b/.run/Run Tests.run.xml similarity index 96% rename from .run/Run Plugin Tests.run.xml rename to .run/Run Tests.run.xml index ae9ae135..132d9ad7 100644 --- a/.run/Run Plugin Tests.run.xml +++ b/.run/Run Tests.run.xml @@ -11,7 +11,7 @@