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

Re: [PATCH 2/2] gitlab-ci: add whitespace error check

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 30, 2024, 14:05 UTC
Message-ID
<ZjD6xNuncrq9fSXZ@tanuki>
In-Reply-To
<zphrzgroei4civl7q2ls5cvabyzjbexfq6tjhdy476rmaqu6m5@ik3pedton6ww>
On Tue, Apr 30, 2024 at 09:00:59AM -0500, Justin Tobler wrote:
Show 28 quoted lines
> On 24/04/30 07:04AM, Patrick Steinhardt wrote:
> > On Mon, Apr 29, 2024 at 07:33:23PM -0500, Justin Tobler wrote:
> > > To check for whitespace errors introduced by a set of changes, there is
> > > the `.github/workflows/check-whitespace.yml` GitHub action. This script
> > > executes `git log --check` over a range containing the new commits and
> > > parses the output to generate a markdown formatted artifact that
> > > summarizes detected errors with GitHub links to the affected commits and
> > > blobs.
> > > 
> > > Since this script is rather specific to GitHub actions, a more general
> > > and simple `ci/check-whitespace.sh` is added instead that functions the
> > > same, but does not generate the markdown file for the action summary.
> > > From this, a new GitLab CI job is added to support the whitespace error
> > > check.
> > 
> > I still wonder whether we can unify these. Yes, the GitHub thing is
> > quite specific. But ultimately, what it does is to generate a proper
> > summary of where exactly the whitespaces issues are, which is something
> > that your version doesn't do. It's useful though for consumers of a
> > failed CI job to know exactly which commit has the issue.
> 
> Just to clarify, this new CI job still prints the output of 
> `git log --check` which details the exact commit and file with line
> number of the whitespace error. The difference is that it does not write
> an additional markdown file with links to the commit and blob.
> 
> Here is a failed execution of the GitLab whitespace check job:
> https://gitlab.com/gitlab-org/git/-/jobs/6749580210#L1289

Okay, fair enough. I'm still of the opinion that the infra here should be shared.

Show 8 quoted lines
> > So can't we pull out the logic into a script, refactor it such that it
> > knows to print both GitHub- and GitLab-style URLs, and then also print
> > the summary in GitLab CI?
> 
> We can do this, but for GitLab CI there probably isn't a point to
> generating a summary file since there is nothing that would pick it up
> and display it. Having links though directly in the job output would be
> nice. I'll give it another go.

Well, we could print the output to the console so that a user can see it when they open the failed job. The nice formatting may be kind of moot, but on the other hand it doesn't hurt, either. I guess most people are used to reading plain markdown-style docs anyway.

Patrick
Previous: Justin ToblerNext: Justin Tobler
Message 10 of 42 in “Add GitLab CI to check for whitespace errors”
  1. 0/2 Add GitLab CI to check for whitespace errorsJustin Tobler, Apr 30, 2024
  2. 1/2 ci: pre-collapse GitLab CI sectionsJustin Tobler, Apr 30, 2024
  3. 2/2 gitlab-ci: add whitespace error checkJustin Tobler, Apr 30, 2024
  4. James LiuApr 30, 2024
  5. Justin ToblerApr 30, 2024
  6. Patrick SteinhardtApr 30, 2024
  7. Patrick SteinhardtApr 30, 2024
  8. Taylor BlauApr 30, 2024
  9. Justin ToblerApr 30, 2024
  10. Patrick SteinhardtApr 30, 2024
  11. Justin ToblerApr 30, 2024
  12. Patrick SteinhardtApr 30, 2024
  13. Justin ToblerApr 30, 2024
  14. 0/5 Add GitLab CI to check for whitespace errorsJustin Tobler, May 2, 2024
  15. 1/5 ci: pre-collapse GitLab CI sectionsJustin Tobler, May 2, 2024
  16. 2/5 github-ci: fix link to whitespace errorJustin Tobler, May 2, 2024
  17. 3/5 ci: separate whitespace check scriptJustin Tobler, May 2, 2024
  18. Patrick SteinhardtMay 3, 2024
  19. Justin ToblerMay 3, 2024
  20. Junio C HamanoMay 3, 2024
  21. Patrick SteinhardtMay 3, 2024
  22. Chris TorekMay 4, 2024
  23. 4/5 ci: make the whitespace report optionalJustin Tobler, May 2, 2024
  24. Patrick SteinhardtMay 3, 2024
  25. Justin ToblerMay 3, 2024
  26. 5/5 gitlab-ci: add whitespace error checkJustin Tobler, May 2, 2024
  27. Patrick SteinhardtMay 3, 2024
  28. Junio C HamanoMay 2, 2024
  29. Justin ToblerMay 3, 2024
  30. 0/5 Add GitLab CI to check for whitespace errorsJustin Tobler, May 3, 2024
  31. 1/5 ci: pre-collapse GitLab CI sectionsJustin Tobler, May 3, 2024
  32. 2/5 github-ci: fix link to whitespace errorJustin Tobler, May 3, 2024
  33. 3/5 ci: separate whitespace check scriptJustin Tobler, May 3, 2024
  34. 4/5 ci: make the whitespace report optionalJustin Tobler, May 3, 2024
  35. 5/5 gitlab-ci: add whitespace error checkJustin Tobler, May 3, 2024
  36. Patrick SteinhardtMay 6, 2024
  37. Justin ToblerMay 6, 2024
  38. Junio C HamanoMay 6, 2024
  39. Justin ToblerMay 6, 2024
  40. Patrick SteinhardtMay 7, 2024
  41. Justin ToblerMay 7, 2024
  42. Patrick SteinhardtMay 7, 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.