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 DataStores class to questionnaire store #1228

Merged
merged 30 commits into from
Nov 14, 2023

Conversation

petechd
Copy link
Contributor

@petechd petechd commented Oct 17, 2023

What is the context of this PR?

This PR encapsulates all our questionnaire store's data stores into single DataStores class. I've added the optional methods to initialise ValueSourceResolver, RuleEvaluator,PlaceholderRenderer to further reduce repetition. New class is kept in questionnaire store module for now, just to get it working in the first pass but happy to move it out.

How to review

Running functional and unit tests plus some manual checks in live schemas and visual code checks should be sufficient.

Checklist

  • New static content marked up for translation
  • Newly defined schema content included in eq-translations repo

@petechd petechd changed the title Add data stores class to questionnaire store Add DataStores class to questionnaire store Oct 17, 2023
@petechd
Copy link
Contributor Author

petechd commented Oct 17, 2023

Copy link
Contributor

@katie-gardner katie-gardner left a comment

Choose a reason for hiding this comment

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

Started looking though this but some changes look quite strange, like in placeholder_parser was this done with a tool? I think it's had some unintended effects

app/data_models/questionnaire_store.py Outdated Show resolved Hide resolved
app/views/contexts/summary/question.py Outdated Show resolved Hide resolved
app/data_models/questionnaire_store.py Outdated Show resolved Hide resolved
app/data_models/questionnaire_store.py Outdated Show resolved Hide resolved
app/data_models/questionnaire_store.py Outdated Show resolved Hide resolved
app/data_models/questionnaire_store.py Outdated Show resolved Hide resolved
app/questionnaire/rules/rule_evaluator.py Outdated Show resolved Hide resolved
app/questionnaire/value_source_resolver.py Outdated Show resolved Hide resolved
app/submitter/converter_v2.py Show resolved Hide resolved
app/questionnaire/placeholder_parser.py Outdated Show resolved Hide resolved
app/data_models/data_stores.py Outdated Show resolved Hide resolved
app/data_models/data_stores.py Outdated Show resolved Hide resolved
app/data_models/data_stores.py Outdated Show resolved Hide resolved
app/data_models/data_stores.py Outdated Show resolved Hide resolved
app/data_models/data_stores.py Outdated Show resolved Hide resolved
app/data_models/questionnaire_store.py Outdated Show resolved Hide resolved
app/data_models/questionnaire_store.py Show resolved Hide resolved
app/forms/questionnaire_form.py Outdated Show resolved Hide resolved
app/questionnaire/placeholder_renderer.py Outdated Show resolved Hide resolved
app/data_models/data_stores.py Show resolved Hide resolved
@petechd petechd force-pushed the add-data-stores-class-to-questionnaire-store branch from a31f5c1 to f6b1b51 Compare October 23, 2023 10:26
Copy link
Contributor

@katie-gardner katie-gardner left a comment

Choose a reason for hiding this comment

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

Will do a second pass but from a first look only found two small things 👍

app/views/contexts/summary/question.py Outdated Show resolved Hide resolved
app/views/contexts/summary/block.py Outdated Show resolved Hide resolved
app/views/contexts/summary/question.py Show resolved Hide resolved
Copy link
Contributor

@katie-gardner katie-gardner left a comment

Choose a reason for hiding this comment

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

Finished going through now - just a few more small things

app/questionnaire/router.py Outdated Show resolved Hide resolved
app/questionnaire/rules/rule_evaluator.py Outdated Show resolved Hide resolved
app/views/contexts/calculated_summary_context.py Outdated Show resolved Hide resolved
tests/app/forms/test_questionnaire_form.py Outdated Show resolved Hide resolved
tests/app/questionnaire/test_placeholder_renderer.py Outdated Show resolved Hide resolved
tests/app/questionnaire/test_placeholder_renderer.py Outdated Show resolved Hide resolved
tests/app/questionnaire/test_router.py Outdated Show resolved Hide resolved
tests/app/questionnaire/conftest.py Outdated Show resolved Hide resolved
tests/app/questionnaire/test_value_source_resolver.py Outdated Show resolved Hide resolved
@MebinAbraham MebinAbraham added the dont merge Don't merge this PR label Oct 26, 2023
Copy link
Contributor

@liamtoozer liamtoozer left a comment

Choose a reason for hiding this comment

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

Looks great from what I can see & understand! Just had a couple of learning questions but no worries if there's not enough time

app/views/contexts/calculated_summary_context.py Outdated Show resolved Hide resolved
Copy link
Contributor

@katie-gardner katie-gardner left a comment

Choose a reason for hiding this comment

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

Everything resolved except one minor thing off a previous comment

Copy link
Contributor

@katie-gardner katie-gardner left a comment

Choose a reason for hiding this comment

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

My comments all fixed 👍

Copy link
Contributor

@berroar berroar 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 👍

Copy link
Contributor

@MebinAbraham MebinAbraham left a comment

Choose a reason for hiding this comment

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

Not done an in-depth re-review, only a quick scan, mostly looks all okay. Noticed QS is inconsistent with attribute access, some private, some public, metadata has a setter, others doesn't, one to sort out in a future PR.

app/forms/questionnaire_form.py Outdated Show resolved Hide resolved
app/questionnaire/questionnaire_store_updater.py Outdated Show resolved Hide resolved
tests/app/data_model/test_questionnaire_store.py Outdated Show resolved Hide resolved
Copy link
Contributor

@MebinAbraham MebinAbraham left a comment

Choose a reason for hiding this comment

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

Do have mixed feelings about this change but in general I think the change is for the better. I think we've accepted that we have sacrificed some readability for maintainability/extendibility.

LGTM 👍

@MebinAbraham MebinAbraham removed the dont merge Don't merge this PR label Nov 13, 2023
@petechd petechd merged commit ff52496 into main Nov 14, 2023
15 checks passed
@petechd petechd deleted the add-data-stores-class-to-questionnaire-store branch November 14, 2023 15:30
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.

6 participants