diff --git a/.github/actions/action_tests/action.yaml b/.github/actions/action_tests/action.yaml index 2da8737b8..ec3ba71eb 100644 --- a/.github/actions/action_tests/action.yaml +++ b/.github/actions/action_tests/action.yaml @@ -16,9 +16,12 @@ inputs: description: Additional args to append to the test invocation required: false default: actions/ -- - trunk-token: - description: CI debugger api token - required: true + trunk-staging-token: + description: Test analytics staging api token (org token) + required: false + trunk-prod-token: + description: Test analytics prod api token (org token) + required: false runs: # TODO(Tyler): See if this can be converted to a js action @@ -49,7 +52,6 @@ runs: working-directory: ${{ inputs.path }} - name: Run action tests - if: runner.os == 'Windows' run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --passWithNoTests --ci shell: bash working-directory: ${{ inputs.path }} @@ -58,25 +60,21 @@ runs: PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }} PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }} - - name: Run action tests - if: runner.os != 'Windows' - uses: trunk-io/breakpoint@v1.3.0 + - name: Upload prod results + # TODO(Tyler): Add upload on Windows once the action supports it. + if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''" + uses: trunk-io/analytics-uploader@main with: - breakpoint-id: trunk-plugins-action-tests - shell: bash - working-directory: ${{ inputs.path }} - trunk-token: ${{ inputs.trunk-token }} - org: trunk-staging-org - run: - npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --passWithNoTests --ci + junit-paths: junit.xml + org-slug: trunk + token: ${{ inputs.trunk-prod-token }} + continue-on-error: true env: - JEST_SUITE_NAME: Action Tests - PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }} - PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }} + TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io - - name: Upload results - # TODO(Tyler): Add upload on MacOS/Windows once the action supports it. - if: "!cancelled() && runner.os == 'Linux'" + - name: Upload staging results + # TODO(Tyler): Add upload on Windows once the action supports it. + if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-staging-token != ''" uses: trunk-io/analytics-uploader@main with: junit-paths: junit.xml diff --git a/.github/actions/linter_tests/action.yaml b/.github/actions/linter_tests/action.yaml index 16e09101f..81a9c9f7f 100644 --- a/.github/actions/linter_tests/action.yaml +++ b/.github/actions/linter_tests/action.yaml @@ -23,9 +23,12 @@ inputs: sourcery-token: description: Token to login for sourcery test required: true - trunk-token: - description: CI debugger api token (org token) - required: true + trunk-staging-token: + description: Test analytics staging api token (org token) + required: false + trunk-prod-token: + description: Test analytics prod api token (org token) + required: false ref-type: description: release or main required: false @@ -92,7 +95,6 @@ runs: working-directory: ${{ inputs.path }} - name: Run plugin tests - if: runner.os == 'Windows' run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci shell: bash working-directory: ${{ inputs.path }} @@ -107,30 +109,21 @@ runs: JEST_JUNIT_SUITE_NAME: "{title} ${{ runner.os }} ${{ inputs.ref-type }} ${{ inputs.linter-version }}" - - name: Run plugin tests - if: runner.os != 'Windows' - # trunk-ignore(semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha) - uses: trunk-io/breakpoint@v1.3.0 + - name: Upload prod results + # TODO(Tyler): Add upload on Windows once the action supports it. + if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''" + uses: trunk-io/analytics-uploader@main with: - breakpoint-id: trunk-plugins-linter-tests - shell: bash - working-directory: ${{ inputs.path }} - trunk-token: ${{ inputs.trunk-token }} - org: trunk-staging-org - run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci --runInBand + junit-paths: junit.xml + org-slug: trunk + token: ${{ inputs.trunk-prod-token }} + continue-on-error: true env: - PLUGINS_TEST_LINTER_VERSION: ${{ inputs.linter-version }} - PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }} - PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }} - SOURCERY_TOKEN: ${{ inputs.sourcery-token }} - DEBUG: Driver:nixpkgs-fmt:*, Driver:eslint:* - JEST_SUITE_NAME: Linter Tests - JEST_JUNIT_SUITE_NAME: - "{title} ${{ runner.os }} ${{ inputs.ref-type }} ${{ env.JEST_LINTER_VERSION }}" + TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io - - name: Upload results - # TODO(Tyler): Add upload on MacOS/Windows once the action supports it. - if: "!cancelled() && runner.os == 'Linux'" + - name: Upload staging results + # TODO(Tyler): Add upload on Windows once the action supports it. + if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-staging-token != ''" uses: trunk-io/analytics-uploader@main with: junit-paths: junit.xml diff --git a/.github/actions/tool_tests/action.yaml b/.github/actions/tool_tests/action.yaml index 9d36c17e3..795670be7 100644 --- a/.github/actions/tool_tests/action.yaml +++ b/.github/actions/tool_tests/action.yaml @@ -16,9 +16,12 @@ inputs: description: Additional args to append to the test invocation required: false default: tools -- - trunk-token: - description: CI debugger api token (org token) - required: true + trunk-staging-token: + description: Test analytics staging api token (org token) + required: false + trunk-prod-token: + description: Test analytics prod api token (org token) + required: false ref-type: description: release or main required: false @@ -65,7 +68,6 @@ runs: working-directory: ${{ inputs.path }} - name: Run plugin tests - if: runner.os == 'Windows' run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci shell: bash working-directory: ${{ inputs.path }} @@ -75,26 +77,21 @@ runs: JEST_SUITE_NAME: Tool Tests JEST_JUNIT_SUITE_NAME: "{title} ${{ runner.os }} ${{ inputs.ref-type }}" - - name: Run plugin tests - if: runner.os != 'Windows' - # trunk-ignore(semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha) - uses: trunk-io/breakpoint@v1.3.0 + - name: Upload prod results + # TODO(Tyler): Add upload on Windows once the action supports it. + if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''" + uses: trunk-io/analytics-uploader@main with: - breakpoint-id: trunk-plugins-tool-tests - shell: bash - working-directory: ${{ inputs.path }} - trunk-token: ${{ inputs.trunk-token }} - org: trunk-staging-org - run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci + junit-paths: junit.xml + org-slug: trunk + token: ${{ inputs.trunk-prod-token }} + continue-on-error: true env: - PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }} - PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }} - JEST_SUITE_NAME: Tool Tests - JEST_JUNIT_SUITE_NAME: "{title} ${{ runner.os }} ${{ inputs.ref-type }}" + TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io - - name: Upload results - # TODO(Tyler): Add upload on MacOS/Windows once the action supports it. - if: "!cancelled() && runner.os == 'Linux'" + - name: Upload staging results + # TODO(Tyler): Add upload on Windows once the action supports it. + if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-staging-token != ''" uses: trunk-io/analytics-uploader@main with: junit-paths: junit.xml diff --git a/.github/workflows/annotate_pr.yaml b/.github/workflows/annotate_pr.yaml index 2f6afd8f3..3f1e4bd03 100644 --- a/.github/workflows/annotate_pr.yaml +++ b/.github/workflows/annotate_pr.yaml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Trunk Check - uses: trunk-io/trunk-action@f6c5f1b90503c30e02059667dbc247f2257b63c5 # v1.1.15 + uses: trunk-io/trunk-action@86b68ffae610a05105e90b1f52ad8c549ef482c2 # v1.1.16 with: post-annotations: true # This job may fail when the PR was not run on a fork, and that's okay diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7db750645..2c433985d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 + uses: github/codeql-action/init@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 # Override language selection by uncommenting this and choosing your languages with: languages: javascript @@ -42,7 +42,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 + uses: github/codeql-action/autobuild@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -56,4 +56,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 + uses: github/codeql-action/analyze@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 91be87085..1345c082e 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -68,7 +68,8 @@ jobs: linter-version: ${{ matrix.linter-version }} ref-type: main sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} # Run tests against all linters for snapshots and latest version as they exist in latest release # This job is used to update the list of validated versions @@ -176,12 +177,13 @@ jobs: append-args: linters -- --json --outputFile=${{ matrix.results-file }}-res.json ref-type: release sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} - name: Upload Test Outputs for Upload Job # Only upload results from latest. Always run, except when cancelled. if: (failure() || success()) && matrix.linter-version == 'Latest' - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: ${{ matrix.results-file }}-test-results path: ${{ matrix.results-file }}-res.json @@ -201,6 +203,7 @@ jobs: TRUNK_OPEN_PR_APP_PRIVATE_KEY: ${{ secrets.TRUNK_OPEN_PR_APP_PRIVATE_KEY }} TRUNK_SOURCERY_TOKEN: ${{ secrets.TRUNK_SOURCERY_TOKEN }} TRUNK_DEBUGGER_TOKEN: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + TRUNK_ORG_PROD_TOKEN: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} with: plugin-version: ${{ needs.linter_tests_release.outputs.plugin-version }} upload-validated-versions: true @@ -235,12 +238,13 @@ jobs: uses: ./.github/actions/tool_tests with: append-args: tools -- --json --outputFile=${{ matrix.results-file }}-res.json - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} - name: Upload Test Outputs for Notification Job # Always run, except when cancelled. if: (failure() || success()) - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: tools-${{ matrix.results-file }}-test-results path: ${{ matrix.results-file }}-res.json @@ -255,6 +259,7 @@ jobs: TRUNKBOT_SLACK_BOT_TOKEN: ${{ secrets.TRUNKBOT_SLACK_BOT_TOKEN }} TRUNK_SOURCERY_TOKEN: ${{ secrets.TRUNK_SOURCERY_TOKEN }} TRUNK_DEBUGGER_TOKEN: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + TRUNK_ORG_PROD_TOKEN: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} with: plugin-version: main results-prefix: tools- @@ -278,4 +283,5 @@ jobs: - name: Action Tests uses: ./.github/actions/action_tests with: - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a559c6bfa..d0c094c48 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -155,7 +155,8 @@ jobs: append-args: ${{ needs.detect_changes.outputs.all-linters }} ${{ needs.detect_changes.outputs.linters-files }} - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} - name: Linter Tests Latest # Run tests on Latest with any modified linters (see filters.yaml). Don't run when cancelled. @@ -168,7 +169,8 @@ jobs: ref-type: main sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} append-args: ${{ needs.detect_changes.outputs.linters-files }} - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} tool_tests: name: Tool Tests @@ -194,7 +196,8 @@ jobs: append-args: ${{ needs.detect_changes.outputs.all-tools }} ${{ needs.detect_changes.outputs.tools-files }} - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} action_tests: name: Action Tests @@ -214,7 +217,8 @@ jobs: append-args: ${{ needs.detect_changes.outputs.all-actions }} ${{ needs.detect_changes.outputs.actions-files }} -- - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} trunk_check_runner: name: Trunk Check runner [linux] @@ -230,7 +234,7 @@ jobs: lfs: true - name: Trunk Check - uses: trunk-io/trunk-action@f6c5f1b90503c30e02059667dbc247f2257b63c5 + uses: trunk-io/trunk-action@86b68ffae610a05105e90b1f52ad8c549ef482c2 env: TRUNK_GITHUB_CHECK_RUN_TITLE: Trunk Check @@ -261,7 +265,8 @@ jobs: sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} cli-path: ${{ github.workspace }}\trunk.ps1 append-args: ${{needs.detect_changes.outputs.linters-files }} -- --maxWorkers=5 - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} windows_tool_tests: name: Windows Tool Tests @@ -285,7 +290,8 @@ jobs: with: append-args: ${{needs.detect_changes.outputs.tools-files }} -- --maxWorkers=5 cli-path: ${{ github.workspace }}\trunk.ps1 - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} # Run repo healthcheck tests repo_tests: diff --git a/.github/workflows/repo_tests.reusable.yaml b/.github/workflows/repo_tests.reusable.yaml index c188d5372..843cc25f7 100644 --- a/.github/workflows/repo_tests.reusable.yaml +++ b/.github/workflows/repo_tests.reusable.yaml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: 18 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d7fb300e8..32a9f3b7f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -57,7 +57,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: Upload artifact - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: SARIF file path: results.sarif @@ -65,6 +65,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8 + uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3.25.12 with: sarif_file: results.sarif diff --git a/.github/workflows/upgrade_trunk.yaml b/.github/workflows/upgrade_trunk.yaml index f52157c37..6c53ef151 100644 --- a/.github/workflows/upgrade_trunk.yaml +++ b/.github/workflows/upgrade_trunk.yaml @@ -26,7 +26,7 @@ jobs: private_key: ${{ secrets.TRUNK_OPEN_PR_APP_PRIVATE_KEY }} - name: Trunk Upgrade - uses: trunk-io/trunk-action/upgrade@f6c5f1b90503c30e02059667dbc247f2257b63c5 + uses: trunk-io/trunk-action/upgrade@86b68ffae610a05105e90b1f52ad8c549ef482c2 with: arguments: -n --bleeding-edge github-token: ${{ steps.generate-token.outputs.token }} diff --git a/.github/workflows/upload_results.reusable.yaml b/.github/workflows/upload_results.reusable.yaml index 8229d46bc..28762ee5e 100644 --- a/.github/workflows/upload_results.reusable.yaml +++ b/.github/workflows/upload_results.reusable.yaml @@ -38,6 +38,8 @@ on: required: false TRUNK_DEBUGGER_TOKEN: required: false + TRUNK_ORG_PROD_TOKEN: + required: false permissions: actions: write @@ -60,21 +62,21 @@ jobs: - name: Retrieve Test Outputs ubuntu id: download-ubuntu - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 continue-on-error: true with: name: ${{ inputs.results-prefix }}ubuntu-latest-test-results - name: Retrieve Test Outputs macOS id: download-macos - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 continue-on-error: true with: name: ${{ inputs.results-prefix }}macos-latest-test-results - name: Retrieve Test Outputs Windows id: download-windows - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 continue-on-error: true with: name: ${{ inputs.results-prefix }}windows-latest-test-results @@ -119,7 +121,7 @@ jobs: SLACK_BOT_TOKEN: ${{ secrets.TRUNKBOT_SLACK_BOT_TOKEN }} - name: Setup Node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: 18 @@ -239,7 +241,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: 18 @@ -258,7 +260,8 @@ jobs: ref-type: main append-args: ${{ needs.upload_test_results.outputs.reruns }} -- -u sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} env: PLUGINS_TEST_UPDATE_SNAPSHOTS: "true" diff --git a/.github/workflows/windows_nightly.yaml b/.github/workflows/windows_nightly.yaml index 6ebf748c9..e9e0aff7e 100644 --- a/.github/workflows/windows_nightly.yaml +++ b/.github/workflows/windows_nightly.yaml @@ -49,8 +49,9 @@ jobs: cli-path: ${{ github.workspace }}\trunk.ps1 # manually specify more parallelism to avoid bottlenecks append-args: linters -- --maxWorkers=5 - # CI Debugger is not yet supported on Windows - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + # Analytics uploader is not yet supported on Windows + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} tool_tests_main: name: Tool Tests Main @@ -88,5 +89,6 @@ jobs: with: cli-path: ${{ github.workspace }}\trunk.ps1 append-args: tools -- --maxWorkers=5 - # CI Debugger is not yet supported on Windows - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + # Analytics uploader is not yet supported on Windows + trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index a43baf62b..f47432953 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -2,7 +2,7 @@ version: 0.1 # version used for local trunk runs and testing cli: - version: 1.22.2-beta.9 + version: 1.22.3-beta.9 shell_hooks: enforce: true @@ -42,7 +42,7 @@ lint: enabled: # enabled linters inherited from github.com/trunk-io/configs plugin - definition-checker - - eslint@9.2.0 + - eslint@9.6.0 disabled: - pylint # pylint diagnostics are too strict - semgrep diff --git a/linters/cfnlint/test_data/cfnlint_v1.3.0_basic.check.shot b/linters/cfnlint/test_data/cfnlint_v1.3.0_basic.check.shot new file mode 100644 index 000000000..0612ccacb --- /dev/null +++ b/linters/cfnlint/test_data/cfnlint_v1.3.0_basic.check.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter cfnlint test basic 1`] = ` +{ + "issues": [ + { + "code": "E3030", + "column": "7", + "file": "test_data/basic.in.yaml", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md", + "level": "LEVEL_HIGH", + "line": "19", + "linter": "cfnlint", + "message": "'DNSS' is not one of ['EMAIL', 'DNS']", + "targetType": "cloudformation", + }, + { + "code": "E3012", + "column": "7", + "file": "test_data/basic.in.yaml", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md", + "level": "LEVEL_HIGH", + "line": "21", + "linter": "cfnlint", + "message": "'*.test.io' is not of type 'array'", + "targetType": "cloudformation", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "cloudformation", + "linter": "cfnlint", + "paths": [ + "test_data/basic.in.yaml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "cloudformation", + "linter": "cfnlint", + "paths": [ + "test_data/basic.in.yaml", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/cfnlint/test_data/cfnlint_v1.3.2_basic.check.shot b/linters/cfnlint/test_data/cfnlint_v1.3.2_basic.check.shot new file mode 100644 index 000000000..25be704c3 --- /dev/null +++ b/linters/cfnlint/test_data/cfnlint_v1.3.2_basic.check.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter cfnlint test basic 1`] = ` +{ + "issues": [ + { + "code": "E3030", + "column": "7", + "file": "test_data/basic.in.yaml", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md", + "level": "LEVEL_HIGH", + "line": "19", + "linter": "cfnlint", + "message": "'DNSS' is not one of ['DNS', 'EMAIL']", + "targetType": "cloudformation", + }, + { + "code": "E3012", + "column": "7", + "file": "test_data/basic.in.yaml", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/rules.md", + "level": "LEVEL_HIGH", + "line": "21", + "linter": "cfnlint", + "message": "'*.test.io' is not of type 'array'", + "targetType": "cloudformation", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "cloudformation", + "linter": "cfnlint", + "paths": [ + "test_data/basic.in.yaml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "cloudformation", + "linter": "cfnlint", + "paths": [ + "test_data/basic.in.yaml", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/plugin.yaml b/linters/plugin.yaml index ad0c73ec0..bc0e4e8c6 100644 --- a/linters/plugin.yaml +++ b/linters/plugin.yaml @@ -389,10 +389,14 @@ lint: - requirements.txt - Pipfile.lock - poetry.lock + - pdm.lock # Ruby - Gemfile.lock + # R + - renv.lock + - name: lua extensions: - lua @@ -570,6 +574,12 @@ lint: - strings - stringsdict + - name: svelte + extensions: + - svelte + comments: + - html-tag + - name: svg extensions: - svg @@ -596,6 +606,11 @@ lint: comments: - hash + - name: tfvars + extensions: + # terraform/tofu can't format .tfvars.json files + - tfvars + - name: toml extensions: - toml diff --git a/linters/ruff/plugin.yaml b/linters/ruff/plugin.yaml index d2cb7a7e3..55fe9e39e 100644 --- a/linters/ruff/plugin.yaml +++ b/linters/ruff/plugin.yaml @@ -68,13 +68,13 @@ lint: files: [jupyter] commands: - name: lint - run: nbqa ruff --cache-dir=${cachedir} ${target} + run: nbqa 'ruff check --cache-dir=${cachedir} --quiet' ${target} output: pass_fail batch: true success_codes: [0, 1] runtime: python package: ruff - extra_packages: [nbqa==1.6.3] + extra_packages: [nbqa==1.8.5] direct_configs: [ruff.toml] affects_cache: - pyproject.toml diff --git a/linters/ruff/test_data/ruff_nbqa_v0.0.250_basic_nb.check.shot b/linters/ruff/test_data/ruff_nbqa_v0.0.250_basic_nb.check.shot index a777a1de5..dbbfc7fac 100644 --- a/linters/ruff/test_data/ruff_nbqa_v0.0.250_basic_nb.check.shot +++ b/linters/ruff/test_data/ruff_nbqa_v0.0.250_basic_nb.check.shot @@ -9,9 +9,7 @@ exports[`Testing linter ruff-nbqa test basic_nb 1`] = ` "issueClass": "ISSUE_CLASS_EXISTING", "level": "LEVEL_HIGH", "linter": "ruff-nbqa", - "message": "/tmp/plugins_/test_data/basic_nb.in.ipynb:cell_1:1:8: F401 [*] \`os\` imported but unused -Found 1 error. -[*] 1 potentially fixable with the --fix option.", + "message": "/tmp/plugins_/test_data/basic_nb.in.ipynb:cell_1:1:8: F401 [*] \`os\` imported but unused", "targetType": "jupyter", }, ], diff --git a/linters/ruff/test_data/ruff_nbqa_v0.1.0_basic_nb.check.shot b/linters/ruff/test_data/ruff_nbqa_v0.1.0_basic_nb.check.shot index 699819205..dbbfc7fac 100644 --- a/linters/ruff/test_data/ruff_nbqa_v0.1.0_basic_nb.check.shot +++ b/linters/ruff/test_data/ruff_nbqa_v0.1.0_basic_nb.check.shot @@ -9,9 +9,7 @@ exports[`Testing linter ruff-nbqa test basic_nb 1`] = ` "issueClass": "ISSUE_CLASS_EXISTING", "level": "LEVEL_HIGH", "linter": "ruff-nbqa", - "message": "/tmp/plugins_/test_data/basic_nb.in.ipynb:cell_1:1:8: F401 [*] \`os\` imported but unused -Found 1 error. -[*] 1 fixable with the \`--fix\` option.", + "message": "/tmp/plugins_/test_data/basic_nb.in.ipynb:cell_1:1:8: F401 [*] \`os\` imported but unused", "targetType": "jupyter", }, ], diff --git a/linters/ruff/test_data/ruff_nbqa_v0.5.0_basic_nb.check.shot b/linters/ruff/test_data/ruff_nbqa_v0.5.0_basic_nb.check.shot new file mode 100644 index 000000000..a7a64099f --- /dev/null +++ b/linters/ruff/test_data/ruff_nbqa_v0.5.0_basic_nb.check.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Testing linter ruff-nbqa test basic_nb 1`] = ` +{ + "issues": [ + { + "code": "error", + "file": "test_data/basic_nb.in.ipynb", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "linter": "ruff-nbqa", + "message": "/tmp/plugins_/test_data/basic_nb.in.ipynb:cell_1:1:8: F401 [*] \`os\` imported but unused + | +1 | # %%NBQA-CELL-SEP +2 | import os + | ^^ F401 +3 | +4 | print("Hello World!") + | + = help: Remove unused import: \`os\`", + "targetType": "jupyter", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff-nbqa", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff-nbqa", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/sqlfluff/plugin.yaml b/linters/sqlfluff/plugin.yaml index 139725a2c..e02c5384e 100644 --- a/linters/sqlfluff/plugin.yaml +++ b/linters/sqlfluff/plugin.yaml @@ -27,11 +27,20 @@ lint: parser: runtime: python run: python3 ${plugin}/linters/sqlfluff/sqlfluff_to_sarif.py + - name: fix + version: ">=3.0.0" + run: sqlfluff fix ${target} --disable-progress-bar + output: rewrite + formatter: true + in_place: true + success_codes: [0, 1] + enabled: false + batch: true - name: fix run: sqlfluff fix ${target} --disable-progress-bar --force output: rewrite formatter: true in_place: true - success_codes: [0] + success_codes: [0, 1] enabled: false batch: true diff --git a/linters/sqlfluff/sqlfluff.test.ts b/linters/sqlfluff/sqlfluff.test.ts index 6a8c24177..9d5076d23 100644 --- a/linters/sqlfluff/sqlfluff.test.ts +++ b/linters/sqlfluff/sqlfluff.test.ts @@ -18,4 +18,8 @@ const fmtCallbacks: TestCallback = (driver) => { }; // An additional test to run 'sqlfluff fmt' with some additional test setup. -linterFmtTest({ linterName: "sqlfluff", namedTestPrefixes: ["basic_fmt"], preCheck: fmtCallbacks }); +linterFmtTest({ + linterName: "sqlfluff", + namedTestPrefixes: ["basic_fmt", "basic_check"], + preCheck: fmtCallbacks, +}); diff --git a/linters/sqlfluff/test_data/sqlfluff_v1.4.2_basic_check.fmt.shot b/linters/sqlfluff/test_data/sqlfluff_v1.4.2_basic_check.fmt.shot new file mode 100644 index 000000000..0932f952c --- /dev/null +++ b/linters/sqlfluff/test_data/sqlfluff_v1.4.2_basic_check.fmt.shot @@ -0,0 +1,10 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Testing formatter sqlfluff test basic_check 1`] = ` +"SELECT + *, + 1, + blah AS foo +FROM myschema.mytable +" +`; diff --git a/linters/sqlfluff/test_data/sqlfluff_v2.0.0_basic_check.fmt.shot b/linters/sqlfluff/test_data/sqlfluff_v2.0.0_basic_check.fmt.shot new file mode 100644 index 000000000..0932f952c --- /dev/null +++ b/linters/sqlfluff/test_data/sqlfluff_v2.0.0_basic_check.fmt.shot @@ -0,0 +1,10 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Testing formatter sqlfluff test basic_check 1`] = ` +"SELECT + *, + 1, + blah AS foo +FROM myschema.mytable +" +`; diff --git a/linters/sqlfluff/test_data/sqlfluff_v3.0.0_basic_check.fmt.shot b/linters/sqlfluff/test_data/sqlfluff_v3.0.0_basic_check.fmt.shot new file mode 100644 index 000000000..0932f952c --- /dev/null +++ b/linters/sqlfluff/test_data/sqlfluff_v3.0.0_basic_check.fmt.shot @@ -0,0 +1,10 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Testing formatter sqlfluff test basic_check 1`] = ` +"SELECT + *, + 1, + blah AS foo +FROM myschema.mytable +" +`; diff --git a/linters/terraform/plugin.yaml b/linters/terraform/plugin.yaml index adf728c2d..ebfd9ef95 100644 --- a/linters/terraform/plugin.yaml +++ b/linters/terraform/plugin.yaml @@ -2,7 +2,7 @@ version: 0.1 lint: definitions: - name: terraform - files: [terraform] + files: [terraform, tfvars] tools: [terraform] description: Validate and format terraform files commands: diff --git a/linters/tofu/plugin.yaml b/linters/tofu/plugin.yaml index ef2cc66c2..fffce9a0d 100644 --- a/linters/tofu/plugin.yaml +++ b/linters/tofu/plugin.yaml @@ -2,7 +2,7 @@ version: 0.1 lint: definitions: - name: tofu - files: [terraform] + files: [terraform, tfvars] tools: [tofu] description: A Terraform validator and formatter commands: diff --git a/linters/trivy/trivy.test.ts b/linters/trivy/trivy.test.ts index a7616be51..9172f7b60 100644 --- a/linters/trivy/trivy.test.ts +++ b/linters/trivy/trivy.test.ts @@ -12,9 +12,20 @@ const callbackGenerator = const trunkYamlPath = ".trunk/trunk.yaml"; const currentContents = driver.readFile(trunkYamlPath); const trivyRegex = /- trivy@(.+)\n/; + + // fs-vuln, config sometimes fail in CI to query DB concurrently. + const extraContents = ` + definitions: + - name: trivy + commands: + - name: fs-vuln + max_concurrency: 1 + - name: config + max_concurrency: 1 +`; const newContents = currentContents.replace( trivyRegex, - `- trivy@$1:\n commands: [${command}]\n`, + `- trivy@$1:\n commands: [${command}]\n${extraContents}`, ); driver.writeFile(trunkYamlPath, newContents); if (otherPreCheck) { @@ -42,7 +53,7 @@ fuzzyLinterCheckTest({ linterName: "trivy", testName: "fs-vuln", args: "-a", - fileIssueAssertionCallback: createFuzzyMatcher(() => vulnExpectedFileIssues, 30), + fileIssueAssertionCallback: createFuzzyMatcher(() => vulnExpectedFileIssues, 20), preCheck: callbackGenerator("fs-vuln"), }); diff --git a/linters/vale/plugin.yaml b/linters/vale/plugin.yaml index 81e3d99d4..a96504be5 100644 --- a/linters/vale/plugin.yaml +++ b/linters/vale/plugin.yaml @@ -25,7 +25,8 @@ tools: known_good_version: 3.4.1 environment: - name: PATH - list: ["${tool}"] + # Needs access to shared libraries on Windows. + list: ["${tool}", "${env.PATH}"] lint: definitions: diff --git a/package-lock.json b/package-lock.json index 20a91a0de..6e45760db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,32 +16,32 @@ "@types/debug": "^4.1.12", "@types/jest": "^29.5.12", "@types/jest-specific-snapshot": "^0.5.9", - "@types/node": "^20.14.2", + "@types/node": "^20.14.10", "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^7.16.0", + "@typescript-eslint/parser": "^7.16.0", "caller": "^1.1.0", "debug": "^4.3.5", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-import-x": "^0.5.1", + "eslint-plugin-import-x": "^3.0.1", "eslint-plugin-jest": "^28.6.0", - "eslint-plugin-n": "^17.8.1", + "eslint-plugin-n": "^17.9.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "fast-sort": "^3.2.0", "jest": "^29.3.1", "jest-junit": "^16.0.0", "jest-specific-snapshot": "^8.0.0", "semver": "^7.6.2", - "simple-git": "^3.24.0", - "ts-jest": "^29.1.4", + "simple-git": "^3.25.0", + "ts-jest": "^29.2.2", "ts-node": "^10.9.2", "tsconfig-paths": "^4.1.2", - "typescript": "^5.4.5", - "typescript-eslint": "^7.12.0", + "typescript": "^5.5.3", + "typescript-eslint": "^7.16.0", "yaml": "^2.4.5" }, "engines": { @@ -1188,6 +1188,12 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "dev": true, @@ -1353,9 +1359,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", - "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", + "version": "20.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", + "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1386,16 +1392,16 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.12.0.tgz", - "integrity": "sha512-7F91fcbuDf/d3S8o21+r3ZncGIke/+eWk0EpO21LXhDfLahriZF9CGj4fbAetEjlaBdjdSm9a6VeXbpbT6Z40Q==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.0.tgz", + "integrity": "sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.12.0", - "@typescript-eslint/type-utils": "7.12.0", - "@typescript-eslint/utils": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0", + "@typescript-eslint/scope-manager": "7.16.0", + "@typescript-eslint/type-utils": "7.16.0", + "@typescript-eslint/utils": "7.16.0", + "@typescript-eslint/visitor-keys": "7.16.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1419,15 +1425,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.12.0.tgz", - "integrity": "sha512-dm/J2UDY3oV3TKius2OUZIFHsomQmpHtsV0FTh1WO8EKgHLQ1QCADUqscPgTpU+ih1e21FQSRjXckHn3txn6kQ==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.16.0.tgz", + "integrity": "sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.12.0", - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/typescript-estree": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0", + "@typescript-eslint/scope-manager": "7.16.0", + "@typescript-eslint/types": "7.16.0", + "@typescript-eslint/typescript-estree": "7.16.0", + "@typescript-eslint/visitor-keys": "7.16.0", "debug": "^4.3.4" }, "engines": { @@ -1447,13 +1453,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.12.0.tgz", - "integrity": "sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.16.0.tgz", + "integrity": "sha512-8gVv3kW6n01Q6TrI1cmTZ9YMFi3ucDT7i7aI5lEikk2ebk1AEjrwX8MDTdaX5D7fPXMBLvnsaa0IFTAu+jcfOw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0" + "@typescript-eslint/types": "7.16.0", + "@typescript-eslint/visitor-keys": "7.16.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1464,13 +1470,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.12.0.tgz", - "integrity": "sha512-lib96tyRtMhLxwauDWUp/uW3FMhLA6D0rJ8T7HmH7x23Gk1Gwwu8UZ94NMXBvOELn6flSPiBrCKlehkiXyaqwA==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.16.0.tgz", + "integrity": "sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.12.0", - "@typescript-eslint/utils": "7.12.0", + "@typescript-eslint/typescript-estree": "7.16.0", + "@typescript-eslint/utils": "7.16.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1491,9 +1497,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.12.0.tgz", - "integrity": "sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.16.0.tgz", + "integrity": "sha512-fecuH15Y+TzlUutvUl9Cc2XJxqdLr7+93SQIbcZfd4XRGGKoxyljK27b+kxKamjRkU7FYC6RrbSCg0ALcZn/xw==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1504,13 +1510,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.12.0.tgz", - "integrity": "sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.0.tgz", + "integrity": "sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0", + "@typescript-eslint/types": "7.16.0", + "@typescript-eslint/visitor-keys": "7.16.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1541,9 +1547,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -1556,15 +1562,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.12.0.tgz", - "integrity": "sha512-Y6hhwxwDx41HNpjuYswYp6gDbkiZ8Hin9Bf5aJQn1bpTs3afYY4GX+MPYxma8jtoIV2GRwTM/UJm/2uGCVv+DQ==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.16.0.tgz", + "integrity": "sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.12.0", - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/typescript-estree": "7.12.0" + "@typescript-eslint/scope-manager": "7.16.0", + "@typescript-eslint/types": "7.16.0", + "@typescript-eslint/typescript-estree": "7.16.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1578,12 +1584,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.12.0.tgz", - "integrity": "sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.0.tgz", + "integrity": "sha512-rMo01uPy9C7XxG7AFsxa8zLnWXTF8N3PYclekWSrurvhwiw1eW88mrKiAYe6s53AUY57nTRz8dJsuuXdkAhzCg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/types": "7.16.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1819,6 +1825,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "dev": true + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "dev": true, @@ -2279,6 +2291,21 @@ "node": ">=6.0.0" } }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.284", "dev": true, @@ -2626,11 +2653,12 @@ } }, "node_modules/eslint-plugin-import-x": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-0.5.1.tgz", - "integrity": "sha512-2JK8bbFOLes+gG6tgdnM8safCxMAj4u2wjX8X1BRFPfnY7Ct2hFYESoIcVwABX/DDcdpQFLGtKmzbNEWJZD9iQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-3.0.1.tgz", + "integrity": "sha512-jzQgJuE4ssxwNi0aMBkOL8whd4eHb0Z/uFWsk8uEoYB7xwTkAptSKojLzRswxgf/1bhH6QgcLjgabUBQqluBIg==", "dev": true, "dependencies": { + "@rtsao/scc": "^1.1.0", "@typescript-eslint/utils": "^7.4.0", "debug": "^4.3.4", "doctrine": "^3.0.0", @@ -2639,6 +2667,7 @@ "is-glob": "^4.0.3", "minimatch": "^9.0.3", "semver": "^7.6.0", + "stable-hash": "^0.0.4", "tslib": "^2.6.2" }, "engines": { @@ -2755,9 +2784,9 @@ } }, "node_modules/eslint-plugin-n": { - "version": "17.8.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.8.1.tgz", - "integrity": "sha512-KdG0h0voZms8UhndNu8DeWx1eM4sY+A4iXtsNo6kOfJLYHNeTGPacGalJ9GcvrbmOL3r/7QOMwVZDSw+1SqsrA==", + "version": "17.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.9.0.tgz", + "integrity": "sha512-CPSaXDXdrT4nsrOrO4mT4VB6FMUkoySRkHWuuJJHVqsIEjIeZgMY1H7AzSwPbDScikBmLN82KeM1u7ixV7PzGg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", @@ -2845,9 +2874,10 @@ } }, "node_modules/eslint-plugin-simple-import-sort": { - "version": "12.1.0", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", "dev": true, - "license": "MIT", "peerDependencies": { "eslint": ">=5.0.0" } @@ -3082,6 +3112,36 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fill-range": { "version": "7.0.1", "dev": true, @@ -3871,6 +3931,24 @@ "node": ">=8" } }, + "node_modules/jake": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", + "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", + "dev": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jest": { "version": "29.7.0", "dev": true, @@ -5345,13 +5423,14 @@ "license": "ISC" }, "node_modules/simple-git": { - "version": "3.24.0", + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.25.0.tgz", + "integrity": "sha512-KIY5sBnzc4yEcJXW7Tdv4viEz8KyG+nU0hay+DWZasvdFOYKeUZ6Xc25LUHHjw0tinPT7O1eY6pzX7pRT1K8rw==", "dev": true, - "license": "MIT", "dependencies": { "@kwsites/file-exists": "^1.1.1", "@kwsites/promise-deferred": "^1.1.1", - "debug": "^4.3.4" + "debug": "^4.3.5" }, "funding": { "type": "github", @@ -5393,6 +5472,12 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/stable-hash": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", + "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "dev": true + }, "node_modules/stack-utils": { "version": "2.0.6", "dev": true, @@ -5645,12 +5730,13 @@ } }, "node_modules/ts-jest": { - "version": "29.1.4", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.4.tgz", - "integrity": "sha512-YiHwDhSvCiItoAgsKtoLFCuakDzDsJ1DLDnSouTaTmdOcOwIkSzbLXduaQ6M5DRVhuZC/NYaaZ/mtHbWMv/S6Q==", + "version": "29.2.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.2.tgz", + "integrity": "sha512-sSW7OooaKT34AAngP6k1VS669a0HdLxkQZnlC7T76sckGCokXFnvJ3yRlQZGRTAoV5K19HfSgCiSwWOSIfcYlg==", "dev": true, "dependencies": { "bs-logger": "0.x", + "ejs": "^3.0.0", "fast-json-stable-stringify": "2.x", "jest-util": "^29.0.0", "json5": "^2.2.3", @@ -5851,9 +5937,10 @@ } }, "node_modules/typescript": { - "version": "5.4.5", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5863,14 +5950,14 @@ } }, "node_modules/typescript-eslint": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.12.0.tgz", - "integrity": "sha512-D6HKNbQcnNu3BaN4HkQCR16tgG8Q2AMUWPgvhrJksOXu+d6ys07yC06ONiV2kcsEfWC22voB6C3PvK2MqlBZ7w==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.16.0.tgz", + "integrity": "sha512-kaVRivQjOzuoCXU6+hLnjo3/baxyzWVO5GrnExkFzETRYJKVHYkrJglOu2OCm8Hi9RPDWX1PTNNTpU5KRV0+RA==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "7.12.0", - "@typescript-eslint/parser": "7.12.0", - "@typescript-eslint/utils": "7.12.0" + "@typescript-eslint/eslint-plugin": "7.16.0", + "@typescript-eslint/parser": "7.16.0", + "@typescript-eslint/utils": "7.16.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" diff --git a/package.json b/package.json index 2a5c1a73d..2fa247fdd 100644 --- a/package.json +++ b/package.json @@ -14,32 +14,32 @@ "@types/debug": "^4.1.12", "@types/jest": "^29.5.12", "@types/jest-specific-snapshot": "^0.5.9", - "@types/node": "^20.14.2", + "@types/node": "^20.14.10", "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^7.16.0", + "@typescript-eslint/parser": "^7.16.0", "caller": "^1.1.0", "debug": "^4.3.5", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-import-x": "^0.5.1", + "eslint-plugin-import-x": "^3.0.1", "eslint-plugin-jest": "^28.6.0", - "eslint-plugin-n": "^17.8.1", + "eslint-plugin-n": "^17.9.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-simple-import-sort": "^12.1.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "fast-sort": "^3.2.0", "jest": "^29.3.1", "jest-junit": "^16.0.0", "jest-specific-snapshot": "^8.0.0", "semver": "^7.6.2", - "simple-git": "^3.24.0", - "ts-jest": "^29.1.4", + "simple-git": "^3.25.0", + "ts-jest": "^29.2.2", "ts-node": "^10.9.2", "tsconfig-paths": "^4.1.2", - "typescript": "^5.4.5", - "typescript-eslint": "^7.12.0", + "typescript": "^5.5.3", + "typescript-eslint": "^7.16.0", "yaml": "^2.4.5" }, "bundleDependencies": [ diff --git a/tests/driver/driver.ts b/tests/driver/driver.ts index 478ca93b4..6716ecc9a 100644 --- a/tests/driver/driver.ts +++ b/tests/driver/driver.ts @@ -31,8 +31,8 @@ const UNINITIALIZED_ERROR = `You have attempted to modify the sandbox before it Please call this method after setup has been called.`; export const executionEnv = (sandbox: string) => { - // trunk-ignore(eslint/@typescript-eslint/no-unused-vars): Strip TRUNK_CLI_VERSION from CI-Debugger - const { PWD, INIT_CWD, TRUNK_CLI_VERSION, ...strippedEnv } = process.env; + // trunk-ignore(eslint/@typescript-eslint/no-unused-vars): Remove vars. + const { PWD, INIT_CWD, ...strippedEnv } = process.env; return { ...strippedEnv, // This keeps test downloads separate from manual trunk invocations diff --git a/tests/parse/index.ts b/tests/parse/index.ts index 3a4bd4602..a2fe0b0a1 100644 --- a/tests/parse/index.ts +++ b/tests/parse/index.ts @@ -16,8 +16,7 @@ const RESULTS_FILE = path.resolve(REPO_ROOT, "results.json"); const FAILURES_FILE = path.resolve(REPO_ROOT, "failures.json"); const RERUN_FILE = path.resolve(REPO_ROOT, "reruns.txt"); -// TODO(Tyler): Remove this blocklist once eslint-friendly release is out. -const VALIDATED_LINTER_BLOCKLIST = ["eslint"]; +const VALIDATED_LINTER_BLOCKLIST: string[] = []; const RUN_ID = process.env.RUN_ID ?? ""; const TEST_REF = process.env.TEST_REF ?? "latest release"; diff --git a/tests/utils/landing_state.ts b/tests/utils/landing_state.ts index 4a325fd2d..bae5606ae 100644 --- a/tests/utils/landing_state.ts +++ b/tests/utils/landing_state.ts @@ -76,6 +76,7 @@ const normalizeMessage = (message?: string) => .replaceAll("\\", "/") .replace(/\/plugins_.{6}/gm, "/plugins_") .replace(".dup.", ".") + .replace(/NBQA-CELL-SEP.{6}/gm, "NBQA-CELL-SEP") .trim(); // trunk-ignore(eslint/@typescript-eslint/no-non-null-assertion)