aboutsummaryrefslogtreecommitdiffstats
path: root/docs/plans
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-09 09:23:30 +0200
committerDanilo M. <danix@danix.xyz>2026-09-09 09:23:30 +0200
commit367bdb96caaec23b7f895214ddf9ab6dd6b86e34 (patch)
treebb8b14304d227484c20e36e6c64d00188ce10028 /docs/plans
parentcbf443c480161e947c6383b57047d57306604fff (diff)
downloadabusectl-367bdb96caaec23b7f895214ddf9ab6dd6b86e34.tar.gz
abusectl-367bdb96caaec23b7f895214ddf9ab6dd6b86e34.zip
docs: amend the contacts plan after task 1 to 5
Two corrections found while executing it. The offline proof in task 9 patched socket.socket itself, which breaks the ssl module at import time and produces false failures unrelated to network use. It now patches socket.socket.connect, which is the right target. Task 12 gains a step moving the imports in rdap.py to the top of the file. The module was built one task at a time, so several imports landed mid-file after function definitions. Doing it in the documentation pass keeps it out of the diff that contacts.py builds on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wrfqr2xqQfhtXCscU7zrdz
Diffstat (limited to 'docs/plans')
-rw-r--r--docs/plans/2026-09-09-contacts.md30
1 files changed, 26 insertions, 4 deletions
diff --git a/docs/plans/2026-09-09-contacts.md b/docs/plans/2026-09-09-contacts.md
index 40392d8..244fdce 100644
--- a/docs/plans/2026-09-09-contacts.md
+++ b/docs/plans/2026-09-09-contacts.md
@@ -1678,7 +1678,17 @@ from abusectl import contacts, parse, rdap
class NothingOpensASocket(unittest.TestCase):
def setUp(self):
- for name in ("socket", "create_connection", "getaddrinfo"):
+ # socket.socket.connect, NOT socket.socket: replacing the class
+ # itself breaks the ssl module at import time and produces false
+ # failures that have nothing to do with network use.
+ patcher = mock.patch.object(
+ socket.socket, "connect",
+ side_effect=AssertionError("socket.socket.connect was called"),
+ )
+ patcher.start()
+ self.addCleanup(patcher.stop)
+
+ for name in ("create_connection", "getaddrinfo"):
patcher = mock.patch.object(
socket, name,
side_effect=AssertionError(f"socket.{name} was called"),
@@ -1935,15 +1945,27 @@ Update the Planned line to name only `report`, `submit` and `retry`.
Add `contacts` to the usage section beside `parse`, matching the existing
style, including that it needs network and that a re-run is safe.
-- [ ] **Step 4: Run the suite one final time**
+- [ ] **Step 4: Tidy the imports in `abusectl/rdap.py`**
+
+The module was built one task at a time, so `os`, `pathlib`, `time`,
+`ipaddress` and `email.utils` are imported mid-file, after function
+definitions, rather than grouped at the top. Move every import to the top of
+the file in one block, standard library alphabetical, matching the other
+modules in `abusectl/`. Change nothing else: this is a move, not a rewrite.
+
+Run: `python3 -m unittest discover tests`
+Expected: OK, the same count as before the move. If the count changes, the
+move broke something; revert and redo it.
+
+- [ ] **Step 5: Run the suite one final time**
Run: `python3 -m unittest discover tests`
Expected: OK
-- [ ] **Step 5: Commit**
+- [ ] **Step 6: Commit**
```bash
-git add AGENTS.md README.md docs/BACKLOG.md
+git add AGENTS.md README.md docs/BACKLOG.md abusectl/rdap.py
git commit -S -m "docs: record the fourth property and the contacts command
An RDAP query discloses what the user is looking at, and property 1