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

Sync remote resources in groups edit #104

Merged
merged 79 commits into from
Oct 5, 2018
Merged
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8408d61
add remote resources from the groups view
davidcaron Sep 7, 2018
eb889b5
default service_url bug
davidcaron Sep 7, 2018
446ca7e
groups view: add flag + button to remove a resource not on remote server
davidcaron Sep 7, 2018
6106f24
add warning when there was an error fetching the data from remote server
davidcaron Sep 7, 2018
487de88
Clarify how to implement a new service by using an abstract class
davidcaron Sep 10, 2018
47149b0
Implement Geoserver
davidcaron Sep 10, 2018
890f521
allow integers for resource_names
davidcaron Sep 10, 2018
71c4649
Save remote resources in a separate table.
davidcaron Sep 12, 2018
3b8e1b8
Permission checkboxes post a 'permission' value
davidcaron Sep 12, 2018
4b1df51
Fix post request to edit permissions
davidcaron Sep 13, 2018
11755f5
Display resources sorted alphabetically
davidcaron Sep 13, 2018
e4cdb3e
Cleanup and document
davidcaron Sep 13, 2018
aeea8aa
Display resources sorted in edit service view
davidcaron Sep 13, 2018
fb2c6c2
ui color change
davidcaron Sep 13, 2018
d9b58c7
last sync info and clean all button
davidcaron Sep 13, 2018
49ddb13
also write resource type to database
davidcaron Sep 13, 2018
dad9f72
rename
davidcaron Sep 13, 2018
bd08cae
add resource_type attribute to resources
davidcaron Sep 13, 2018
0b076b1
reformat
davidcaron Sep 13, 2018
23f03d1
basic housekeeping function
davidcaron Sep 13, 2018
a7de1da
use service type instead of service name
davidcaron Sep 13, 2018
20bda2c
show message if sync is not implemented
davidcaron Sep 13, 2018
52a82b7
implement project-api
davidcaron Sep 13, 2018
94889cd
refactoring
davidcaron Sep 14, 2018
3e49695
services are uniquely identified using both their type and resource_name
davidcaron Sep 14, 2018
23c52ba
fix adding a nested resource
davidcaron Sep 14, 2018
f014586
don't add remote_path if it doesn't match remote resource
davidcaron Sep 14, 2018
11c7c16
fix 'Clean' button for a single resource
davidcaron Sep 14, 2018
e239217
fix housekeeping algorithm
davidcaron Sep 14, 2018
00eed72
add logging
davidcaron Sep 14, 2018
5f87d28
cron service to fetch remote resources
davidcaron Sep 17, 2018
05cd07f
Merge branch 'master' into sync-remote-resources-in-groups-edit
davidcaron Sep 17, 2018
c386a32
add note about accessing the database from the UI
davidcaron Sep 17, 2018
162fd2c
Merge remote-tracking branch 'origin/sync-remote-resources-in-groups-…
davidcaron Sep 17, 2018
614bfb4
edit user view: show remote and local resources
davidcaron Sep 17, 2018
0002a9c
edit user view: clean single resource
davidcaron Sep 17, 2018
b9c367b
edit user view: add a resource that is stored in the remote table
davidcaron Sep 17, 2018
4e46a2d
edit user view: display sync information and add 'Sync now' button
davidcaron Sep 17, 2018
caa9f9f
edit user view: add 'Clean all' button
davidcaron Sep 17, 2018
0701285
start cron from makefile
davidcaron Sep 18, 2018
0877e75
mark todos
davidcaron Sep 18, 2018
a5c8033
actually inherit abstract base class _SyncServiceInterface
davidcaron Sep 18, 2018
0f48f02
remove housekeeping script
davidcaron Sep 18, 2018
61ed291
handle single service failure in cron script
davidcaron Sep 18, 2018
f377717
refactoring
davidcaron Sep 18, 2018
3dfad47
ensure there was a successful synchronization done before offering to…
davidcaron Sep 18, 2018
e3e5258
don't modify directly the array given as argument
davidcaron Sep 18, 2018
f5fe862
display error message if resources are 'out of sync'
davidcaron Sep 18, 2018
b64f7a6
fix get_ids_to_clean
davidcaron Sep 18, 2018
5b22b29
identify resource by last id term instead of by name
davidcaron Sep 21, 2018
de84197
setup cron to use docker and docker-compose environment variables
davidcaron Sep 21, 2018
5570b5a
load env files before running cron job
davidcaron Sep 21, 2018
2936d34
don't flag a resource as absent from remote server if it's deeper...
davidcaron Sep 21, 2018
02d37d3
add max_depth property and simplify interface
davidcaron Sep 21, 2018
344ace6
Only push remote resource id to UI.
davidcaron Sep 24, 2018
bd30ee1
ignore generated docs + single service api
fmigneault Sep 27, 2018
e32719a
alembic upgrade db service types
fmigneault Sep 27, 2018
ef7d596
fix empty strings in mako templates
davidcaron Sep 28, 2018
be920d4
iteritems -> items
davidcaron Sep 28, 2018
92fd215
adjust api providers
fmigneault Sep 28, 2018
f52ffb0
identify a service by its id instead of its name and type
davidcaron Sep 28, 2018
3f71d52
get services sooner so that the cur_svc_type is not "default"
davidcaron Sep 28, 2018
ea05900
ui syntax
davidcaron Sep 28, 2018
73580a9
related to #107, prepare for new table column
davidcaron Sep 28, 2018
4c79982
Merge branch 'master' of https://github.com/ouranosinc/magpie into sy…
davidcaron Sep 28, 2018
6e799e1
update 'api' in db + add sync_type
fmigneault Sep 28, 2018
1f68d5a
remove init that messes up import alembic in magpie
fmigneault Sep 28, 2018
1b2ae70
Merge remote-tracking branch 'origin/service-api-ponctual-permissions…
davidcaron Oct 1, 2018
70117d6
fix migrations
davidcaron Oct 1, 2018
0a07acd
[api change] add service_sync_type to services
davidcaron Oct 1, 2018
19ff48f
edit user and edit group views handle multiple services of same type
davidcaron Oct 1, 2018
f881f44
fix register_services function to be nice with migrations and ...
davidcaron Oct 1, 2018
f60344a
Revert: these files shouldn't have been commited
davidcaron Oct 1, 2018
7e5bc28
add sync_type to providers
davidcaron Oct 1, 2018
8023f4c
don't crash when sync_type is absent from providers.cfg
davidcaron Oct 1, 2018
f93d97a
fix update sync_type when force updating providers
davidcaron Oct 2, 2018
06ba6b0
let sync_type be None when passed to json renderer
davidcaron Oct 2, 2018
33d576b
fix migrations
davidcaron Oct 2, 2018
3bcfa22
fix error message issue
davidcaron Oct 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion magpie/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ def magpie_register_services_with_db_session(services_dict, db_session, push_to_
for svc_name, svc_values in services_dict.items():
svc_new_url = os.path.expandvars(svc_values['url'])
svc_type = svc_values['type']
svc_sync_type = svc_values['sync_type']

svc_sync_type = svc_values.get('sync_type', svc_values['title'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe instead of 'title', let's default to None or other value reflecting not-implemented?

if force_update and svc_name in existing_services_names:
svc = models.Service.by_service_name(svc_name, db_session=db_session)
if svc.url == svc_new_url:
Expand Down