From 9d9192e5a3065f98e302923060c7ca61ccc2bb4f Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Wed, 22 May 2024 21:25:05 -0700 Subject: [PATCH 1/4] handle flaky better --- .github/actions/linter_tests/action.yaml | 7 +++++++ .github/workflows/nightly.yaml | 2 ++ .github/workflows/pr.yaml | 2 ++ .github/workflows/repo_tests.reusable.yaml | 5 ++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/actions/linter_tests/action.yaml b/.github/actions/linter_tests/action.yaml index 4ab985cee..1d5fb674e 100644 --- a/.github/actions/linter_tests/action.yaml +++ b/.github/actions/linter_tests/action.yaml @@ -45,6 +45,13 @@ runs: - name: Install packages and specify defaults run: | echo "CLI_PATH=${{ inputs.cli-path }}" >> "$GITHUB_ENV" + if [[ "${{ inputs.linter-version }}" == "Latest" ]]; then + echo "JEST_LINTER_VERSION=Latest" >> "$GITHUB_ENV" + else + # If the linter version is KnownGoodVersions, coalesce to Snapshots + # For flaky analysis. + echo "JEST_LINTER_VERSION=Snapshots" >> "$GITHUB_ENV" + fi case "$RUNNER_OS" in Linux) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 91be87085..faf679083 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -266,6 +266,8 @@ jobs: repo_tests: name: Repo Tests uses: ./.github/workflows/repo_tests.reusable.yaml + secrets: + trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} action_tests_main: name: Action Tests Main diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index f8ada79d3..8046b534c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -293,6 +293,8 @@ jobs: needs: detect_changes if: needs.detect_changes.outputs.repo-tests == 'true' uses: ./.github/workflows/repo_tests.reusable.yaml + secrets: + trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} report_test_success: if: ${{ always() }} diff --git a/.github/workflows/repo_tests.reusable.yaml b/.github/workflows/repo_tests.reusable.yaml index 379bf28a5..bc6378971 100644 --- a/.github/workflows/repo_tests.reusable.yaml +++ b/.github/workflows/repo_tests.reusable.yaml @@ -12,6 +12,9 @@ on: cli-path: required: false type: string + secrets: + trunk-token: + required: false permissions: contents: read @@ -48,7 +51,7 @@ jobs: with: junit-paths: junit.xml org-slug: trunk-staging-org - token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + token: ${{ secrets.trunk-token }}} continue-on-error: true env: TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io From 1424fe5d7487fd3392732740621b2f77fc92109c Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Wed, 22 May 2024 21:35:04 -0700 Subject: [PATCH 2/4] fix coalescing --- .github/actions/linter_tests/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/linter_tests/action.yaml b/.github/actions/linter_tests/action.yaml index 1d5fb674e..d68843357 100644 --- a/.github/actions/linter_tests/action.yaml +++ b/.github/actions/linter_tests/action.yaml @@ -126,7 +126,7 @@ runs: DEBUG: Driver:nixpkgs-fmt:*, Driver:eslint:* JEST_SUITE_NAME: Linter Tests JEST_JUNIT_SUITE_NAME: - "{title} ${{ runner.os }} ${{ inputs.ref-type }} ${{ inputs.linter-version }}" + "{title} ${{ runner.os }} ${{ inputs.ref-type }} ${{ env.JEST_LINTER_VERSION }}" - name: Upload results # TODO(Tyler): Add upload on MacOS/Windows once the action supports it. From 9b90a6e8102feb9818ae67698fdd73de353eb433 Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Wed, 22 May 2024 23:04:18 -0700 Subject: [PATCH 3/4] deliberately break yamllint --- linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot b/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot index 83ff0a7cf..f36afc9c8 100644 --- a/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot +++ b/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot @@ -4,7 +4,7 @@ exports[`Testing linter yamllint test basic 1`] = ` { "issues": [ { - "code": "quoted-strings", + "code": "quote-strings", "column": "6", "file": "test_data/basic.in.yaml", "issueClass": "ISSUE_CLASS_EXISTING", From 84184a0f607de30354d14a2338aff3f3e995b4b5 Mon Sep 17 00:00:00 2001 From: Tyler Jang Date: Wed, 22 May 2024 23:32:45 -0700 Subject: [PATCH 4/4] revert yamllint and streamline repo_tests --- .github/workflows/nightly.yaml | 2 -- .github/workflows/pr.yaml | 2 -- .github/workflows/repo_tests.reusable.yaml | 14 -------------- .../test_data/yamllint_v1.26.3_basic.check.shot | 2 +- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index faf679083..91be87085 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -266,8 +266,6 @@ jobs: repo_tests: name: Repo Tests uses: ./.github/workflows/repo_tests.reusable.yaml - secrets: - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} action_tests_main: name: Action Tests Main diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 8046b534c..f8ada79d3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -293,8 +293,6 @@ jobs: needs: detect_changes if: needs.detect_changes.outputs.repo-tests == 'true' uses: ./.github/workflows/repo_tests.reusable.yaml - secrets: - trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} report_test_success: if: ${{ always() }} diff --git a/.github/workflows/repo_tests.reusable.yaml b/.github/workflows/repo_tests.reusable.yaml index bc6378971..c188d5372 100644 --- a/.github/workflows/repo_tests.reusable.yaml +++ b/.github/workflows/repo_tests.reusable.yaml @@ -12,9 +12,6 @@ on: cli-path: required: false type: string - secrets: - trunk-token: - required: false permissions: contents: read @@ -44,14 +41,3 @@ jobs: JEST_SUITE_NAME: Repo Tests PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }} PLUGINS_TEST_CLI_PATH: ${{ inputs.cli-path }} - - - name: Upload results - if: "!cancelled()" - uses: trunk-io/analytics-uploader@main - with: - junit-paths: junit.xml - org-slug: trunk-staging-org - token: ${{ secrets.trunk-token }}} - continue-on-error: true - env: - TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io diff --git a/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot b/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot index f36afc9c8..83ff0a7cf 100644 --- a/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot +++ b/linters/yamllint/test_data/yamllint_v1.26.3_basic.check.shot @@ -4,7 +4,7 @@ exports[`Testing linter yamllint test basic 1`] = ` { "issues": [ { - "code": "quote-strings", + "code": "quoted-strings", "column": "6", "file": "test_data/basic.in.yaml", "issueClass": "ISSUE_CLASS_EXISTING",