-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Correctly pull twisted trunk when triggered overnight and ignore known type error #16115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way to test this? Seems reasonable...
# type-ignore: This is an error in Twisted's annotations. See | ||
# https://github.com/twisted/twisted/issues/11812 and /11813 . | ||
factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker])) # type: ignore[arg-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Urgh, the error is only introduced in twisted trunk, so adding this triggers an unused-ignore error on the current build.
Maybe I can use a cast
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted just to tell mypy to relax the unused-ignore check for this file. (Simpler, and I'm pretty sure it can complain about a redundant cast sometimes.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of adding an ignored file, can we do type: ignore[arg-type,<whatever the code is for an unneeded ignore>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not sure it has an error code:
synapse/util/manhole.py:103: error: Unused "type: ignore" comment
Maybe I can just use a naked # type[ignore]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth a try, if not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No luck, I'm afraid. 🚢 ping it
One day I'm gonna write a linter for this, and write a workflow to run the linter on all workflows, including the workflow itself.
I can test this by temporarily forcing this branch to run the twisted-trunk job. It looks like the changes were successful. They point to new typechecking errors: https://github.com/matrix-org/synapse/actions/runs/5868230260/job/15910583758?pr=16115, which I would guess are mostly due to twisted/twisted#11770 |
Should we fix that here or merge this and do a follow-up? |
My vote is the latter: merge and follow-up. |
(Will let CI run, then revert |
CI against the main release of twisted seemed fine. |
This reverts commit da3f079.
See the discussion in #15097.