From f66ccf2e539f9d0323019a23f92808e128f69b5c Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Tue, 14 Nov 2023 16:58:00 +0100 Subject: [PATCH] Sort branches such that higher numbers are first (more recent branches) --- .../app/tests/branchConfigurator.test.js | 117 ++++++++++++++++++ .../src/components/common/BranchSelect.vue | 22 +--- .../src/configurators/BranchConfigurator.ts | 23 ++++ 3 files changed, 143 insertions(+), 19 deletions(-) create mode 100644 dashboard/app/tests/branchConfigurator.test.js diff --git a/dashboard/app/tests/branchConfigurator.test.js b/dashboard/app/tests/branchConfigurator.test.js new file mode 100644 index 00000000..997ec5c8 --- /dev/null +++ b/dashboard/app/tests/branchConfigurator.test.js @@ -0,0 +1,117 @@ +import { expect, test } from "vitest" +import { sortBranches } from "new-dashboard/src/configurators/BranchConfigurator" + +test("sort branches", () => { + const branches = [ + "abubenchikov/maven-cache-interpolation", + "abubenchikov/maven-only-root-poms", + "akoehler/233_additional_logging_for_IDEA-242343", + "akoehler/with_akuznezov_6271d740e94a", + "alexey.kryuchkov/checkout-with-disabled-mapping", + "master", + "semantic-search-perf-impact-with-actions", + "alexey.kryuchkov/investigate-storing-time", + "alexey.kryuchkov/spans-with-the-samename-test", + "yaroshchuk/IJI-1297-perf-tests", + "yartamonov/crazy-visitors", + "alexey.kryuchkov/trying-to-reset-all-branches-bycommit-hash", + "cheremin/fast-file-attributes-over-mmapped-file", + "dz/vcs-log-loading-details-separate-statistics-current-scope", + "cheremin/IJPL-193-enable-new-filepagecache", + "cheremin/vfs-enable-fast-names-enumerator", + "cheremin/vfs-refactoring", + "db/in-memory-indexes", + "dz/git-branches-popup-building-tree-span", + "231", + "232", + "233", + "dz/vcs-log-loading-details-end-span-before-process-wait", + "dz/vcs-log-loading-details-separate-statistics", + "alexey.kryuchkov/investigate-multiple-scheduling", + "dz/vcs-log-loading-details-without-processing-tests", + "gliullin/fix-class-names-in-perfomance-tests", + "gliullin/VS-1490/VS-1490/do-not-perform-synchronous-refresh-under-read-lock", + "gliullin/VS-1591/do-not-perform-synchronous-refresh-under-read-lock", + "gregsh/actions", + "lena/indexingStampRevertExperiment", + "lena/indexingTestIndexingStampInvestigation", + "maxim.kolmakov/1s-recent-files", + "maxim.kolmakov/500-lines-intellij-preloading", + "maxim.kolmakov/5000-lines-and-5-seconds", + "maxim.kolmakov/5000-lines-limit", + "maxim.kolmakov/disable-OT", + "msokolov/idea-314818-3", + "msokolov/idea-314818-4", + "msokolov/idea-314818-5", + "nikita.barkov/16_09_maven_degradation_after", + "nikita.barkov/maven_degradation_investigation_before", + "nikita.barkov/maven_degradation_with_suspect", + "nikita.barkov/maven_import_before_fixed_flag", + "plate/caches", + "plate/changelog", + "plate/disabledCaches", + "plate/squashHarder", + "shagvaliev/package-checker-refactor", + "vadim.salavatov/IJPL-52-optimization-baseline", + "vadim.salavatov/IJPL-52-optimization-baseline-low", + "vadim.salavatov/IJPL-52-optimize-no-workers", + "wsm/sdk_wip", + "semantic-search-perf-impact-with-all-together", + ].sort(sortBranches) + expect(branches).toStrictEqual([ + "master", + "233", + "232", + "231", + "abubenchikov/maven-cache-interpolation", + "abubenchikov/maven-only-root-poms", + "akoehler/233_additional_logging_for_IDEA-242343", + "akoehler/with_akuznezov_6271d740e94a", + "alexey.kryuchkov/checkout-with-disabled-mapping", + "alexey.kryuchkov/investigate-multiple-scheduling", + "alexey.kryuchkov/investigate-storing-time", + "alexey.kryuchkov/spans-with-the-samename-test", + "alexey.kryuchkov/trying-to-reset-all-branches-bycommit-hash", + "cheremin/fast-file-attributes-over-mmapped-file", + "cheremin/IJPL-193-enable-new-filepagecache", + "cheremin/vfs-enable-fast-names-enumerator", + "cheremin/vfs-refactoring", + "db/in-memory-indexes", + "dz/git-branches-popup-building-tree-span", + "dz/vcs-log-loading-details-end-span-before-process-wait", + "dz/vcs-log-loading-details-separate-statistics", + "dz/vcs-log-loading-details-separate-statistics-current-scope", + "dz/vcs-log-loading-details-without-processing-tests", + "gliullin/fix-class-names-in-perfomance-tests", + "gliullin/VS-1490/VS-1490/do-not-perform-synchronous-refresh-under-read-lock", + "gliullin/VS-1591/do-not-perform-synchronous-refresh-under-read-lock", + "gregsh/actions", + "lena/indexingStampRevertExperiment", + "lena/indexingTestIndexingStampInvestigation", + "maxim.kolmakov/1s-recent-files", + "maxim.kolmakov/500-lines-intellij-preloading", + "maxim.kolmakov/5000-lines-and-5-seconds", + "maxim.kolmakov/5000-lines-limit", + "maxim.kolmakov/disable-OT", + "msokolov/idea-314818-3", + "msokolov/idea-314818-4", + "msokolov/idea-314818-5", + "nikita.barkov/16_09_maven_degradation_after", + "nikita.barkov/maven_degradation_investigation_before", + "nikita.barkov/maven_degradation_with_suspect", + "nikita.barkov/maven_import_before_fixed_flag", + "plate/caches", + "plate/changelog", + "plate/disabledCaches", + "plate/squashHarder", + "shagvaliev/package-checker-refactor", + "vadim.salavatov/IJPL-52-optimization-baseline", + "vadim.salavatov/IJPL-52-optimization-baseline-low", + "vadim.salavatov/IJPL-52-optimize-no-workers", + "wsm/sdk_wip", + "yaroshchuk/IJI-1297-perf-tests", + "yartamonov/crazy-visitors", + "semantic-search-perf-impact-with-actions", + "semantic-search-perf-impact-with-all-together", + ]) +}) diff --git a/dashboard/new-dashboard/src/components/common/BranchSelect.vue b/dashboard/new-dashboard/src/components/common/BranchSelect.vue index ba4548b6..7ed9affd 100644 --- a/dashboard/new-dashboard/src/components/common/BranchSelect.vue +++ b/dashboard/new-dashboard/src/components/common/BranchSelect.vue @@ -142,6 +142,7 @@