From 316eda2d67048601929444b02c79987ce38a24a2 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Mon, 22 Jan 2024 18:12:34 +0000 Subject: [PATCH 1/2] build: update control-plane submodule addressing infinite rebuilds This should address the inifite rebuild issue when no code change is made. Dev UX should now improve as consecutive cargo builds should not rebuild. Signed-off-by: Tiago Castro --- dependencies/control-plane | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/control-plane b/dependencies/control-plane index d28c0ea14..6869243c9 160000 --- a/dependencies/control-plane +++ b/dependencies/control-plane @@ -1 +1 @@ -Subproject commit d28c0ea14eb8d475d25c544b4e1ec6d8fe5c48c8 +Subproject commit 6869243c9f17783e7b8bbafe9218975cb18c692e From 7edc7691cec4b4dc1fc09f69521e88d7694e4137 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Mon, 22 Jan 2024 18:19:10 +0000 Subject: [PATCH 2/2] ci: try to further sanitize commits before merging Checks for a few common words and outputs the error if found. These commits bring no value when browsing the history and should be squashed onto the parent commit. Checks for duplicate commit subjects. Signed-off-by: Tiago Castro --- .github/workflows/pr-commitlint.yml | 10 ++++++++++ commitlint.config.js | 12 +----------- 2 files changed, 11 insertions(+), 11 deletions(-) mode change 100644 => 120000 commitlint.config.js diff --git a/.github/workflows/pr-commitlint.yml b/.github/workflows/pr-commitlint.yml index f6e2208e3..61e7f566b 100644 --- a/.github/workflows/pr-commitlint.yml +++ b/.github/workflows/pr-commitlint.yml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 with: + submodules: true fetch-depth: 0 - name: Install CommitLint and Dependencies run: npm install @commitlint/config-conventional @commitlint/cli @@ -21,5 +22,14 @@ jobs: if [ ! ${{ github.ref }} = "refs/heads/staging" ]; then first_commit=${{ github.event.pull_request.base.sha }} last_commit=${{ github.event.pull_request.head.sha }} + # Ensure code-review commits don't get merged + sed "s/code-review-rule': \[0/code-review-rule': [2/g" -i commitlint.config.js npx commitlint --from $first_commit --to $last_commit -V + + git log --pretty=format:%s $first_commit..$last_commit > ./subjects + duplicates="$(cat ./subjects | sort | uniq -D)" + if [ "$duplicates" != "" ]; then + echo -e "Duplicate commits found:\n$duplicates" >&2 + exit 1 + fi fi diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 03386415a..000000000 --- a/commitlint.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - extends: ['@commitlint/config-conventional'], - rules: { - 'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'example']], - }, - defaultIgnores: false, - ignores: [ - (message) => message.startsWith('chore(bors): merge pull request #'), - (message) => message.startsWith('Merge #') - ] -} diff --git a/commitlint.config.js b/commitlint.config.js new file mode 120000 index 000000000..efb28e555 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +dependencies/control-plane/commitlint.config.js \ No newline at end of file