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
[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures #8113
Conversation
…sts or transaction failures
933d0ba
to
1869a5a
Compare
This pull request introduces 1 alert when merging 1869a5a into d8f70e7 - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## 3.3.x #8113 +/- ##
==========================================
+ Coverage 55.60% 55.64% +0.03%
==========================================
Files 592 592
Lines 42578 42715 +137
Branches 5564 5580 +16
==========================================
+ Hits 23676 23768 +92
- Misses 17503 17543 +40
- Partials 1399 1404 +5 |
@italogsfernandes overall the PR is good and it works as expected. I just added a small commit for an exception on the remote services, not strictly related to this PR. I would ask if it's possible to add few mocked tests for the classes you just introduced. Thanks. |
Ok, thanks @afabiani. I'll be adding the tests. |
…equal to the alternate prefix
…sts or transaction failures (#8113) * [Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures * fix lgtm * - Making sure the name of a remote layer is correct when fetching the rules * [CircleCI] Fix Test Cases * - Fixing a logical issue with layer alternate: the name must not be equal to the alternate prefix * Add tests and minor fixes * [Pep8] Fix flake8 issues Co-authored-by: afabiani <alessio.fabiani@geo-solutions.it> (cherry picked from commit 0b0cd42)
…ase of reque… (#8130) * [3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113) * [Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures * fix lgtm * - Making sure the name of a remote layer is correct when fetching the rules * [CircleCI] Fix Test Cases * - Fixing a logical issue with layer alternate: the name must not be equal to the alternate prefix * Add tests and minor fixes * [Pep8] Fix flake8 issues Co-authored-by: afabiani <alessio.fabiani@geo-solutions.it> (cherry picked from commit 0b0cd42) * [CircleCI] Fix tests Co-authored-by: Ítalo Fernandes <italo@italogsfernandes.com>
…n case of requests or transaction failures (GeoNode#8113)" This reverts commit 0b0cd42.
…n case of requests or transaction failures (GeoNode#8113)" This reverts commit 0b0cd42.
#8134) * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * [CircleCI] Fix tests Co-authored-by: afabiani <alessio.fabiani@geo-solutions.it>
…the selected ones (#8137) * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * [CircleCI] Fix tests * [Fixes #8125] [3.x] Initial upload GeoFence permissions do not match the selected ones * [CircleCI] Fix tests Co-authored-by: Ítalo Fernandes <italo@italogsfernandes.com>
…the selected ones (#8137) * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * [CircleCI] Fix tests * [Fixes #8125] [3.x] Initial upload GeoFence permissions do not match the selected ones * [CircleCI] Fix tests Co-authored-by: Ítalo Fernandes <italo@italogsfernandes.com> (cherry picked from commit e1df8ac) # Conflicts: # geonode/security/models.py # geonode/security/tests.py
…the selected ones (#8137) (#8139) * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * Revert "[3.3.x][Fixes #8112] Dump and restore Geofence rules in case of requests or transaction failures (#8113)" This reverts commit 0b0cd42. * [CircleCI] Fix tests * [Fixes #8125] [3.x] Initial upload GeoFence permissions do not match the selected ones * [CircleCI] Fix tests Co-authored-by: Ítalo Fernandes <italo@italogsfernandes.com> (cherry picked from commit e1df8ac) # Conflicts: # geonode/security/models.py # geonode/security/tests.py
References: #8112
What was done
GeofenceAdapter
andGeofenceLayerRulesUnitOfWork
were created:GeofenceLayerRulesUnitOfWork
the geofence transactions were stacked to be executed at the end (__exit__
).GeofenceLayerRulesUnitOfWork
were used as a context manager.geofence_adapter.rollback()
restore the previous state, if needed.How to test
geonode/security/models.py#L422
,PermissionLevelMixin.set_permissions
).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.