cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Reduce amount of CI round-tripping required by contributors

Open mpickering opened this issue 1 year ago • 14 comments

There is currently quite a lot of back-and-forth which is required when contributing patches to Cabal which makes the developer experience sometimes cumbersome.

In my mind, the goal should be to perform 1 round-trip with CI. A developer submits a MR, sees ALL issues with the patch and can update the patch once in order to fix all the problems. Ideally all the issues are reproducible locally so that iteration can be performed locally on a specific test.

Off the top of my head here are some reasons why you might have to perform multiple CI rounds:

  • The changelog.d template has a MR number field, which can only be filled in after a MR is created.
  • Formatting often initially fails for contributors who are not aware of the formatting requirement.
  • Tests such as the structured hash test require a developer to copy and paste a value from CI into their local tree. This is different on different GHC versions so it's difficult to update locally.
  • If one CI job fails (for example a windows job), then all other jobs are cancelled, which can hide further failures on other platforms or versions.
  • Tests are run on CI sequentially, some tests are not run if earlier tests fail (for example, unit tests run before the package tests). In a bad situation you may do multiple rounds if a unit test fails and then a package test for ./Setup and then a package test for cabal-install.

There is also the suggestion of adding a file which tracks the API of Cabal and Cabal-syntax (#10259) which would add another bullet point to this list.

In order to fix these issues, here are some possible suggestions:

  • Remove tests such as structured hash (I'm not sure what the purpose of this test is as it is blindly updated)
  • Do not cancel concurrent jobs if one CI job fails
  • Always run all tests, don't bail out early if one testsuite fails.
  • Remove MR field from changelog.d entry, require each commit to reference an issue. (At which point the issue will link to the MR automatically)

mpickering avatar Aug 19 '24 09:08 mpickering