Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action to (re-)generate and print conversation transcript #1621

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

gonzalo-bulnes
Copy link
Contributor

@gonzalo-bulnes gonzalo-bulnes commented Jan 25, 2023

Description

The shortest path to providing an option to print a conversation transcript to journalists.

Fixes #1435

Context

We're explicitly making the decision to favor speed of delivery for this and next few features in the spirit of making the most of the pilot participant's feedback. (We: @zenmonkeykstop, @cfm, @gonzalo-bulnes)

General availability considerations are out of the table for the time being, and accordingly, I'll be pausing the ongoing work to improve code structure and implementation patterns (namely: testing patterns, usage of native Qt features, etc).

Once this and related work is released, we'll pause and re-assess, whether:

  • we want to keep iterating on the pilot to answer outstanding questions
  • start moving towards general availability
    • collect and document learning about journalists needs, and the solutions we've tried in this pilot
    • formulate goals and problems to be solved
    • decide on next steps to best work towards those

Closes #1615
Closes #1584

Implementation

  • Takes the existing print dialog as a reference
  • Follows the existing patterns for testing it

Test plan

If you've got a printer, print a conversation transcript!

  1. Start the app
  2. Select a conversation
  3. For good measure download a file or two
  4. Trigger "Print Conversation Transcript" in the conversation menu (a.k.a source menu, kebab menu...)
  • Confirm that the dialog says it will print conversation.txt
  • Confirm the file is printed as expected

If you haven't got a printer, you can fake a printer's presence by applying this patch, then do the following after pressing the "Print" "Continue" button:

Preview of the log once the patch is applied A debug log
  1. Read the name of the freshly created temporary directory in the process STDOUT
  2. Make a copy of the directory as soon as it shows up (the patch will give you 15s to do that, increase at will!)
  3. Extract the archive.
  • Confirm that the content of the metadata,json file is: {device: "printer"}
  • Confirm that the conversation.txt file is present
  • Confirm that the content of the conversation.txt file is indeed the file transcript

@gonzalo-bulnes gonzalo-bulnes requested review from cfm and rocodes January 25, 2023 11:34
@cfm cfm self-assigned this Jan 26, 2023
@gonzalo-bulnes gonzalo-bulnes force-pushed the print-conversation-transcript branch 2 times, most recently from 7bb2cc2 to e714803 Compare January 26, 2023 06:30
@gonzalo-bulnes gonzalo-bulnes marked this pull request as ready for review January 26, 2023 06:36
@gonzalo-bulnes gonzalo-bulnes requested a review from a team as a code owner January 26, 2023 06:36
@gonzalo-bulnes
Copy link
Contributor Author

gonzalo-bulnes commented Jan 26, 2023

Good for a first look @cfm! 👁️

I'll add a test plan.


Edit: I added the test plan. You can do without a workstation if you don't have one handy, I linked a patch to make that easier. The patch is commented and should be fairly understandable I think, if not, I can walk you through it 🙂

Copy link
Member

@cfm cfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gonzalo-bulnes, I've done a first pass as we discussed last week, focusing on:

  1. code review, in which I left you a few questions about documentation; and
  2. printerless testing via tmp-print-conversation-transcript, which checks out as expected.

Looking forward to pairing with you on refinement as you see fit this week!

securedrop_client/gui/actions.py Outdated Show resolved Hide resolved
securedrop_client/gui/actions.py Outdated Show resolved Hide resolved
securedrop_client/gui/actions.py Show resolved Hide resolved
@gonzalo-bulnes
Copy link
Contributor Author

gonzalo-bulnes commented Jan 31, 2023

Oh, wow. Something's up with Bookworm. (Some package hashes are not matching anymore.)

@gonzalo-bulnes
Copy link
Contributor Author

Over to you @cfm! 🏖️ (I'm ignoring the Bookworm failures because they seem unrelated to the topic at hand, I suspect that builds are failing across the board.)

@gonzalo-bulnes gonzalo-bulnes requested a review from cfm January 31, 2023 10:08
@cfm
Copy link
Member

cfm commented Jan 31, 2023

Thanks, @gonzalo-bulnes! Let's check in tomorrow about what's remaining here for implementation, testing, and review.

Copy link
Member

@cfm cfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Penultimate review after discussing with @gonzalo-bulnes:

  • I've confirmed that my printer is not automatically usable via sd-devices, so I've run through the printerless test plan again. Looks good!
  • I've done another line-by-line review and requested some changes, all extremely minor nits for clarity.

After your final edits and squash, @gonzalo-bulnes, I'll plan to merge this tomorrow, along with #1623 if the (otherwise irrelevant) *-bookworm CI failures turn out to be blocking after all.

securedrop_client/gui/actions.py Show resolved Hide resolved
securedrop_client/gui/actions.py Outdated Show resolved Hide resolved
securedrop_client/gui/actions.py Outdated Show resolved Hide resolved
securedrop_client/gui/conversation/__init__.py Outdated Show resolved Hide resolved
Co-authored-by: Cory Francis Myers <cory@freedom.press>
@gonzalo-bulnes gonzalo-bulnes force-pushed the print-conversation-transcript branch from 3ac1de0 to aea7579 Compare February 2, 2023 12:56
@gonzalo-bulnes
Copy link
Contributor Author

gonzalo-bulnes commented Feb 2, 2023

(applied all but one of the suggestions, rebased to squash commits - over to you again @cfm! 🙂)

@gonzalo-bulnes gonzalo-bulnes requested a review from cfm February 2, 2023 13:07
Copy link
Member

@cfm cfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All comments addressed; test plan checks out. Thanks both for this feature and for the back-and-forth, @gonzalo-bulnes!

@cfm cfm merged commit 719d4d4 into main Feb 2, 2023
@cfm cfm deleted the print-conversation-transcript branch February 2, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support printing conversations
2 participants