-
Notifications
You must be signed in to change notification settings - Fork 6
#278 add upper version bounds for fbe and judges #278
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,8 @@ | |
|
|
||
| source 'https://rubygems.org' | ||
|
|
||
| gem 'fbe', '>0' | ||
| gem 'judges', '>0', require: false | ||
| gem 'fbe', '~>0' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The description gets the risk analysis right and then applies the wrong operator to it: "pre-1.0 gems where minor version bumps may introduce breaking changes". If that premise holds -- and it does; see line 77 of the lockfile in this same diff, where Expressing the stated intent in Ruby needs three segments: |
||
| gem 'judges', '~>0', require: false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The case for bounding This diff carries the evidence. If you want a bound that actually works for ( |
||
| gem 'minitest', '~>6.0', require: false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Every other constrained gem in this file uses a two-segment pessimistic bound: There is also an internal inconsistency this PR leaves in place. Three gems on lines 14-16 are still This is worth resolving explicitly rather than by omission, because in a template repo this file is the policy statement that every generated swarm inherits. |
||
| gem 'minitest-reporters', '~>1.7', require: false | ||
| gem 'rake', '~>13.2', require: false | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes how renovate treats these two lines, and the repo already contains a controlled experiment for both behaviours. So the effect of That is the honest cost/benefit -- the bound buys one automated pull request's worth of friction, priced against a constraint that must be maintained here and in every generated swarm. If a real review gate is what is wanted, put it in |
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ based on business rules. Judges run in cycles until no new facts are produced. | |
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| ```text | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole README hunk -- the Drop The fence change itself is correct -- |
||
| judges/<name>/<name>.rb — judge implementation, auto-discovered | ||
| judges/<name>/<name>.yml — YAML test for the judge (data-driven) | ||
| lib/ — shared Ruby libraries | ||
|
|
@@ -41,7 +41,7 @@ bundle exec rake | |
| mkdir judges/hello-world | ||
| ``` | ||
|
|
||
| 2. Write the judge logic in `judges/hello-world/hello-world.rb`: | ||
| 1. Write the judge logic in `judges/hello-world/hello-world.rb`: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the markdownlint-correct fix and simultaneously a rendering regression. But GitHub honours the start number of an ordered list. The fix that satisfies both is to make it a single list again by indenting each fenced block three spaces so it sits inside its preceding list item. Then the numbering can stay |
||
|
|
||
| ```ruby | ||
| # frozen_string_literal: true | ||
|
|
@@ -56,7 +56,7 @@ Fbe.fb.query('(and (exists hi) (absent hello))').each do |f| | |
| end | ||
| ``` | ||
|
|
||
| 3. Write a YAML test in `judges/hello-world/hello-world.yml`: | ||
| 1. Write a YAML test in `judges/hello-world/hello-world.yml`: | ||
|
|
||
| ```yaml | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy | ||
|
|
@@ -74,13 +74,13 @@ expected: | |
| - /fb/f[_id=1]/hello | ||
| ``` | ||
|
|
||
| 4. Run the judge YAML tests: | ||
| 1. Run the judge YAML tests: | ||
|
|
||
| ```bash | ||
| bundle exec judges test --no-log --disable live --lib lib judges | ||
| ``` | ||
|
|
||
| 5. Run the full build: | ||
| 1. Run the full build: | ||
|
|
||
| ```bash | ||
| bundle exec rake | ||
|
|
@@ -90,13 +90,15 @@ If everything is clean, your judge is ready. | |
|
|
||
| ## Commands | ||
|
|
||
| <!-- markdownlint-disable MD013 --> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The blanket disable is considerably wider than the problem. Running In a template repository this is also the wrong place for the setting. There is no The delimiter reformat on line 95 is a genuine fix and should stay wherever this hunk lands -- |
||
| | Command | Purpose | | ||
| |---------|---------| | ||
| | ------- | ------- | | ||
| | `bundle exec rake` | Full build (test + judges + rubocop) | | ||
| | `bundle exec rake test` | Ruby unit tests only | | ||
| | `bundle exec judges test --no-log --disable live --lib lib judges` | Judge YAML tests | | ||
| | `bundle exec rubocop` | Code style check | | ||
| | `docker build -t swarm .` | Build Docker image (requires Dockerfile) | | ||
| <!-- markdownlint-enable MD013 --> | ||
|
|
||
| ## How to Contribute | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth being explicit about what this file is before deciding the policy question.
swarm-templateis a GitHub template repository (is_template: true; the description reads "Use this repository as a template to create your own swarm of judges"), so every gem line below this one is copied verbatim into each generated swarm and then diverges independently. A constraint added here is not a decision for one repo, it is a default for every swarm created from this point forward, and those copies get no notification when the constraint becomes wrong. Relaxing it later means a PR in each downstream swarm individually. That asymmetry argues for the template shipping the loosest constraint that is still honest, and for reproducibility to be enforced by the lockfile rather than by a range.Which is the more useful point: the reproducibility problem the description describes is already solved by
Gemfile.lock, and the one real gap in that solution is not addressed by this PR. Nothing in the repo enables frozen mode -- there is nobundle config set frozen true, no--deployment, and.github/workflows/rake.ymlusesruby/setup-rubywithbundler-cache: truefollowed by a plainbundle install --no-color. In that setup, ifGemfileandGemfile.lockdisagree, Bundler silently re-resolves and rewrites the lock in the CI workspace instead of failing. A violated constraint is therefore not something CI can catch today, and the constraint being added here is not something CI will ever exercise.If the goal really is "an accidental
bundle updatemust not silently change what runs in production", the change that delivers it isBUNDLE_FROZEN: 'true'in therakejob env (orbundle config set --local frozen truecommitted to.bundle/config), so that any Gemfile/lock drift fails the build loudly. That is a smaller diff than this one and it covers all eleven gems instead of two.