fix some Interface violations #1537

Open
opened 2011-09-19 21:52:13 +00:00 by warner · 6 comments
warner commented 2011-09-19 21:52:13 +00:00
Owner

Daira ran a script (in #1474) and found a list of places where
classes that claim to implement some Interface don't in fact do it
correctly. Here's the list and a quick note about what I think should be
done about each:

  • foolscap.slicer.BaseUnslicer does not correctly implement

foolscap.tokens.IUnslicer: The 'where' method was not provided.

  • ISTR BaseUnslicer.where is purely abstract, meant to be overridden
    by subclasses. Not sure if that makes it easier to remove the
    IUnslicer annotation from BaseUnslicer (and add it to all
    subclasses, which is kinda verbose), or to add a dummy method to
    BaseUnslicer (which throws NotImplementedError if ever called, and
    maybe a tiny test to keep that line of code exercised so the coverage
    metrics don't drop :)

  • foolscap.slicers.root.RootSlicer does not correctly implement

foolscap.tokens.ISlicer: The implementation of slice violates its
contract because implementation doesn't allow enough arguments.

  • I think (but not sure) RootSlicer.slice is never called.. it should
    probably be modified to match signatures with tokens.ISlicer and also
    throw an error if ever called, just to be sure

  • foolscap.referenceable.Referenceable does not correctly implement

foolscap.ipb.IRemotelyCallable: The 'getInterfaceNames' method was not
provided.

  • getInterfaceNames() looks like it's misspelled in ipb.py (should be
    singular, not plural)

  • foolscap.referenceable.RemoteReferenceOnly does not correctly

implement foolscap.ipb.IRemoteReference: The 'callRemoteOnly' method
was not provided. The 'callRemote' method was not provided.

  • IRemoteReference should be split, or moved: RemoteReferenceOnly
    isn't supposed to have callRemote/callRemoteOnly

  • [allmydata.codec.CRSEncoder]source:git/src/allmydata/codec.py?annotate=blame&rev=b315619d6b3e5f20015213eb2941205f6abbb0e2#L10 does not correctly implement

allmydata.interfaces.ICodecEncoder: The [encode_proposal]source:git/src/allmydata/interfaces.py?annotate=blame&rev=cf9bf2ea10f8043f910de971f5a736a9d9bced21#L1373 method was
not provided.

  • allmydata.immutable.encode.Encoder does not correctly implement

allmydata.interfaces.IEncoder: The 'set_params' method was not
provided. The 'set_size' method was not provided.

  • IEncoder should probably be split into two interfaces (one for
    CRSEncoder with set_params/set_size, the rest for the higher-level
    encode.Encoder)

  • allmydata.immutable.offloaded.LocalCiphertextReader does not

correctly implement allmydata.interfaces.IEncryptedUploadable: The
'set_upload_status' method was not provided.

  • should probably be implemented

  • allmydata.immutable.literal.LiteralProducer does not correctly

implement twisted.internet.interfaces.IPushProducer: The
'pauseProducing' method was not provided.

  • should be implemented
Daira ran a script (in #1474) and found a list of places where classes that claim to implement some Interface don't in fact do it correctly. Here's the list and a quick note about what I think should be done about each: * foolscap.slicer.BaseUnslicer does not correctly implement > foolscap.tokens.IUnslicer: The 'where' method was not provided. * ISTR BaseUnslicer.where is purely abstract, meant to be overridden by subclasses. Not sure if that makes it easier to remove the IUnslicer annotation from BaseUnslicer (and add it to all subclasses, which is kinda verbose), or to add a dummy method to BaseUnslicer (which throws NotImplementedError if ever called, and maybe a tiny test to keep that line of code exercised so the coverage metrics don't drop :) * foolscap.slicers.root.RootSlicer does not correctly implement > foolscap.tokens.ISlicer: The implementation of slice violates its > contract because implementation doesn't allow enough arguments. * I think (but not sure) RootSlicer.slice is never called.. it should probably be modified to match signatures with tokens.ISlicer and also throw an error if ever called, just to be sure * foolscap.referenceable.Referenceable does not correctly implement > foolscap.ipb.IRemotelyCallable: The 'getInterfaceNames' method was not > provided. * getInterfaceNames() looks like it's misspelled in ipb.py (should be singular, not plural) * foolscap.referenceable.RemoteReferenceOnly does not correctly > implement foolscap.ipb.IRemoteReference: The 'callRemoteOnly' method > was not provided. The 'callRemote' method was not provided. * IRemoteReference should be split, or moved: RemoteReferenceOnly isn't supposed to have callRemote/callRemoteOnly * [allmydata.codec.CRSEncoder]source:git/src/allmydata/codec.py?annotate=blame&rev=b315619d6b3e5f20015213eb2941205f6abbb0e2#L10 does not correctly implement > allmydata.interfaces.ICodecEncoder: The [encode_proposal]source:git/src/allmydata/interfaces.py?annotate=blame&rev=cf9bf2ea10f8043f910de971f5a736a9d9bced21#L1373 method was > not provided. * allmydata.immutable.encode.Encoder does not correctly implement > allmydata.interfaces.IEncoder: The 'set_params' method was not > provided. The 'set_size' method was not provided. * IEncoder should probably be split into two interfaces (one for CRSEncoder with set_params/set_size, the rest for the higher-level encode.Encoder) * allmydata.immutable.offloaded.LocalCiphertextReader does not > correctly implement allmydata.interfaces.IEncryptedUploadable: The 'set_upload_status' method was not provided. * should probably be implemented * allmydata.immutable.literal.LiteralProducer does not correctly > implement twisted.internet.interfaces.IPushProducer: The 'pauseProducing' method was not provided. * should be implemented
tahoe-lafs added the
code
minor
defect
1.9.0a1
labels 2011-09-19 21:52:13 +00:00
tahoe-lafs added this to the undecided milestone 2011-09-19 21:52:13 +00:00
davidsarah commented 2011-10-03 19:55:11 +00:00
Author
Owner

Attachment fix-literal-pauseProducing.darcs.patch (23192 bytes) added

immutable/literal.py: add pauseProducing method to LiteralProducer. refs #1537

**Attachment** fix-literal-pauseProducing.darcs.patch (23192 bytes) added immutable/literal.py: add pauseProducing method to [LiteralProducer](wiki/LiteralProducer). refs #1537
tahoe-lafs modified the milestone from undecided to 1.10.0 2011-10-03 19:56:54 +00:00
zooko commented 2011-10-03 21:29:40 +00:00
Author
Owner
+1 on [fix-literal-pauseProducing.darcs.patch](/tahoe-lafs/trac-2024-07-25/attachments/000078ac-ad89-6e3e-cf46-5022a4c7b0f5)
david-sarah@jacaranda.org commented 2011-10-07 19:39:47 +00:00
Author
Owner

In [5395/ticket999-S3-backend]:

immutable/literal.py: add pauseProducing method to LiteralProducer. refs #1537
In [5395/ticket999-S3-backend]: ``` immutable/literal.py: add pauseProducing method to LiteralProducer. refs #1537 ```
david-sarah@jacaranda.org commented 2011-10-10 19:53:52 +00:00
Author
Owner

In changeset:bc50edc86ef1c20b:

immutable/literal.py: add pauseProducing method to LiteralProducer. refs #1537
In changeset:bc50edc86ef1c20b: ``` immutable/literal.py: add pauseProducing method to LiteralProducer. refs #1537 ```
davidsarah commented 2011-12-31 20:28:54 +00:00
Author
Owner

The patch has not been applied to trunk, so it's correct to keep the 'reviewed' keyword until it is. I don't know what comment:127241 was about.

The patch has not been applied to trunk, so it's correct to keep the 'reviewed' keyword until it is. I don't know what [comment:127241](/tahoe-lafs/trac-2024-07-25/issues/1537#issuecomment-127241) was about.
zooko commented 2011-12-31 22:50:14 +00:00
Author
Owner

I checked and the added [pauseProducing]source:git/src/allmydata/immutable/literal.py?annotate=blame&rev=bc0d9b682e97c26dbc0c8a731c7a3a3837815667#L50 method is indeed now in LiteralProducer. Trac annotate tells me that it was committed (in git world) by changeset:bc0d9b682e97c26d.

I checked and the added [pauseProducing]source:git/src/allmydata/immutable/literal.py?annotate=blame&rev=bc0d9b682e97c26dbc0c8a731c7a3a3837815667#L50 method is indeed now in `LiteralProducer`. Trac annotate tells me that it was committed (in git world) by changeset:bc0d9b682e97c26d.
tahoe-lafs modified the milestone from 1.11.0 to 1.10.0 2012-04-01 03:59:36 +00:00
tahoe-lafs modified the milestone from 1.10.0 to 1.11.0 2012-12-20 16:42:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1537
No description provided.