Answer stability round 2: 0 🔴, 1 🟡 (0 misread); refuse a write that repeats a section
CI / tests (pull_request) Successful in 2m52s
CI / tests (pull_request) Successful in 2m52s
This commit is contained in:
@@ -92,7 +92,10 @@ class EpicDescription:
|
||||
sent = "" if document is None else self.markdown_of(document)
|
||||
if isinstance(sent, Failure):
|
||||
return sent
|
||||
if unapproved := [name for name in APPROVED_SECTIONS if name not in self.approved and sections(sent).get(name) != sections(current.text).get(name)]:
|
||||
before, after = sections(current.text), sections(sent)
|
||||
if repeated := [name for name, bodies in after.items() if len(bodies) > max(1, len(before.get(name, [])))]:
|
||||
return Failure(f"the write would repeat ## {repeated[0]} in {key}'s description, which locks that section for reads and writes: leave a heading out of the text, or edit the description in Jira")
|
||||
if unapproved := [name for name in APPROVED_SECTIONS if name not in self.approved and after.get(name) != before.get(name)]:
|
||||
return Failure(f"the write changes ## {unapproved[0]} of {key}'s description without the human's approval: have the human approve it in an interrupt, or edit the section in Jira")
|
||||
authorization = basic_auth(self.env_file)
|
||||
if isinstance(authorization, Failure):
|
||||
|
||||
Reference in New Issue
Block a user