alissa-tools-github-reviewloop 0.6.0__tar.gz → 0.7.0__tar.gz

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.
Files changed (23) hide show
  1. {alissa_tools_github_reviewloop-0.6.0/src/main/alissa_tools_github_reviewloop.egg-info → alissa_tools_github_reviewloop-0.7.0}/PKG-INFO +1 -1
  2. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/loop.py +23 -3
  3. alissa_tools_github_reviewloop-0.7.0/src/main/alissa/tools/github/reviewloop/version +1 -0
  4. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0/src/main/alissa_tools_github_reviewloop.egg-info}/PKG-INFO +1 -1
  5. alissa_tools_github_reviewloop-0.6.0/src/main/alissa/tools/github/reviewloop/version +0 -1
  6. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/MANIFEST.in +0 -0
  7. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/README.md +0 -0
  8. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/requirements.txt +0 -0
  9. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/setup.cfg +0 -0
  10. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/setup.py +0 -0
  11. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/__init__.py +0 -0
  12. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/__main__.py +0 -0
  13. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/alissa.py +0 -0
  14. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/config.py +0 -0
  15. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/ghclient.py +0 -0
  16. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/proc.py +0 -0
  17. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/prreview.py +0 -0
  18. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/state.py +0 -0
  19. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa/tools/github/reviewloop/version.py +0 -0
  20. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa_tools_github_reviewloop.egg-info/SOURCES.txt +0 -0
  21. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa_tools_github_reviewloop.egg-info/dependency_links.txt +0 -0
  22. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa_tools_github_reviewloop.egg-info/entry_points.txt +0 -0
  23. {alissa_tools_github_reviewloop-0.6.0 → alissa_tools_github_reviewloop-0.7.0}/src/main/alissa_tools_github_reviewloop.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alissa-tools-github-reviewloop
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: ALISSA-TOOLS-GITHUB-REVIEWLOOP
5
5
  Home-page: https://alissa.app
6
6
  Author: Fahera
@@ -172,7 +172,7 @@ class ReviewWatcher:
172
172
  # <= completed is done; its session, if we still have it, can be killed.
173
173
  self._reap_finished(pr.full_name, number, completed)
174
174
 
175
- converged = self._convergence_reason(my_reviews, task)
175
+ converged = self._convergence_reason(my_reviews, task, pr.head_sha)
176
176
  if converged is not None:
177
177
  return Decision(Action.CONVERGED, converged, completed)
178
178
 
@@ -199,7 +199,9 @@ class ReviewWatcher:
199
199
 
200
200
  return self._spawn(pr, round_, task)
201
201
 
202
- def _convergence_reason(self, my_reviews: list[Review], task: Task | None) -> str | None:
202
+ def _convergence_reason(
203
+ self, my_reviews: list[Review], task: Task | None, head_sha: str
204
+ ) -> str | None:
203
205
  """Why the loop is done, or None if it is not.
204
206
 
205
207
  Two independent signals, because neither alone is sufficient:
@@ -213,8 +215,26 @@ class ReviewWatcher:
213
215
  declares this the verdict of record, and unlike the GitHub state it
214
216
  can actually express approval, so it is the signal that closes the
215
217
  loop in practice.
218
+
219
+ BOTH are bound to the current head. An approval means "this code is
220
+ good", so once the implementer pushes past the reviewed commit it is
221
+ about old code and the next round is owed. Without this bind a stale
222
+ approve latches the loop shut forever -- #227: round 1 approved
223
+ `fa304de`, the implementer pushed `fd500fc` and re-requested (and even
224
+ dismissed the approve), yet the envelope still read approve and no round
225
+ 2 was ever queued.
216
226
  """
217
- if my_reviews and my_reviews[-1].state == "APPROVED":
227
+ if not my_reviews:
228
+ return None
229
+
230
+ # New commits since the newest review -> its verdict is about old code.
231
+ # A falsy commit_id (older records lack one) can't be checked, so it
232
+ # falls through rather than blocking convergence.
233
+ newest = my_reviews[-1]
234
+ if newest.commit_id and newest.commit_id != head_sha:
235
+ return None
236
+
237
+ if newest.state == "APPROVED":
218
238
  return "last GitHub review state is APPROVED"
219
239
 
220
240
  # Only checkable once a review task exists; before that there is
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alissa-tools-github-reviewloop
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: ALISSA-TOOLS-GITHUB-REVIEWLOOP
5
5
  Home-page: https://alissa.app
6
6
  Author: Fahera