Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post remove ci templates #8000

Merged
merged 18 commits into from
Feb 24, 2022
Merged

Conversation

jneira
Copy link
Member

@jneira jneira commented Feb 21, 2022

Adressing some issues after the new gha workflows in #7952

@andreabedini i started to work on this before your comments in #7592. Let me know if you want to continue the great work done there with your own pr. No problem at all with that


Please include the following checklist in your PR:

@jneira jneira requested review from andreabedini and fgaz February 21, 2022 05:28
.github/workflows/linux.yml Outdated Show resolved Hide resolved
@andreabedini
Copy link
Collaborator

Thanks for pinging me @jneira. My problem with testing using old GHCs is that it is very arbitrary what we are going to test.

  • Why only on Linux?
  • After compiling cabal with what version of GHC? (the one that GHCup marks as recommended? 8.10.7)

There's a proverbial combinatorial explosion of possible configurations to tests. I honestly do not know what we should tests.

One suggestion I could give now is that perhaps you can consider making validate-old-ghcs a separate workflow, so we can unify the main workflows (Linux / MacOS / Windows) into something simple.

@jneira
Copy link
Member Author

jneira commented Feb 21, 2022

Thanks for pinging me @jneira. My problem with testing using old GHCs is that it is very arbitrary what we are going to test.

* Why only on Linux?

I guess it already was only tested in linux to save ci resources and simplify the scripts. It is not comprehensive but it worked well enough until now afaik so i only keep the existing behaviour

* After compiling cabal with what version of GHC? (the one that GHCup marks as recommended? 8.10.7)

Again, i am keeping the existing behaviour, All builds > 8.0 should work so i hope the chosen main ghc is somewhat arbitrary. We could try 8.10.7 and see how is going (but i prefer start with the existing one to not mix things)

There's a proverbial combinatorial explosion of possible configurations to tests. I honestly do not know what we should tests.

Hmm the same combination as before, adding the recently removed ones < 8.0 could be a good start imo

One suggestion I could give now is that perhaps you can consider making validate-old-ghcs a separate workflow, so we can unify the main workflows (Linux / MacOS / Windows) into something simple.

I considerated it but as the original workflow made the old-ghcs job require the main one so i am keeping that here.
You can unify workflows adding macos to the matrix of the validate job. Afaics the old-ghcs does not get in the way to do it.

@jneira
Copy link
Member Author

jneira commented Feb 21, 2022

I could not resist to add

# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
concurrency:
  group: ${{ github.head_ref }}-${{ github.workflow }}
  cancel-in-progress: true

to all workflows, to cancel ongoing runs on new commits of the same workflow, another way to save resources

The unique caveat i can think of is it does not allow to abuse ci and check different implementations concurrently, but i think upstream ci should not be abused that way. You always can open prs in your own fork for those kind of checks (or test locally of course)

@jneira jneira requested a review from phadej February 21, 2022 08:48
@andreabedini
Copy link
Collaborator

andreabedini commented Feb 21, 2022

to all workflows, to cancel ongoing runs on new commits of the same workflow, another way to save resources

Fair enough. I would prefer to see all the issues at once that having to discover them one by one but I don't have a strong opinion here.

Edit: I would not say "abuse", it's the CI's job to run tests!

@jneira
Copy link
Member Author

jneira commented Feb 21, 2022

Edit: I would not say "abuse", it's the CI's job to run tests!

yeah and it continues doing it, but only for the last commit of the pr/branch if several of them are ran concurrently 😉

@andreabedini
Copy link
Collaborator

I just had a little thought, on GHC 8.8.4 we pass --solver-benchmarks but I belive we should not.

  1. it looks like it's compiled but not executed anywhere (I cannot find it looking here, surely I must be missing it).

  2. if it's a benchmark, its result might not fail/pass, and in this case I would prefer not having it as part of the CI. We could but we are trying to save on resources.

  3. given the name, I assume it's benchmarking cabal-install-solver, in that case we could split it into a separate workflow and only run it when paths under cabal-install-solver/ change.

my 2c.

@phadej
Copy link
Collaborator

phadej commented Feb 21, 2022

if it's a benchmark, its result might not fail/pass, and in this case I would prefer not having it as part of the CI. We could but we are trying to save on resources.

It runs solver for one package 5 times (look what validate.sh does). I.e. it definitely doesn't waste resources (compared to time spend figuring out why they don't build / run).

Don't assume, check!

@phadej
Copy link
Collaborator

phadej commented Feb 21, 2022

only run it when paths under cabal-install-solver/ change.

Bad idea. it's like testing cabal-install only when code in cabal-install changes.

@grayjay
Copy link
Collaborator

grayjay commented Feb 21, 2022

I just had a little thought, on GHC 8.8.4 we pass --solver-benchmarks but I belive we should not.

Please don't remove the run of solver-benchmarks from CI. The benchmark's unit tests only cover limited functionality, so it is useful to verify that the whole benchmark can run for a single package. The benchmark runs the cabal executable, so it is testing more than just the solver.

it looks like it's compiled but not executed anywhere (I cannot find it looking here, surely I must be missing it).

I'm not very familiar with the current CI setup, so I don't know whether there is currently an issue preventing the benchmark from being tested.

@andreabedini
Copy link
Collaborator

if it's a benchmark, its result might not fail/pass, and in this case I would prefer not having it as part of the CI. We could but we are trying to save on resources.

It runs solver for one package 5 times (look what validate.sh does). I.e. it definitely doesn't waste resources (compared to time spend figuring out why they don't build / run).

Don't assume, check!

:-( I didn't assume, I did check the logs and I could not find anything related to the benchmark.

only run it when paths under cabal-install-solver/ change.

Bad idea. it's like testing cabal-install only when code in cabal-install changes.

And what is the argument against that?

@phadej I admire your work. I am just trying to keep things simple here, for everybody's benefit.

@andreabedini
Copy link
Collaborator

Please don't remove the run of solver-benchmarks from CI. The benchmark's unit tests only cover limited functionality, so it is useful to verify that the whole benchmark can run for a single package. The benchmark runs the cabal executable, so it is testing more than just the solver.

Nobody needs to worry, I have no intention to remove it.

@Mikolaj
Copy link
Member

Mikolaj commented Feb 22, 2022

Bad idea. it's like testing cabal-install only when code in cabal-install changes.

And what is the argument against that?

The argument is that changes in Cabal library affect how cabal-install works, so cabal-install should be tested also after any Cabal changes. Not the other way around, but I think most of our tests are cabal-install tests.

@jneira
Copy link
Member Author

jneira commented Feb 22, 2022

I am continuing the work in my fork to not take too much ci resources here: jneira#3

There i've changed the job names to Validate ubuntu-latest ghc-${{ matrix.ghc }} and Validate macos-latest ghc-${{ matrix.ghc }} to make it easier the merge between both and not having to update branch protection rules again.
Unfortunately you cant use runner.os (one of Linux, macOs, Windows) in the job name field 🤷

@jneira jneira force-pushed the post-remove-ci-templates branch from b1d8bde to 836b562 Compare February 22, 2022 10:06
@jneira
Copy link
Member Author

jneira commented Feb 22, 2022

Ok, i think i made the old-ghcs job work (see https://github.com/jneira/cabal/runs/5285931614) restoring in practice the old job.

  • I only have converted it in a matrix removing the testing for the main ghc version already done in the validate step
  • It builds 8.8.4 several times, the solution could be reuse the artifact generated in the validate job for that ghc. It supposes changes in the workflow (upload artifacts) and maybe in the validate script, to make it use such artifact

Thing i tried (reverse engineering @phadej's work on the way):

So we could use ubuntu-18.04 if the validate script would support not dyn ghc flavours. I guess it is not possible for old ghc versions.

@phadej i would appreciate if you could confirm those guesses from a linux beginner

@jneira jneira marked this pull request as ready for review February 22, 2022 10:26
@jneira
Copy link
Member Author

jneira commented Feb 22, 2022

Again, i am keeping the existing behaviour, All builds > 8.0 should work so i hope the chosen main ghc is somewhat arbitrary. We could try 8.10.7 and see how is going (but i prefer start with the existing one to not mix things)

will try with ghc-8.10.7

@jneira
Copy link
Member Author

jneira commented Feb 22, 2022

Again, i am keeping the existing behaviour, All builds > 8.0 should work so i hope the chosen main ghc is somewhat arbitrary. We could try 8.10.7 and see how is going (but i prefer start with the existing one to not mix things)

will try with ghc-8.10.7

it failed cause it has to use ghcup and haskell-setup action needs sudo in scope to install ghc with ghcup.
Otoh the xenial container we are using has not sudo in scope: https://github.com/jneira/cabal/runs/5287480736?check_suite_focus=true

🤦

@jneira
Copy link
Member Author

jneira commented Feb 22, 2022

Ok i've restored linux and macos checks and will add old-ghc ones as soon the new jobs are picked up by github ui
So the rest of prs need #8000 to be merged honouring ci

Using post-jobs make the protection rules more maintainable, you can use them as a resume of all matrix job and allows to have one check per workflow

.github/workflows/macos.yml Outdated Show resolved Hide resolved
@jneira
Copy link
Member Author

jneira commented Feb 22, 2022

I know it is good to make us eager to fix failing jobs, but having the red cross everywhere (in commit, pr list, etc) makes me 😿

@andreabedini andreabedini self-requested a review February 24, 2022 01:21
Copy link
Collaborator

@andreabedini andreabedini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding all the comments! I am a bit sad we do this on Linux only since I was going to merge the platforms but alas, it will do for now.

@jneira
Copy link
Member Author

jneira commented Feb 24, 2022

LGTM. Thanks for adding all the comments! I am a bit sad we do this on Linux only since I was going to merge the platforms but alas, it will do for now.

thanks! @Mikolaj @fgaz this need one more approval to be merged and unblock the rest of prs

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Mikolaj
Copy link
Member

Mikolaj commented Feb 24, 2022

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Feb 24, 2022

rebase

✅ Branch has been successfully rebased

@jneira jneira force-pushed the post-remove-ci-templates branch from c91d6d3 to d7b25a2 Compare February 24, 2022 08:01
@@ -1,5 +1,10 @@
name: Bootstrap

# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why head_ref and not ref?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point head_ref is only defined for pull requests and workflows are triggered for direct commits too.
The consequence is that, for consecutive direct and merge commits in master (and 3.6, 3.4 etc), they will be cancelled but the last one.
So we will lose the status of those intermmediate commits.
There is a small probability of a green pr breaking master cause we are not enforcing the pr is up to date with master before merging it. Also there is a even small probability of merge another pr just after the offending one and we will not know the real cause is the intemmediate and no the final one.
Will change asap

@Mikolaj Mikolaj merged commit b8a272a into haskell:master Feb 24, 2022
@jneira jneira mentioned this pull request Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants