Skip to content

Conversation

evrii
Copy link
Collaborator

@evrii evrii commented Apr 4, 2022

Description:
Updated the lookback for compliance training to be 30 days.

Alternatives considered:

  • Adding a lookback period column to the access_module table.
    Decided against it, because there is no anticipation of any more lookback periods.

  • Hard coding the training modules lookback period into the ui.
    Decided against this approach, because it seemed less flexible.

image


PR checklist

  • This PR meets the Acceptance Criteria in the JIRA story
  • The JIRA story has been moved to Dev Review
  • This PR includes appropriate unit tests
  • I have added explanatory comments where the logic is not obvious
  • I have run and tested this change locally, and my testing process is described here
  • If this includes a new feature flag, I have created and linked new JIRA tickets to (a) turn on the feature flag and (b) remove it later
  • If this includes an API change, I have run the E2E tests on this change against my local server with yarn test-local because this PR won't be covered by the CircleCI tests
  • If this includes a UI change, I have taken screen recordings or screenshots of the new behavior and notified the PO and UX designer in Slack
  • If this change impacts deployment safety (e.g. removing/altering APIs which are in use) I have documented these in the description
  • If this includes an API change, I have updated the appropriate Swagger definitions and updated the appropriate API consumers

@evrii evrii changed the title Rw 7110 [RW-7110][risk=no] Change lookback for compliance training renewal Apr 4, 2022
@evrii evrii requested review from aweng98, calbach and dmohs April 4, 2022 16:30
Copy link
Contributor

@calbach calbach left a comment

Choose a reason for hiding this comment

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

Looks good, just some minor comments.

Also, originally you mentioned adding this to the DB access module state. This approach works well too, but for future reference it may be a good idea to add the "alternatives considered" to the PR description to capture rationale.

@evrii
Copy link
Collaborator Author

evrii commented Apr 4, 2022

Looks good, just some minor comments.

Also, originally you mentioned adding this to the DB access module state. This approach works well too, but for future reference it may be a good idea to add the "alternatives considered" to the PR description to capture rationale.

Perfect, that is all great feedback. I will work on addressing your comments.

Copy link
Contributor

@aweng98 aweng98 left a comment

Choose a reason for hiding this comment

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

Wouldn't it be nice if you didn't have to type same config and value in all config files.
https://precisionmedicineinitiative.atlassian.net/browse/RW-7871

wasBypassed ||
(isComplete && !isExpiringOrExpired(status?.expirationEpochMillis))
(isComplete &&
!isExpiringOrExpired(status?.expirationEpochMillis, status.moduleName))
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the new param requires optional chaining: status?.moduleName?

Copy link
Collaborator

Choose a reason for hiding this comment

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

moduleName has recently become a required element, so it must exist if status does

Comment on lines 99 to +102
"expiryDays": 365,
"expiryDaysWarningThresholds": [1, 3, 7, 15, 30],
"lookbackPeriod": 330
"lookbackPeriod": 330,
"trainingLookbackPeriod": 30
Copy link
Contributor

Choose a reason for hiding this comment

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

I got an idea for future improvement: there is a pattern here in renewal configs. Maybe one of more config values can be derived.

TOL, e.g. trainingLookbackPeriod can be derived from last element of expiryDaysWarningThresholds array. Or expiryDays minus lookbackPeriod (= 35) is what trainingLookbackPeriod should be.

Copy link
Contributor

@calbach calbach left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@evrii evrii merged commit 4a466ce into main Apr 5, 2022
@evrii evrii deleted the RW-7110 branch April 5, 2022 16:06
complianceTrainingHost:
type: string
description: The hostname for constructing the compliance training URL.
complianceTrainingRenewalLookback:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@evrii what do you think about a small followup PR for this change: group this one with accessRenewalLookback and update the description(s) to make the commonality and differences clearer.

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.

4 participants