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

Properly index organization when creating a package #6

Merged
merged 1 commit into from Sep 21, 2022

Conversation

pdelboca
Copy link
Member

This PR address the scenario to update an organization package_count field when a package is created via the UI. To do this we need to detect when package_update action is updating the package's state from draft to active

More Info:

Chaining package_create only covers API or CLI scenarios. (Meaning that we are updating an org package_count when adding a new dataset)

However, while creating a package using the UI package_create contains a draft dataset. This means that the call to reindex the owner_org will not update the package_count attribute since draft datasets are not counted.

The change of the package state from draft to active happens latter in the process when submiting a resource and calling to package_update.

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2022

Codecov Report

Base: 95.50% // Head: 95.52% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (944e35b) compared to base (f9aa623).
Patch coverage: 97.14% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
+ Coverage   95.50%   95.52%   +0.02%     
==========================================
  Files          21       21              
  Lines        1468     1498      +30     
==========================================
+ Hits         1402     1431      +29     
- Misses         66       67       +1     
Impacted Files Coverage Δ
ckanext/sitesearch/logic/chained_action.py 95.45% <93.75%> (-0.51%) ⬇️
ckanext/sitesearch/tests/test_blueprints.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pdelboca pdelboca merged commit c263e5e into main Sep 21, 2022
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.

None yet

3 participants