Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 0 additions & 118 deletions .github/workflows/glibc_smoke_test.yml

This file was deleted.

1 change: 1 addition & 0 deletions ci/run_oss_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ steps:
mavenPOMFile: "questdb/pom.xml"
jdkVersionOption: "default"
goals: "test"
mavenOptions: "-Xlog:gc -Dfile.encoding=UTF-8 -Xmx3072m -XX:+UseParallelGC"
options: "--batch-mode --quiet
-Dtest.include=**/cutlass/http/line/*,**/cutlass/line/**/*
-DfailIfNoTests=false
Expand Down
4 changes: 4 additions & 0 deletions ci/validate-pr-title/dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { danger, fail } = require("danger");
const { validate } = require("./validate");

validate({ title: danger.github.pr.title, onError: fail });
5 changes: 5 additions & 0 deletions ci/validate-pr-title/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This folder contains configuration files which are used to run validation rules on Github pull requests titles.

It is done by running [Danger JS](https://danger.systems/js/) tool in [github action](../../.github/workflows/danger.yml).

In addition, the validation rules are tested. Tests can be executed with node, by running `node ./validate.test.js`
67 changes: 67 additions & 0 deletions ci/validate-pr-title/validate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
const allowedTypes = [
"feat",
"fix",
"chore",
"docs",
"style",
"refactor",
"perf",
"test",
"ci",
"revert",
];

const allowedSubTypes = [
"build",
"log",
"core",
"ilp",
"http",
"conf",
"utils",
];

const errorMessage = `
Please update the PR title to match this format:
\`type(subType): description\`

Where \`type\` is one of:
${allowedTypes.map((t) => `\`${t}\``).join(", ")}

And: \`subType\` is one of:
${allowedSubTypes.map((t) => `\`${t}\``).join(", ")}

For Example:

\`\`\`
perf(sql): improve pattern matching performance for SELECT sub-queries
\`\`\`
`.trim();

/* The basic valid PR title formats are:
* 1. allowedType(allowedSubtype): optional description
* 2. allowedType: optional description
*
* consult ./validate.test.js for a full list
* */
const prTitleRegex = new RegExp(
`^(((?:${allowedTypes.join("|")})\\((?:${allowedSubTypes.join(
"|",
)})\\))|build): .*`,
);

function validate({ title, onError }) {
// Early return for title that matches predefined regex.
// No action required in such case.
if (title.match(prTitleRegex)) {
return;
}

onError(errorMessage);
}

module.exports = {
allowedTypes,
allowedSubTypes,
validate,
};
38 changes: 38 additions & 0 deletions ci/validate-pr-title/validate.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const assert = require("node:assert").strict;
const { validate, allowedTypes, allowedSubTypes } = require("./validate");

const testValid = (title) =>
assert.doesNotThrow(() =>
validate({
title,
onError: () => {
throw `should accept "${title}"`;
},
})
);

const testInvalid = (title) =>
assert.throws(
() => validate({ title, onError }),
`should NOT accept "${title}"`
);

allowedTypes.forEach((type) => {
allowedSubTypes.forEach((subType) => {
testValid(
`${type}(${subType}): foo`,
`should accept "${type}(${subType}): foo"`
);
});
});

testValid("build: 6.6");
testValid("build: hello world");
testInvalid("build");

testValid(`build: house`);
testInvalid(`build(house)`);

testInvalid(`foo: bar`);
testInvalid(`update(bar): baz`);
testInvalid(`ui: updating stuff`);