Repository navigation
✨ kettle-jem: opt-in Duel performance regression guards - #81
Merged
Merged
Conversation
Add Duel (https://github.com/sferik/duel-ruby) to the template, off by default, so that every templated project can opt in with `workflows.duel: true` and re-templating keeps it. This replaces the per-project setup reviewed in ruby-oauth/oauth2#780. With Duel on, the full template generates: - .github/workflows/perf.yml: a read-only Duel job and a separate Comment job with only pull-requests: write, which runs none of the branch's code. The baseline's Ruby, and the bundle for it, are installed for every event type when its version file (.ruby-version, .tool-versions, or mise.toml, in Duel's order) names another Ruby than the candidate's. - gemfiles/modular/duel.gemfile: Duel and StackProf on Ruby 3.4 or later only, loaded by the root Gemfile and a new perf appraisal. - a `rake duel` task in the Rakefile, with a stub for older Rubies. - the RuboCop include for .duel.rb, and the Duel README badge. - .duel.rb, only when it is missing. While Duel is off, kettle-jem neither writes nor removes .duel.rb, perf.yml, or duel.gemfile, and generated files are unchanged. actions/download-artifact joins the workflow pin table, and a workflow.duel changelog transfer filter scopes the replayed entry to projects that opt in.
Contributor
Not an issue! The template always updates workflows it can process, and the templated release tooling has a hard fail-closed gate when outdated workflow pins are discovered... So updating them is already a requirement. I'll fix CI issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed on ruby-oauth/oauth2#780, this adds Duel to the kettle-jem template, so any templated project can opt in and re-templating keeps it. It's off by default:
workflows.duel: trueturns it on, next toworkflows.recording, and it only applies to the full profile. With it off, nothing kettle-jem generates changes.With Duel on, the template generates
.github/workflows/perf.yml,gemfiles/modular/duel.gemfile(Duel and StackProf on Ruby 3.4 or later only), aperfappraisal, the root Gemfile'seval_gemfilefor local development, arake dueltask with a stub for older Rubies, the RuboCop include for.duel.rb, and the badge at the end of the badge row..duel.rbis only copied when it's missing, since it's the project's, and no benchmarks are generated. The workflow is the one from oauth2's PR after review: a read-only Duel job, a separate Comment job with onlypull-requests: writethat runs none of the branch's code, and the baseline's Ruby (and its bundle) installed for every kind of run when its version file names a different Ruby. It follows the template's conventions for pins, the[ci skip]guard and permissions.The new spec covers absent and
falserendering identically, a project's own Duel files being left alone while it's off, every generated file with it on, a second run changing nothing, an existing.duel.rbandperfappraisal being kept, the profile gating and the changelog transfer filter. I also ran it against oauth2: with Duel off the output matchesmain's kettle-jem except the lock file's checksums, and with it on every Duel file matches what oauth2's PR ends up with. The rest of the suite has the same six failures here asmain(a fixture outside the repo, and the case-insensitive macOS filesystem), andrubocop_gradual:checkflagsappraisal_helper_and_token_spec.rb, which this doesn't touch.A few things you may want to weigh in on:
actions/download-artifactto the pin table means kettle-jem will also update that pin in a project's own workflows, even with Duel off.ruby/setup-rubyrather thansetup-ruby-flash, because the baseline steps need itsruby-prefixoutput.mainonly, not*-stable.kettle-jem-appraisalsplugin keeps the injectedperfblock.Once there's a release with this, I'll update oauth2's PR to just set
workflows.duel: trueand drop its workarounds.