Re: ci: Allow running mingw tests by default via environment variable
Nazir Bilal Yavuz <byavuz81@gmail.com>
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org, Wolfgang Walther <walther@technowledgy.de>
Date: 2025-03-04T08:53:30Z
Lists: pgsql-hackers
Attachments
- v4-0001-ci-Per-repo-triggers-for-MinGW-NetBSD-OpenBSD.patch (text/x-patch) patch v4-0001
- v4-0002-ci-Simplify-ci-os-only-handling.patch (text/x-patch) patch v4-0002
Hi, On Tue, 4 Mar 2025 at 03:28, Thomas Munro <thomas.munro@gmail.com> wrote: > > On Fri, Apr 26, 2024 at 12:02 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote: > > On Sat, 13 Apr 2024 at 05:12, Andres Freund <andres@anarazel.de> wrote: > > > I propose that we instead run the task automatically if > > > $REPO_MINGW_TRIGGER_BY_DEFAULT is set, typically in cirrus' per-repository > > > configuration. > > > > > > Unfortunately that's somewhat awkward to do in the cirrus-ci yaml > > > configuration, the set of conditional expressions supported is very > > > simplistic. > > > > > > To deal with that, I extended .cirrus.star to compute the required environment > > > variable. If $REPO_MINGW_TRIGGER_BY_DEFAULT is set, CI_MINGW_TRIGGER_TYPE is > > > set to 'automatic', if not it's 'manual'. > > > > Changes look good to me. My only complaint could be using only 'true' > > for the REPO_MINGW_TRIGGER_BY_DEFAULT, not a possible list of values > > but this is not important. > > Here's a generalised version of 0001. If you put this in your > repository settings on Cirrus's website: Thank you for working on this! > REPO_CI_AUTOMATIC_TRIGGER_TASKS="mingw netbsd" > > ... then it defines: > > CI_TRIGGER_TYPE_MINGW=automatic > CI_TRIGGER_TYPE_NETBSD=automatic > CI_TRIGGER_TYPE_OPENBSD=manual > > The set of tasks that get this treatment is defined by this line in > .cirrus.star: > > default_manual_trigger_tasks = ['mingw', 'netbsd', 'openbsd'] > > Then the individual tasks in .cirrus.tasks.yml use those variables: > > - name: NetBSD - Meson > + # See REPO_CI_AUTOMATIC_TRIGGER_TASKS in .cirrus.star > + trigger_type: $CI_TRIGGER_TYPE_NETBSD I confirm that this works as expected and LGTM. > Unfortunately the funky Starlark language doesn't seem to have regular > expressions, so it's just searching for those substrings without > contemplating delimiters. That doesn't seem to be a problem at this > scale... You can load 're' and use it as in the v2-0002 but I think what you did is good enough. I rebased Andres' v2-0002 on top of recent changes and wrote a small commit message. v4 is attached. -- Regards, Nazir Bilal Yavuz Microsoft
Commits
-
ci: Simplify ci-os-only handling
- b3aa95b61e90 15.15 landed
- 97d6ee571325 18.0 landed
- 60b64e6a31a2 19 (unreleased) landed
- 4900179e9cd8 16.11 landed
- 73f107b54ec6 17.7 landed
-
ci: Per-repo configuration for manually trigger tasks
- 49cba82bec1f 19 (unreleased) landed
- 88f3f7fd831e 15.15 landed
- 965d0a0b8b40 16.11 landed
- 3d478f66b651 17.7 landed
- faa78bc1c1d4 18.0 landed