-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Fixes #10537] Improve rules creation using GeoFence batch #10538
Conversation
@etj can you please fix the flake8 issues so we can check if the tests works? |
68952c2
to
80afd5d
Compare
80afd5d
to
cf8fc09
Compare
There's a test failing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the test failure and the comments from @mattiagiupponi the functional tests are ok.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #10538 +/- ##
==========================================
- Coverage 62.14% 62.11% -0.03%
==========================================
Files 827 828 +1
Lines 51133 51141 +8
Branches 6562 6557 -5
==========================================
- Hits 31775 31767 -8
- Misses 17673 17691 +18
+ Partials 1685 1683 -2 |
* [Fixes #10537] Improve rules creation using GeoFence batch * - code improvements accordingly to the PR comments * - code improvements accordingly to the PR comments * - Test fixes Co-authored-by: afabiani <[email protected]> (cherry picked from commit d101ead)
…10567) * [Fixes #10537] Improve rules creation using GeoFence batch * - code improvements accordingly to the PR comments * - code improvements accordingly to the PR comments * - Test fixes Co-authored-by: afabiani <[email protected]> (cherry picked from commit d101ead) Co-authored-by: Emanuele Tajariol <[email protected]>
static_files_folder.startswith(settings.PROJECT_ROOT): | ||
print(f"[Sanity Check] Full Write Access to '{static_files_folder}' ...") | ||
chmod_tree(static_files_folder) | ||
for template_files_folder in template_folders: | ||
if getattr(settings, 'PROJECT_ROOT', None) and \ | ||
template_files_folder.startswith(settings.PROJECT_ROOT): | ||
template_files_folder.startswith(settings.PROJECT_ROOT): | ||
print(f"[Sanity Check] Full Write Access to '{template_files_folder}' ...") | ||
chmod_tree(template_files_folder) | ||
for locale_files_folder in locale_folders: | ||
if getattr(settings, 'PROJECT_ROOT', None) and \ | ||
locale_files_folder.startswith(settings.PROJECT_ROOT): | ||
locale_files_folder.startswith(settings.PROJECT_ROOT): | ||
print(f"[Sanity Check] Full Write Access to '{locale_files_folder}' ...") | ||
chmod_tree(locale_files_folder) | ||
except Exception as exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes should not be in this PR
@@ -128,11 +229,11 @@ def __init__(self, baseurl: str, username: str, pw: str) -> None: | |||
|
|||
def invalidate_cache(self): | |||
r = requests.put( | |||
f'{self.baseurl}rest/geofence/ruleCache/invalidate', | |||
f'{self.baseurl.rstrip("/")}/rest/geofence/ruleCache/invalidate', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change (and next similar ones) was better implemented in the next geofence PR.
It will be replaced
…oNode#10538) (GeoNode#10567) * [Fixes GeoNode#10537] Improve rules creation using GeoFence batch * - code improvements accordingly to the PR comments * - code improvements accordingly to the PR comments * - Test fixes Co-authored-by: afabiani <[email protected]> (cherry picked from commit d101ead) Co-authored-by: Emanuele Tajariol <[email protected]>
…oNode#10538) (GeoNode#10567) * [Fixes GeoNode#10537] Improve rules creation using GeoFence batch * - code improvements accordingly to the PR comments * - code improvements accordingly to the PR comments * - Test fixes Co-authored-by: afabiani <[email protected]> (cherry picked from commit d101ead) Co-authored-by: Emanuele Tajariol <[email protected]>
The creation of the Rules in GeoFence should be as quick as possibile.
In order to improve the performance of rule creation, we can leverage on the use of GeoFence batch.
See whole rationale on #10537.
Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.