diff --git a/.github/workflows/checklist_comment_on_new_pr.yml b/.github/workflows/checklist_comment_on_new_pr.yml index fda81de21..cb287ef05 100644 --- a/.github/workflows/checklist_comment_on_new_pr.yml +++ b/.github/workflows/checklist_comment_on_new_pr.yml @@ -1,6 +1,7 @@ name: Comment on new Pull Request with checklist on: - pull_request: + # safe as long as this workflow doesn't access code from the PR branch + pull_request_target: types: opened jobs: diff --git a/.github/workflows/run-bench.yml b/.github/workflows/run-bench.yml index 1b9533cad..68eff8ab0 100644 --- a/.github/workflows/run-bench.yml +++ b/.github/workflows/run-bench.yml @@ -24,6 +24,7 @@ on: - '**/src/main/java/**' - 'pom.xml' - '**/pom.xml' + - '.github/workflows/run-bench.yml' jobs: # Job to generate the matrix configuration @@ -41,8 +42,8 @@ jobs: # Default branches based on event type if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "Pull request detected. Using main and PR branch: ${{ github.head_ref }}" - BRANCHES='["main", "${{ github.head_ref }}"]' + echo "Pull request detected. Using main and PR ref: ${{ github.ref }}" + BRANCHES='["main", "${{ github.ref }}"]' elif [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.branches }}" ]]; then # Parse space-separated branches input into JSON array echo "Workflow dispatch with branches input detected" diff --git a/.github/workflows/run-compaction.yml b/.github/workflows/run-compaction.yml index 49f72b64b..4fdc9ad58 100644 --- a/.github/workflows/run-compaction.yml +++ b/.github/workflows/run-compaction.yml @@ -19,6 +19,7 @@ on: - '**/src/main/java/**' - 'pom.xml' - '**/pom.xml' + - '.github/workflows/run-compaction.yml' jobs: # Job to generate the matrix configuration @@ -31,7 +32,7 @@ jobs: id: set-matrix run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - BRANCHES='["main", "${{ github.head_ref }}"]' + BRANCHES='["main", "${{ github.ref }}"]' elif [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.branches }}" ]]; then BRANCHES_INPUT="${{ github.event.inputs.branches }}" BRANCHES="[" diff --git a/jvector-examples/src/main/java/io/github/jbellis/jvector/example/AutoBenchYAML.java b/jvector-examples/src/main/java/io/github/jbellis/jvector/example/AutoBenchYAML.java index 3f5be3d7d..24c39ae47 100644 --- a/jvector-examples/src/main/java/io/github/jbellis/jvector/example/AutoBenchYAML.java +++ b/jvector-examples/src/main/java/io/github/jbellis/jvector/example/AutoBenchYAML.java @@ -102,6 +102,10 @@ public static void main(String[] args) throws IOException { var datasetCollection = DatasetCollection.load(); var datasetNames = datasetCollection.getSection(REGRESSION_TEST_KEY).stream().filter(dn -> pattern.matcher(dn).find()).collect(Collectors.toList()); + if (datasetNames.size() == 0) { + throw new RuntimeException("No datasets matched the given patterns, nothing to do"); + } + logger.info("Executing the following datasets: {}", datasetNames); List results = new ArrayList<>(); List compactionResults = new ArrayList<>();