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

AB#241073: Import from Kobo: filter project #55

Merged
merged 7 commits into from
Mar 19, 2025

Conversation

sergey-misuk-valor
Copy link
Collaborator

Legal Boilerplate

Look, I get it.
Contributing to HOPE Workspace, I retain all rights, title and interest in and to my contributions, and by keeping
this boilerplate intact I confirm that HOPE Workspace can use, modify, copy, and redistribute my contributions,
under HOPE's choice of terms.

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 76.19048% with 5 lines in your changes missing coverage. Please review.

Project coverage is 91.32%. Comparing base (b0612cf) to head (490820e).
Report is 12 commits behind head on develop.

Files with missing lines Patch % Lines
src/country_workspace/contrib/kobo/forms.py 75.00% 2 Missing and 1 partial ⚠️
src/country_workspace/contrib/kobo/sync.py 80.00% 0 Missing and 1 partial ⚠️
src/country_workspace/workspaces/admin/program.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #55      +/-   ##
===========================================
- Coverage    91.39%   91.32%   -0.07%     
===========================================
  Files          151      151              
  Lines         4310     4323      +13     
  Branches       369      371       +2     
===========================================
+ Hits          3939     3948       +9     
- Misses         277      279       +2     
- Partials        94       96       +2     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -3,12 +3,6 @@

class ImportKoboForm(forms.Form):
batch_name = forms.CharField(required=False, help_text="Label for this batch")
country_code = forms.CharField(
required=False,
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked how it is managed in HOPE? I'm not sure we are relying on country code right now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, but I was told to store country iso code in office and take it from there

Copy link
Member

Choose a reason for hiding this comment

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

not sure about this. Please add a note here about how this will work with Kobo, how we will manage existing forms and what changes are needed in the various systems. HOPE BusinessArea does not represent a country, and it does not have any country attribute. (cc @ntrncic, @domdinicola).

@@ -5,6 +5,7 @@

TENANT_TENANT_MODEL = "country_workspace.Office"
TENANT_HQ = "= HQ ="
TENANT_HQ_COUNTRY = "AFG"
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's this settings for? not sure we need to hardcode AFG anywhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For mandatory country_iso_code in HQ office

Copy link
Member

Choose a reason for hiding this comment

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

this looks like a bad side effect of a wrong decision to use country code in BA

@@ -12,6 +12,7 @@ class Office(BaseModel):
code = models.CharField(max_length=100, blank=True, null=True, db_index=True, unique=True)
slug = models.SlugField(max_length=100, blank=True, null=True, db_index=True, unique=True)
active = models.BooleanField(default=False)
country_iso_code = models.CharField(max_length=3, blank=False, null=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would just do the field not mandatory

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What should client do when it's empty? Fetch all projects?

@domdinicola domdinicola merged commit d8a5c8f into develop Mar 19, 2025
9 of 11 checks passed
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.

5 participants