ansible-documentation icon indicating copy to clipboard operation
ansible-documentation copied to clipboard

dev pip-compile: switch devel branch pip-compile to 3.11

Open gotmax23 opened this issue 1 year ago • 7 comments

This adjusts the devel branch to use Python 3.11 to generate dependencies with pip-compile. This also adjusts the pip-compile-dev workflow to run separate jobs for the stable branches, which will still use Python 3.10 for requirements files. It's not a very DRY approach; Github Actions does not support loops.

Fixes: https://github.com/ansible/ansible-documentation/issues/1614 Fixes: https://github.com/ansible/ansible-documentation/issues/1450

gotmax23 avatar Jun 19 '24 20:06 gotmax23

It's not a very DRY approach; Github Actions does not support loops.

That's not really true: you can have a matrix definition that calls a reusable workflow and passes matrix factors in. This does work, both me and Don have used this approach in the past.

UPD: What doesn't work is skipping some jobs in an event-dependent manner with just declarative syntax. This can be solved by a separate job that pre-computes the matrix, though.

webknjaz avatar Jun 24 '24 18:06 webknjaz

you can have a matrix definition that calls a reusable workflow

That's true. I'm not sure why I completely forgot about matrices. I'll try to refactor this.

gotmax23 avatar Jun 24 '24 20:06 gotmax23

I'll work on this later this month, after I get back from vacation.

gotmax23 avatar Jul 06 '24 04:07 gotmax23

@gotmax23 Hello. Friendly reminder on this PR. Do you think you'd have some time to look at refactoring this? Maybe it's not that big of a deal but I think it'd be nice to bump to 3.11 fairly soon so there's plenty of time before 2.18 etc. Cheers!

oraNod avatar Aug 06 '24 09:08 oraNod

Thanks for the ping. I'm back from Flock to Fedora, so I should have a draft ready early this week. I'm thinking that allowing manual triggering with custom input makes this too complicated, so I think I'll remove that part and make this into a more simple matrix that runs on a scheduled basis and can also be triggered all at once with the default (hard-coded) inputs.

gotmax23 avatar Aug 11 '24 03:08 gotmax23

This is ready for review now.

gotmax23 avatar Aug 13 '24 17:08 gotmax23

  • https://github.com/ansible/ansible-documentation/pull/1752
  • https://github.com/ansible/ansible-documentation/pull/1754
  • https://github.com/ansible/ansible-documentation/pull/1751
  • https://github.com/ansible/ansible-documentation/pull/1753

were all created with this new job!

gotmax23 avatar Aug 13 '24 18:08 gotmax23

@gotmax23 I also like the fact it's not too complicated. I guess you probably could get rid of some repetition and make it fancy but I feel like that might make it harder for folks to grok and could put off maintainers. Thanks again.

oraNod avatar Aug 20 '24 09:08 oraNod

I also like the fact it's not too complicated. I guess you probably could get rid of some repetition and make it fancy but I feel like that might make it harder for folks to grok and could put off maintainers.

We could use YAML anchors or something to reuse the nox-args values (one anchor for Python 3.11 + the devel-only tag script and one for Python 3.10) or automatically generate pr-branch based on base-branch, but yeah, that adds extra complexity and I think what we have is pretty maintainable.

I'll merge this now and we can always iterate on this further as needed. I opened a separate issue to create the necessary documentation that you mentioned.

gotmax23 avatar Aug 20 '24 22:08 gotmax23