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

Cosign improvements (batch 2) #4838

Merged
merged 16 commits into from
Nov 27, 2024

Conversation

sergei-maertens
Copy link
Member

@sergei-maertens sergei-maertens commented Nov 19, 2024

Closes #4320 (partially)

Changes

  • Added new templates with (roughly) the desired language/literals for the confirmation email sent to the submitter
    • handles the state when cosign is not done yet (so right after submitting)
    • handles the state when the cosigner has done the signing and a confirmation is sent that it's now processed
  • Update documentation
  • The summary PDF no longer includes the confirmation page content template for cosign, instead it includes a disclaimer that the submission is not guaranteed to be processed yet.

Screenshots

E-mail to submitter before cosigning

image

E-mail to submitter after cosigning

image

PDF generated

image

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@sergei-maertens sergei-maertens force-pushed the feature/4320-cosign-improvements-2 branch 2 times, most recently from 40e5f3f to 829a491 Compare November 21, 2024 07:56
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.61%. Comparing base (8cc5eb4) to head (d9c6e9d).
Report is 29 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4838      +/-   ##
==========================================
- Coverage   96.61%   96.61%   -0.01%     
==========================================
  Files         751      752       +1     
  Lines       25679    25737      +58     
  Branches     3395     3406      +11     
==========================================
+ Hits        24809    24865      +56     
- Misses        608      610       +2     
  Partials      262      262              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergei-maertens sergei-maertens force-pushed the feature/4320-cosign-improvements-2 branch 2 times, most recently from 36ced0e to 8d6a2ad Compare November 21, 2024 15:55
@sergei-maertens sergei-maertens force-pushed the feature/4320-cosign-improvements-2 branch from 8d6a2ad to 04c4d31 Compare November 21, 2024 16:43
@sergei-maertens
Copy link
Member Author

Putting this one up for review - however keep in mind that I want to do a refactor follow-up PR:

  • I want some kind of utility/container that captures the cosign information for a submission. Now a bunch of information/properties/methods are scattered on the Submission model and while I like fat models, this one is getting obese
  • There are a couple more textual changes to apply and tweak, so that will be a separate PR too.

@sergei-maertens sergei-maertens marked this pull request as ready for review November 21, 2024 16:47
@sergei-maertens sergei-maertens force-pushed the feature/4320-cosign-improvements-2 branch from 04c4d31 to 774fad2 Compare November 21, 2024 17:02
@sergei-maertens sergei-maertens force-pushed the feature/4320-cosign-improvements-2 branch 3 times, most recently from ef50566 to 3da92e2 Compare November 25, 2024 13:30
if no form fields are going to be rendered in the summary, there
should not be any heading emitted.

Also relevant for the (duplicate) #4831
…ng to report

The confirmation email is only supposed to emit the summary heading
if there's actual data being summarized. This relies on the renderer
having children or not, since the actual table is produced by the
renderer/tree visitor walking over the submission (steps) and associated
form components in the form definition.

The check whether the render has children was faulty since it returned
children that didn't have any grand-children itself, wrongly creating
the impression that there's going to be content output.

There was some old, commented out, prototype code that hinted at this
not being the intent, that was replaced with a proper check.

This also fixes #4831, which is a duplicate of a bullet in the main
cosign improvements ticket.
Since we've committed to this route by doing this for the confirmation
page content template, we have to be consistent and follow the same
pattern for the confirmation email. There's an extra complexity here
because the confirmation email templates can be overridden at the form
level.
Added additional (translatable) template fields to the global
configuration and form-specific confirmation email templates
to render for submissions requiring cosigning.

TODO: expose them in the admin, API and frontend.
Refactored the template selection for subject and content
of the confirmation email to take into consideration if
cosigning is required or not.
* Expose the fields in the serializers
* Updated the frontend code to add the fields
* Updated the end to end tests asserting the translation warnings
The content of the header needs to change depending on the cosign state,
and we now provide more control in the parent templates so the most
flexible solution is to just remove the header from the hardcoded
template.

While we're working on 3.0 which has breaking changes, this is the
best coincidence we can hope for to make this breaking change.
…cosign status

A submission requiring cosigning is still in a waiting state before
it will be sent to a registration backend. The language used in the
PDF now makes this clear, which should also avoid legal implications
associated with the displayed 'completion' timestamp.
Simplified the language down to B1 level.
@sergei-maertens sergei-maertens force-pushed the feature/4320-cosign-improvements-2 branch from 3da92e2 to d9c6e9d Compare November 26, 2024 13:43
@@ -1,3 +1,5 @@
from __future__ import annotations
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need that in python 3.12? Or are we doing this for earlier versions?

Copy link
Member Author

Choose a reason for hiding this comment

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

this mostly makes the annotations/imports lazy so you can use the Name in places when doing conditional imports without having to wrap them in strings: "Name"

@@ -0,0 +1,42 @@
import functools
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we going to keep this solution?I thought it was not the what we wanted.(asking since this is now a reusable thing..)

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not what we want, but it is what we need for the time being 😬

@sergei-maertens sergei-maertens merged commit 865a0f5 into master Nov 27, 2024
34 checks passed
@sergei-maertens sergei-maertens deleted the feature/4320-cosign-improvements-2 branch November 27, 2024 09:22
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.

Various co-sign improvements
2 participants