alissa-tools-github-revloop 0.22.0__tar.gz → 0.23.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 (32) hide show
  1. {alissa_tools_github_revloop-0.22.0/src/main/alissa_tools_github_revloop.egg-info → alissa_tools_github_revloop-0.23.0}/PKG-INFO +1 -1
  2. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/alissa.py +57 -13
  3. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/prreview.py +3 -3
  4. alissa_tools_github_revloop-0.23.0/src/main/alissa/tools/github/revloop/version +1 -0
  5. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0/src/main/alissa_tools_github_revloop.egg-info}/PKG-INFO +1 -1
  6. alissa_tools_github_revloop-0.22.0/src/main/alissa/tools/github/revloop/version +0 -1
  7. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/LICENSE +0 -0
  8. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/MANIFEST.in +0 -0
  9. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/NOTICE +0 -0
  10. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/README.md +0 -0
  11. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/requirements.txt +0 -0
  12. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/setup.cfg +0 -0
  13. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/setup.py +0 -0
  14. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/__init__.py +0 -0
  15. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/__main__.py +0 -0
  16. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/config.py +0 -0
  17. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/ghclient.py +0 -0
  18. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/loop.py +0 -0
  19. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/proc.py +0 -0
  20. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/state.py +0 -0
  21. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/version.py +0 -0
  22. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/__init__.py +0 -0
  23. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/__main__.py +0 -0
  24. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/auth.py +0 -0
  25. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/page.py +0 -0
  26. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/server.py +0 -0
  27. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/sources.py +0 -0
  28. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa/tools/github/revloop/webui/sysinfo.py +0 -0
  29. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa_tools_github_revloop.egg-info/SOURCES.txt +0 -0
  30. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa_tools_github_revloop.egg-info/dependency_links.txt +0 -0
  31. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa_tools_github_revloop.egg-info/entry_points.txt +0 -0
  32. {alissa_tools_github_revloop-0.22.0 → alissa_tools_github_revloop-0.23.0}/src/main/alissa_tools_github_revloop.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alissa-tools-github-revloop
3
- Version: 0.22.0
3
+ Version: 0.23.0
4
4
  Summary: ALISSA-TOOLS-GITHUB-REVLOOP
5
5
  Home-page: https://alissa.app
6
6
  Author: Fahera
@@ -22,6 +22,12 @@ log = logging.getLogger(__name__)
22
22
  # 0.2.0 validates `--status` against exactly these seven client-side and exits 1
23
23
  # on anything else BEFORE issuing any request, so a single non-canonical value
24
24
  # does not narrow the call slightly less -- it costs the whole narrowed call.
25
+ #
26
+ # A status Alissa adds lands HERE first: a name added to `OPEN_STATUSES` alone
27
+ # reads as non-canonical and drops the narrowing for the whole fleet. That is
28
+ # the safe direction -- wide, never a wrong task resolved -- and the canonical
29
+ # test fails on it, but it fails naming `OPEN_STATUSES`, which is the constant
30
+ # that is right; this is the one that is stale (PR #98 round 1).
25
31
  CANONICAL_TASK_STATUSES = frozenset(
26
32
  {
27
33
  "draft",
@@ -79,24 +85,24 @@ def _status_filter(statuses: "set[str] | frozenset[str]") -> str:
79
85
  and `--self` narrowing down with it and pinning this process to the
80
86
  whole-corpus list (`list_tasks`). One wide call beats every call being wide.
81
87
 
82
- Loud rather than silent: the condition is a code defect (a status added to
83
- `OPEN_STATUSES` that Alissa cannot issue), and the tests pin against it, so
84
- this is the last line rather than the first.
88
+ Pure on purpose. The condition is a code defect and deserves saying out
89
+ loud, but not from here: this runs at IMPORT, which is the one moment the
90
+ daemon's logging is not configured yet (see
91
+ `Alissa._warn_status_filter_dropped`). The tests are what pin the condition;
92
+ the runtime warning is the second line, and it is emitted where it can both
93
+ be formatted and be true.
85
94
  """
86
- unknown = sorted(set(statuses) - CANONICAL_TASK_STATUSES)
87
- if unknown:
88
- log.warning(
89
- "not narrowing `alissa task list` by status: %s not canonical "
90
- "Alissa status(es) -- the CLI rejects the whole call over one "
91
- "unknown value, so this daemon lists the corpus unnarrowed",
92
- ", ".join(unknown),
93
- )
95
+ if set(statuses) - CANONICAL_TASK_STATUSES:
94
96
  return ""
95
97
  return ",".join(sorted(statuses))
96
98
 
97
99
 
98
100
  TASK_LIST_STATUS_FILTER = _status_filter(OPEN_STATUSES)
99
101
 
102
+ # Why the filter above is empty, when it is -- kept for the diagnostic, which
103
+ # cannot be emitted from module scope. Empty in the healthy case.
104
+ NON_CANONICAL_OPEN_STATUSES = tuple(sorted(OPEN_STATUSES - CANONICAL_TASK_STATUSES))
105
+
100
106
  # `--self` drops the SPONSOR's corpus and keeps only the calling actor's rows.
101
107
  #
102
108
  # NOT enabled by default, and the reason is measured rather than cautious. On
@@ -383,6 +389,9 @@ class Alissa:
383
389
  # wrongly is worse than a list that is large: `find_review_task` reads an
384
390
  # empty corpus as "this PR has no review task".
385
391
  self._task_list_narrowing_disabled = False
392
+ # One diagnostic per client for a status filter that could not be sent
393
+ # (see `_warn_status_filter_dropped`); this path runs every poll pass.
394
+ self._status_filter_warned = False
386
395
 
387
396
  # -- the `alissa task list` narrowing probe -----------------------------
388
397
 
@@ -428,6 +437,38 @@ class Alissa:
428
437
  self._task_list_flags = flags
429
438
  return flags
430
439
 
440
+ def _warn_status_filter_dropped(self) -> None:
441
+ """Say, once, that a status narrowing this CLI offers is going unused.
442
+
443
+ Not emitted where the filter is COMPUTED, which is import time, and that
444
+ is the whole point of it living here (PR #98 round 1): `__main__` pulls
445
+ this module in through `.loop` long before it calls
446
+ `logging.basicConfig`, so a warning at module scope falls through to
447
+ `logging.lastResort` -- bare on stderr, no timestamp or logger name, and
448
+ outside whatever handler the deployment configured.
449
+
450
+ It would also be premature there. At import nothing yet knows whether
451
+ this CLI serves `--status` at all, and on a CLI that does not, the
452
+ filter costs nothing and there is nothing to warn about. Here the
453
+ message is only emitted when the flag was on offer and could not be
454
+ used, which is the only case where the defect actually costs reads.
455
+ """
456
+ if self._status_filter_warned:
457
+ return
458
+ self._status_filter_warned = True
459
+ reason = (
460
+ "non-canonical status(es) in OPEN_STATUSES: "
461
+ + ", ".join(NON_CANONICAL_OPEN_STATUSES)
462
+ if NON_CANONICAL_OPEN_STATUSES
463
+ else "OPEN_STATUSES is empty"
464
+ )
465
+ log.warning(
466
+ "`alissa task list` offers --status and this daemon is not using "
467
+ "it (%s) -- the CLI rejects the whole call over one unknown value, "
468
+ "so the corpus is listed unnarrowed",
469
+ reason,
470
+ )
471
+
431
472
  def task_list_argv(self, *, narrow_status: bool = True) -> list[str]:
432
473
  """The narrowest `alissa task list` this CLI actually supports.
433
474
 
@@ -441,8 +482,11 @@ class Alissa:
441
482
  # An empty filter is not a filter: `_status_filter` answers `""` when
442
483
  # the open set carries a status the CLI would reject, and sending
443
484
  # `--status ""` would be that same rejected call with an extra step.
444
- if flags.status and narrow_status and TASK_LIST_STATUS_FILTER:
445
- argv += [TASK_LIST_STATUS_FLAG, TASK_LIST_STATUS_FILTER]
485
+ if flags.status and narrow_status:
486
+ if TASK_LIST_STATUS_FILTER:
487
+ argv += [TASK_LIST_STATUS_FLAG, TASK_LIST_STATUS_FILTER]
488
+ else:
489
+ self._warn_status_filter_dropped()
446
490
  if flags.self_scope and self._task_list_self_scope:
447
491
  argv.append(TASK_LIST_SELF_FLAG)
448
492
  if flags.digest:
@@ -75,9 +75,9 @@ def _review_task_ref(alissa: Alissa, owner: str, repo: str, number: int) -> str
75
75
  Deliberately not `Alissa.find_review_task` (which filters to open tasks): we
76
76
  still want the ref just after the task is validated, to read its verdict.
77
77
  `narrow_status=False` says the same thing to the LIST call for the same
78
- reason -- the daemon's server-side status filter is exactly its `is_open`
79
- set, and narrowing by it here would re-impose the filter this function
80
- exists to avoid.
78
+ reason -- the daemon's server-side status filter is either exactly its
79
+ `is_open` set or absent altogether, and in the first case narrowing by it
80
+ here would re-impose the filter this function exists to avoid.
81
81
  """
82
82
  pattern = re.compile(
83
83
  rf"^Review PR\s+{re.escape(owner)}/{re.escape(repo)}#{number}\b", re.IGNORECASE
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alissa-tools-github-revloop
3
- Version: 0.22.0
3
+ Version: 0.23.0
4
4
  Summary: ALISSA-TOOLS-GITHUB-REVLOOP
5
5
  Home-page: https://alissa.app
6
6
  Author: Fahera