-
Notifications
You must be signed in to change notification settings - Fork 639
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
Fine-grained GitHub Actions for drastically faster CI #453
Comments
Thanks for your detailed suggestions, we are very much interested in optimizing the build/CI performance for plugin projects. The suggested optimizations to skip execution of Gradle tasks make a number of assumptions that may or may not be true in certain plugin projects (e.g., fixed folder names, assuming source directory folder names, etc.). While it certainly can be done and documented, it seems more suitable to try and optimize the GH actions workflow itself without relying on any "hardcoded" rules that all projects started from this template must obey to work. We'll look into the other points and welcome any further suggestions. |
Hi @WarningImHack3r - I would love to see this, as well! Thanks for enumerating everything in so much detail!
I believe I accomplished similar in my plugins; one example here: ChrisCarini/sample-intellij-plugin#267 - essentially, I only wanted a
I suspect as Yann said above, all IJ platform plugins using GHA might not want to have the same set of 'hard-coded' rules (that's to say, different plugin authors/maintainers may have their own workflows (not GHA workflows, but development/release workflows) that they want to accommodate). However... ☁️ High-levelFor myself, I want most all changes (with some exceptions, see below for details) to result in a new version of my plugin(s) being released, and I want to have and (a) fast CI and (b) minimal 'touch points' after I merge in 'the significant' change (e.g. if a new version of IJ is released, I want to have one PR with the necessary changes, and once that CI passes, I want the rest to be (a) fast, and (b) 'touch-less'). Because of what I describe above, I believe I accomplished something similar for my plugins; example below (its spread across 2 commits):
🔩 The DetailsMy 'conditions' are more trivial than the ones you enumerate here, but they've been working well for me and my workflows (GitHub workflows, and personal ones It's been a while since I made these changes, but my thought process was something along the lines of:
🧑🏭 ExampleAs an example of this (the big, and annoying, overhead for me was
🙏 I'd love feedback & ideas, if you have any!I'd love to know your thoughts, and hear if you have any specific suggestions for my own GHA workflows! I maintain several IJ plugins, and try to keep their 'scaffolding' the same across (I have a central repo I push changes to things like gradle build files, or GHA workflows) for my own maintenance ease. |
It impacts me so much that I had to provide as much detail as possible to increase my chances of getting actual changes made :(
To be fair, as my "rules" rely on basic and existing Java apps architecture, I don't think I'm making crazy assumptions... As there is a big room for improvements, I'd prefer these people not following the standards to adapt their workflows themselves as a consequence, and specify they'd have to do so in the README
I'm not sure to get what you're describing here
Yep! That's basically the minimal "smart" workflow I'd like to have, and that I describe in my original message; it's easy to filter in/out some file names, agnostic from any file architecture you want and that would bring high QOL for such common and annoying use cases as changelog PRs!
I don't have much time right now and I'm not sure to get what you described in your "High-level" section, but AFAIK we pretty much have the same needs and we could benefit from the same improvements I describe here and would like! |
TL;DR: I want the process I personally use to release plugins to be (a) fast, and (b) have minimal human involvement from myself. I have 11 plugins I maintain and try to release for each new version of IJ that JB releases, and time is precious - these drive my desire for (a) and (b).
Awesome! Glad we have similar desires/goals here! Feel free to look at my workflow modifications as a reference for your own. 😄
Yeah, we're all limited on time. Great to hear it sounds like we both have similar needs and could benefit from each other's experiences/discussions. Like I mentioned above, feel free to use the modifications to the workflows in the repo (one of many I have) linked in my previous message as a starting point - if you make modifications for yourself, I'd love to know about them to see if they are modifications I'd also be interested in (as a joint benefit/learning, if you will). Perhaps between the both of us (and possibly others in the community), we can then use this first-hand experience to suggest actual changes in the form of PR(s) and see if the JB team is interested in accepting them for all! |
11 plugins is indeed a lot, but avoiding waste of time is always a plus no matter how many repos you have anyway!
TBF I'm not really willing to do it myself, both for time reasons, laziness and also cause it the JB teams happens to push improvements I don't want to have to rollback my changes...
That indeed looks like a great idea! I'll keep you updated ;) thanks for you kind words, research and POC!! |
Describe the need of your request
Currently, the CI workflow is extremely slow (10-20 min average). It's not a big deal, but when you have to accumulate a push, a dependency update merge, another run for another dependency PR, another one for the second merge, and so on, it becomes very time-consuming and blocking for no real reason.
I say blocking because you have to sequentially wait for each one so that your release draft can actually be created, so you can finally publish it, wait for another PR workflow with the CHANGELOG.md update, and a final last one when you merge the changelog PR.
It's tedious, slow, and uses GH Actions bandwidth for practically nothing. I can sometimes waste 30-60min for a 5-line fix that I release alongside 2 Renovate PRs.
Proposed solution
The solution lies in 2 words: conditional execution.
I've used this technique in some of my recent projects, where I make my CI smart: it only runs the steps it needs to run depending on the changes I make.
What would I change for our case? 2 things:
paths
/paths-ignore
options to run or not run jobs at workflow-levelstep
-levelHow would I apply them?
build
,test
,inspectCode
, andverify
when no change is made to any gradle dependency/src codetest
if there is notest
folderreleaseDraft
if a release with the same name has already been releasedtest
,inspectCode
andverify
if the change is only related to gradle dependenciesWhat would those changes mean?
Taking our same example above, we'd go from:
To:
Would that be a big deal?
With rough average estimations for a relatively medium codebase of:
build
: 2 mintest
: 2 min (even without any test)inspectCode
: 6 minverify
: 7 minAnd being generous because
Post Setup Gradle
can be extremely slow, sometimes doubling the job's duration but that's not on you, we would go from ~72 min (8 * 9 min) to ~19 min (1 * 9 min + 5 * 2 min + 2 * 0s) of run for a casual workflow with hotfix releases and dependency management.Additional actions improvements
If you want to go beyond, maybe improving the run duration of your own actions, especially
./gradlew runPluginVerifier
andJetBrains/qodana-action
, which are the slowest of all (maybe parallelizing stuff like IDE checks), it'd be amazing!About the Release workflow, it would also be great not to have it fail if the CHANGELOG.md is already up-to-date!
If you guys also have an idea of why and how
Post Setup Gradle
can take up to 4-5 min, I'd love to hear from you!Additionally, I'd love to see Qodana reports in PRs not getting sent on closed/merged PRs.
Conclusion
Please consider this change that would have a massive cumulated impact on all the people using this template, both in time for plugin developers and in computation for our friends @ GitHub
Alternatives you've considered
Waiting or going back and forth on GitHub without being focused long enough on another task or even canceling some workflows
Additional context
No response
The text was updated successfully, but these errors were encountered: