Allow CI to only run the compiler warnings task
Hi hackers,
While working on a new pg_logicalinspect module ([1]/messages/by-id/ZuF2Okt7aBR//bxu@ip-10-97-1-34.eu-west-3.compute.internal), I reached a point where
all the CI tests were green except the compiler warnings one. Then, to save time
addressing the issue, I modified the .cirrus.tasks.yml file to $SUBJECT.
I think this could be useful for others too, so please find attached this tiny
patch.
Note that the patch does not add an extra "ci-task-only", but for simplicity it
it renames ci-os-only to ci-task-only.
[1]: /messages/by-id/ZuF2Okt7aBR//bxu@ip-10-97-1-34.eu-west-3.compute.internal
Looking forward to your feedback,
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
v1-0001-Allow-CI-to-only-run-the-compiler-warnings-task.patchtext/x-diff; charset=us-asciiDownload
From b7289ee0f909e905b0e083cd3be41910c9c6a827 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Wed, 11 Sep 2024 11:01:41 +0000
Subject: [PATCH v1] Allow CI to only run the compiler warnings task
That could be useful to only run the CI compiler warnings task when addressing
compiler warnings issues.
Renaming ci-os-only to ci-task-only and adding filtering for the "compilerwarnings"
task.
---
.cirrus.tasks.yml | 16 ++++++++--------
src/tools/ci/README | 7 ++++---
2 files changed, 12 insertions(+), 11 deletions(-)
22.5% src/tools/ci/
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 90cb95c868..a4e3b51045 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -59,7 +59,7 @@ task:
# push-wait-for-ci cycle time a bit when debugging operating system specific
# failures. Uses skip instead of only_if, as cirrus otherwise warns about
# only_if conditions not matching.
- skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
+ skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:.*'
env:
CPUS: 4
@@ -142,7 +142,7 @@ task:
<<: *freebsd_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*freebsd.*'
sysinfo_script: |
id
@@ -282,7 +282,7 @@ task:
<<: *linux_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*linux.*'
ccache_cache:
folder: ${CCACHE_DIR}
@@ -441,7 +441,7 @@ task:
<<: *macos_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*(macos|darwin|osx).*'
sysinfo_script: |
id
@@ -560,7 +560,7 @@ task:
<<: *windows_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*windows.*'
setup_additional_packages_script: |
REM choco install -y --no-progress ...
@@ -598,8 +598,8 @@ task:
# due to resource constraints we don't run this task by default for now
trigger_type: manual
# worth using only_if despite being manual, otherwise this task will show up
- # when e.g. ci-os-only: linux is used.
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
+ # when e.g. ci-task-only: linux is used.
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*mingw.*'
# otherwise it'll be sorted before other tasks
depends_on: SanityCheck
@@ -658,7 +658,7 @@ task:
# use always: to continue after failures. Task that did not run count as a
# success, so we need to recheck SanityChecks's condition here ...
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*compilerwarnings.*'
env:
CPUS: 4
diff --git a/src/tools/ci/README b/src/tools/ci/README
index 30ddd200c9..da4125defa 100644
--- a/src/tools/ci/README
+++ b/src/tools/ci/README
@@ -61,10 +61,11 @@ Controlling CI via commit messages
The behavior of CI can be controlled by special content in commit
messages. Currently the following controls are available:
-- ci-os-only: {(freebsd|linux|macos|windows|mingw)}
+- ci-task-only: {(freebsd|linux|macos|windows|mingw|compilerwarnings)}
- Only runs CI on operating systems specified. This can be useful when
- addressing portability issues affecting only a subset of platforms.
+ Only runs CI compiler warnings or on operating systems specified. This can be
+ useful when addressing portability issues affecting only a subset of platforms
+ or when addressing compiler warnings issues.
Using custom compute resources for CI
--
2.34.1
Hi,
On Wed, 11 Sept 2024 at 15:36, Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:
Hi hackers,
While working on a new pg_logicalinspect module ([1]), I reached a point where
all the CI tests were green except the compiler warnings one. Then, to save time
addressing the issue, I modified the .cirrus.tasks.yml file to $SUBJECT.I think this could be useful for others too, so please find attached this tiny
patch.
+1 for this. I encountered the same issue before.
Note that the patch does not add an extra "ci-task-only", but for simplicity it
it renames ci-os-only to ci-task-only.
I think this change makes sense. I gave a quick try to your patch with
ci-task-only: ["", "linux", "compilerwarnings"] and it worked as
expected.
--
Regards,
Nazir Bilal Yavuz
Microsoft
Hi,
On Wed, Sep 11, 2024 at 04:39:57PM +0300, Nazir Bilal Yavuz wrote:
Hi,
On Wed, 11 Sept 2024 at 15:36, Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:Hi hackers,
While working on a new pg_logicalinspect module ([1]), I reached a point where
all the CI tests were green except the compiler warnings one. Then, to save time
addressing the issue, I modified the .cirrus.tasks.yml file to $SUBJECT.I think this could be useful for others too, so please find attached this tiny
patch.+1 for this. I encountered the same issue before.
Thanks for the feedback!
Note that the patch does not add an extra "ci-task-only", but for simplicity it
it renames ci-os-only to ci-task-only.I think this change makes sense. I gave a quick try to your patch with
ci-task-only: ["", "linux", "compilerwarnings"] and it worked as
expected.
And for the testing.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Hi,
On Thu, Sep 12, 2024 at 05:21:43AM +0000, Bertrand Drouvot wrote:
Hi,
On Wed, Sep 11, 2024 at 04:39:57PM +0300, Nazir Bilal Yavuz wrote:
Hi,
On Wed, 11 Sept 2024 at 15:36, Bertrand Drouvot
<bertranddrouvot.pg@gmail.com> wrote:Hi hackers,
While working on a new pg_logicalinspect module ([1]), I reached a point where
all the CI tests were green except the compiler warnings one. Then, to save time
addressing the issue, I modified the .cirrus.tasks.yml file to $SUBJECT.I think this could be useful for others too, so please find attached this tiny
patch.+1 for this. I encountered the same issue before.
Thanks for the feedback!
Note that the patch does not add an extra "ci-task-only", but for simplicity it
it renames ci-os-only to ci-task-only.I think this change makes sense. I gave a quick try to your patch with
ci-task-only: ["", "linux", "compilerwarnings"] and it worked as
expected.And for the testing.
Mandatory rebase attached.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
v2-0001-Allow-CI-to-only-run-the-compiler-warnings-task.patchtext/x-diff; charset=us-asciiDownload
From 504181905666fdada111c51ff2b682a86f88da5e Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Wed, 11 Sep 2024 11:01:41 +0000
Subject: [PATCH v2] Allow CI to only run the compiler warnings task
That could be useful to only run the CI compiler warnings task when addressing
compiler warnings issues.
Renaming ci-os-only to ci-task-only and adding filtering for the "compilerwarnings"
task.
---
.cirrus.tasks.yml | 20 ++++++++++----------
src/tools/ci/README | 7 ++++---
2 files changed, 14 insertions(+), 13 deletions(-)
19.6% src/tools/ci/
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 5849cbb839a..5aac99e2666 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -72,7 +72,7 @@ task:
# push-wait-for-ci cycle time a bit when debugging operating system specific
# failures. Uses skip instead of only_if, as cirrus otherwise warns about
# only_if conditions not matching.
- skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
+ skip: $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:.*'
env:
CPUS: 4
@@ -167,7 +167,7 @@ task:
<<: *freebsd_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*freebsd.*'
sysinfo_script: |
id
@@ -257,7 +257,7 @@ task:
matrix:
- name: NetBSD - Meson
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*netbsd.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*netbsd.*'
env:
OS_NAME: netbsd
IMAGE_FAMILY: pg-ci-netbsd-postgres
@@ -274,7 +274,7 @@ task:
<<: *netbsd_task_template
- name: OpenBSD - Meson
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*openbsd.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*openbsd.*'
env:
OS_NAME: openbsd
IMAGE_FAMILY: pg-ci-openbsd-postgres
@@ -414,7 +414,7 @@ task:
<<: *linux_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*linux.*'
ccache_cache:
folder: ${CCACHE_DIR}
@@ -598,7 +598,7 @@ task:
<<: *macos_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*(macos|darwin|osx).*'
sysinfo_script: |
id
@@ -704,7 +704,7 @@ task:
<<: *windows_task_template
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*windows.*'
setup_additional_packages_script: |
REM choco install -y --no-progress ...
@@ -742,8 +742,8 @@ task:
# due to resource constraints we don't run this task by default for now
trigger_type: manual
# worth using only_if despite being manual, otherwise this task will show up
- # when e.g. ci-os-only: linux is used.
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
+ # when e.g. ci-task-only: linux is used.
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*mingw.*'
# otherwise it'll be sorted before other tasks
depends_on: SanityCheck
@@ -802,7 +802,7 @@ task:
# use always: to continue after failures. Task that did not run count as a
# success, so we need to recheck SanityChecks's condition here ...
depends_on: SanityCheck
- only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
+ only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-task-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-task-only:[^\n]*compilerwarnings.*'
env:
CPUS: 4
diff --git a/src/tools/ci/README b/src/tools/ci/README
index 12c1e7c308f..264e36ca6c6 100644
--- a/src/tools/ci/README
+++ b/src/tools/ci/README
@@ -61,10 +61,11 @@ Controlling CI via commit messages
The behavior of CI can be controlled by special content in commit
messages. Currently the following controls are available:
-- ci-os-only: {(freebsd|linux|macos|mingw|netbsd|openbsd|windows)}
+- ci-task-only: {(freebsd|linux|macos|mingw|netbsd|openbsd|windows|compilerwarnings)}
- Only runs CI on operating systems specified. This can be useful when
- addressing portability issues affecting only a subset of platforms.
+ Only runs CI on operating systems specified or only runs compiler warnings
+ checks. This can be useful when addressing portability issues affecting only a
+ subset of platforms or when addressing compiler warnings issues.
Using custom compute resources for CI
--
2.34.1
The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: tested, failed
Documentation: tested, failed
Hi Hackers,
it might be better to list tasks in alphabetical order, and if I understand correctly
initially they were alphabetically sorted.
ci-task-only: {(compilerwarnings|freebsd|linux|macos|mingw|netbsd|openbsd|windows)}
also it may increase readability if you sort tasks alphabetically within the .cirrust.tasks.yml
Kindest regards.
Rustam
The new status of this patch is: Waiting on Author
On Wed, May 21, 2025 at 10:32 AM Rustam ALLAKOV <rustamallakov@gmail.com>
wrote:
The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: tested, failed
Documentation: tested, failedHi Hackers,
it might be better to list tasks in alphabetical order, and if I
understand correctly
initially they were alphabetically sorted.ci-task-only:
{(compilerwarnings|freebsd|linux|macos|mingw|netbsd|openbsd|windows)}
Appending the option and matching the yml file is proper for this patch
given its goal.
I do feel like there is something a bit off. Specifically:
I'd keep ci-os-only as a deprecated alias for a while - let it accept the
new compilerwarnings task name. I'd rather not break people's muscle
memory and the fact they are unlikely to realize this change until they run
one through and see everything running despite their directive. The "mess"
is quite minimal for the benefit.
(this is the only one I'd say is a - soft - patch blocker for me)
I'd like to communicate the always-runs versus the manual runs here in some
way.
Keeping the flavors together would seem to have merit.
I feel like the yml file itself should put these in a comment block.
also it may increase readability if you sort tasks alphabetically within
the .cirrust.tasks.yml
That should be done as a dedicated refactoring patch. I wouldn't consider
it high priority though. I'd love to find something that makes my outliner
display the task names as maximum collapse though (VS Code).
I'm apt to propose a refactoring patch here at some point to address these
things - but this patch to extend the yml file in an obvious way need not
take on such responsibilities.
David J.