aireview 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ceb8f061ed3a8172b46df1af17fa9961282858657aaf347215b42d5824acf7b
4
- data.tar.gz: e345026c2323be4af4fa9ff2e00fb552685d9e9aec040a691a347cc063ce9d88
3
+ metadata.gz: 100adbc2d1510ad1f6c0e9b152decbfa46e71f8db30dfde36a8ba977528ae215
4
+ data.tar.gz: 071d392ef71d935a6b6a055e7e86fbbf06e8f4517251d460d8bbff8087cb8ecf
5
5
  SHA512:
6
- metadata.gz: 3fbbfb3540d90c6d5cf35bbe5e403ba0d4abc17fab630b464d9a03bd9748563cd3ed11192673ed5bca48e1d01c393b25bd5ad25324c4ccf7c3e4548695d336e0
7
- data.tar.gz: 33f0bbba90317654a12835bd8328f6ef58a46b89b7d312aad6da46b76033495d708dc8da6a25772c7b8815811c0cc882878f0a58ac7cf418d0328af29821fe60
6
+ metadata.gz: 48d8222728f5bd0cdb27790c9971c316060c9efd89479e6be58ee6f41066e237e4e94cf2f864297b03a3012e1f225b92c4ece4b84ffeca3ad3ef66831a176e09
7
+ data.tar.gz: e4cdac4c17edc362e318b548ac5d25198eaf9c916edd670424c7d21b0cdf4baab2f9f61527bb05547e737e30f192d243ee7dfcb80062a483b08bf410466bfcef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ - The prompts no longer ask the model to check whether dependency and image
6
+ versions exist; candidates about nonexistent versions are rejected.
7
+ - An overloaded LLM (503) is retried up to three times with pauses of about
8
+ 2, 5 and 5 minutes instead of two retries of 1.5-2.5 minutes.
9
+
3
10
  ## 0.1.0
4
11
 
5
12
  Initial release.
data/README.md CHANGED
@@ -162,7 +162,10 @@ To run both stages locally, set `ollama` in both provider variables. The
162
162
  address with `/v1` matches the
163
163
  [Ollama configuration in RubyLLM](https://rubyllm.com/configuration/#provider-configuration).
164
164
  `LLM_TIMEOUT` sets the timeout of every LLM request in seconds; for a slow
165
- local model it can be raised.
165
+ local model it can be raised. It does not apply to an "overloaded" (503)
166
+ answer from the provider: such a request gets up to four attempts, the
167
+ original one and three retries with pauses of about 2, 5 and 5 minutes, and
168
+ only the failed stage is repeated, not the whole run.
166
169
 
167
170
  Project rules live in `.aireview.yml`. In YAML the `generate.model` and
168
171
  `critique.model` settings are required for each stage and are not inherited
@@ -316,6 +319,7 @@ aireview:
316
319
  LLM_HTTP_PROXY: "http://127.0.0.1:8888"
317
320
  script:
318
321
  - bundle _2.3.26_ exec bin/aireview review "$MR_URL" --verbose
322
+ timeout: 45m
319
323
  retry:
320
324
  max: 1
321
325
  when:
@@ -323,6 +327,11 @@ aireview:
323
327
  - stuck_or_timeout_failure
324
328
  ```
325
329
 
330
+ `timeout: 45m` is a chosen ceiling, not a guarantee that every retry fits in:
331
+ when the provider is overloaded, one stage can wait up to ~14 minutes of
332
+ pauses plus up to four requests of `LLM_TIMEOUT` each, and there are two
333
+ stages.
334
+
326
335
  Set secrets such as `GITLAB_TOKEN`, `GEMINI_API_KEY` and the optional Jira
327
336
  credentials in the GitLab CI/CD variables. If the job should publish the result
328
337
  back to the merge request, add `--post` to the review command.
@@ -351,8 +360,27 @@ bundle _2.3.26_ exec rspec spec/secret_scrubber_spec.rb
351
360
 
352
361
  ## Notes
353
362
 
363
+ - The reviewer does not check whether the specified versions of dependencies and images exist: the model's knowledge of releases is outdated, and that is what CI is for. Syntax errors and contradictions with the MR/Jira requirements are checked as usual.
354
364
  - The CLI looks for `.aireview.yml` and `.env` walking up from the current working directory, so the project config can be kept in the repository root even when the tool is run from `aireview/`.
355
365
 
366
+ ## Releasing
367
+
368
+ Releases are published to RubyGems.org by the `Release` workflow through
369
+ [trusted publishing](https://guides.rubygems.org/trusted-publishing/), so no
370
+ API key is stored anywhere. To cut a release:
371
+
372
+ 1. Bump `Aireview::VERSION` in `lib/aireview/version.rb` and move the
373
+ `Unreleased` section of `CHANGELOG.md` under the new version.
374
+ 2. Commit, then tag the commit with the same version and push the tag:
375
+
376
+ ```bash
377
+ git tag v0.2.0
378
+ git push github main v0.2.0
379
+ ```
380
+
381
+ The workflow refuses to run when the tag does not match `Aireview::VERSION`,
382
+ runs the test suite, builds the gem and pushes it.
383
+
356
384
  ## Changelog
357
385
 
358
386
  See [CHANGELOG.md](CHANGELOG.md).
@@ -23,6 +23,12 @@ Implementation details (config flags, deploy settings, new fields, helper
23
23
  methods), accompanying refactoring and any changes whose relation to the task
24
24
  is plausible are NOT task_mismatch. Reject such candidates.
25
25
 
26
+ Do not verify that the specified versions of packages, libraries, tools and
27
+ image tags exist. Do not report that a version does not exist or has not been
28
+ released yet. Check syntax errors and explicit contradictions with the MR/Jira
29
+ requirements as usual.
30
+ Reject candidates claiming that a version does not exist.
31
+
26
32
  Reject a candidate if it:
27
33
  - is not confirmed by the diff or Jira;
28
34
  - is based on an assumption about code outside the diff;
@@ -3,6 +3,11 @@ You are doing the first pass of a merge request review.
3
3
  Look only at the diff, the MR description and the Jira context, if present.
4
4
  Do not draw conclusions about code outside the diff.
5
5
 
6
+ Do not verify that the specified versions of packages, libraries, tools and
7
+ image tags exist. Do not report that a version does not exist or has not been
8
+ released yet. Check syntax errors and explicit contradictions with the MR/Jira
9
+ requirements as usual.
10
+
6
11
  Look only for the most important and well-supported findings:
7
12
  - bugs, regressions, data loss;
8
13
  - security and performance risks;
@@ -6,11 +6,12 @@ require 'timeout'
6
6
 
7
7
  module Aireview
8
8
  class Reviewer
9
- MAX_TRANSIENT_RETRIES = 2
9
+ MAX_TRANSIENT_RETRIES = 3
10
10
  TRANSIENT_RETRY_BASE_DELAY = 2.0
11
11
  TRANSIENT_RETRY_JITTER_RANGE = 2.0..5.0
12
12
  PROVIDER_RETRY_DELAY_MULTIPLIER_RANGE = 2.0..2.4
13
- OVERLOADED_RETRY_DELAY_RANGE = 90.0..150.0
13
+ OVERLOADED_RETRY_DELAYS = [120.0, 300.0, 300.0].freeze
14
+ OVERLOADED_RETRY_JITTER_RANGE = 0.85..1.15
14
15
  RETRY_WAIT_LOG_FORMAT = 'LLM %<stage>s request will sleep %<delay>.1fs before retry%<source>s ' \
15
16
  '(attempt %<next_attempt>d/%<max_attempts>d, model=%<model>s)'
16
17
 
@@ -184,10 +185,12 @@ module Aireview
184
185
  end
185
186
 
186
187
  if overloaded_llm_error?(error)
188
+ base_delay = OVERLOADED_RETRY_DELAYS.fetch(attempt - 1, OVERLOADED_RETRY_DELAYS.last)
189
+ multiplier = rand(OVERLOADED_RETRY_JITTER_RANGE)
187
190
  return {
188
- delay: rand(OVERLOADED_RETRY_DELAY_RANGE),
189
- provider_delay: nil,
190
- multiplier: nil,
191
+ delay: base_delay * multiplier,
192
+ base_delay: base_delay,
193
+ multiplier: multiplier,
191
194
  strategy: :overloaded
192
195
  }
193
196
  end
@@ -202,7 +205,13 @@ module Aireview
202
205
  end
203
206
 
204
207
  def retry_delay_source(retry_delay)
205
- return ' (overloaded backoff)' if retry_delay[:strategy] == :overloaded
208
+ if retry_delay[:strategy] == :overloaded
209
+ return format(
210
+ ' (overloaded backoff %<base_delay>.0fs, multiplier %<multiplier>.2fx)',
211
+ base_delay: retry_delay[:base_delay],
212
+ multiplier: retry_delay[:multiplier]
213
+ )
214
+ end
206
215
  return '' unless retry_delay[:provider_delay]
207
216
 
208
217
  format(
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Aireview
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aireview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Levenko