git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/4] Random improvements to GitLab CI

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 12, 2024, 06:47 UTC
Message-ID
<20241212-pks-ci-section-fixes-v3-0-d9fe6baee21e@pks.im>
In-Reply-To
<20241206-pks-ci-section-fixes-v1-0-7ab1b69e3648@pks.im>
Hi,

this small patch series includes a couple of more-or-less random improvements to GitLab CI.

Changes in v2:
- Use "%s" to inject variable data into section headers instead of
  converting to echo.
- Link to v1: https://lore.kernel.org/r/20241206-pks-ci-section-fixes-v1-0-7ab1b69e3648@pks.im
Changes in v3:
- Wrap overly long lines.
- Fix a word swap in a commit message.
- Link to v2: https://lore.kernel.org/r/20241210-pks-ci-section-fixes-v2-0-e087cfd174f4@pks.im
Thanks!
Patrick
---
Patrick Steinhardt (4):
      gitlab-ci: update macOS images to Sonoma
      ci/lib: remove duplicate trap to end "CI setup" group
      ci/lib: do not interpret escape sequences in `group ()` arguments
      ci/lib: fix "CI setup" sections with GitLab CI
 .gitlab-ci.yml |  4 ++--
 ci/lib.sh      | 11 ++++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)
Range-diff versus v2:
1:  e504aa4a1f = 1:  633af36640 gitlab-ci: update macOS images to Sonoma
2:  021ac694ef = 2:  6b6c6b2937 ci/lib: remove duplicate trap to end "CI setup" group
3:  6e355e22d7 ! 3:  bd54f8e1b6 ci/lib: do not interpret escape sequences in `group ()` arguments
    @@ Commit message
         We use printf to set up sections with GitLab CI, which requires us to
         print a bunch of escape sequences via printf. The group name is
         controlled by the user and is expanded directly into the formatting
    -    string, which may cause problems in case the argument controls escape
    +    string, which may cause problems in case the argument contains escape
         sequences or formatting directives.
     
         Fix this potential issue by using formatting directives to pass variable
    @@ ci/lib.sh: elif test true = "$GITLAB_CI"
      	begin_group () {
      		need_to_end_group=t
     -		printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n"
    -+		printf '\e[0Ksection_start:%s:%s[collapsed=true]\r\e[0K%s\n' "$(date +%s)" "$(echo "$1" | tr ' ' _)" "$1"
    ++		printf '\e[0Ksection_start:%s:%s[collapsed=true]\r\e[0K%s\n' \
    ++			"$(date +%s)" "$(echo "$1" | tr ' ' _)" "$1"
      		trap "end_group '$1'" EXIT
      		set -x
      	}
    @@ ci/lib.sh: then
      		set +x
      		need_to_end_group=
     -		printf "\e[0Ksection_end:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K\n"
    -+		printf '\e[0Ksection_end:%s:%s\r\e[0K\n' "$(date +%s)" "$(echo "$1" | tr ' ' _)"
    ++		printf '\e[0Ksection_end:%s:%s\r\e[0K\n' \
    ++			"$(date +%s)" "$(echo "$1" | tr ' ' _)"
      		trap - EXIT
      	}
      else
4:  bae2071e47 = 4:  41ad98d633 ci/lib: fix "CI setup" sections with GitLab CI

--- base-commit: e66fd72e972df760a53c3d6da023c17adfc426d6 change-id: 20241206-pks-ci-section-fixes-1bb91ceb50b8

Next: Patrick Steinhardt
Message 1 of 6 in “Random improvements to GitLab CI”
  1. 0/4 Random improvements to GitLab CIPatrick Steinhardt, Dec 12, 2024
  2. 1/4 gitlab-ci: update macOS images to SonomaPatrick Steinhardt, Dec 12, 2024
  3. 2/4 ci/lib: remove duplicate trap to end "CI setup" groupPatrick Steinhardt, Dec 12, 2024
  4. 4/4 ci/lib: fix "CI setup" sections with GitLab CIPatrick Steinhardt, Dec 12, 2024
  5. 3/4 ci/lib: do not interpret escape sequences in `group ()` argumentsPatrick Steinhardt, Dec 12, 2024
  6. Toon ClaesDec 12, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.