You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9b36e4e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(user-sync): prune by field type and decide from stored jsondata
- set list fields to [] and delete single-valued keys on --prune
- read stored jsondata via offline_pages, without an extra request
- decide protected-field removal from the stored jsondata
- a second --prune run no longer proposes the same removal
Copy file name to clipboardExpand all lines: docs/tools/user-sync.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,12 @@ prompt.
30
30
31
31
To also clean up existing items, add `--prune`. Without it, the sync never
32
32
writes `employment_contract_status` and never removes anything. With it,
33
-
`employment_contract_status` on existing items is overwritten with an empty
34
-
value. So are `website` and `organization`, unless `--with-websites` or
35
-
`--with-organizations` enables them. This happens in a second edit of the
36
-
page's jsondata after the store:
33
+
`employment_contract_status` is removed from the stored jsondata of existing
34
+
items. `website` and `organization` are overwritten with an empty list, unless
35
+
`--with-websites` or `--with-organizations` enables them. This happens in a
36
+
second edit of the page's jsondata after the store. The sync decides from the
37
+
stored jsondata, not from the loaded item, which shows the model default for
38
+
`employment_contract_status`. A second `--prune` run therefore changes nothing:
37
39
38
40
```bash
39
41
uv run python examples/user_sync.py --domain your-instance.example.org --prune --dry-run
@@ -62,7 +64,7 @@ only core identity plus email.
62
64
|`--with-organizations`| Also create and link Organization items from ORCID affiliations (opt-in). |
63
65
|`--with-extras`| Enable both websites and organizations. |
64
66
|`--include-blocked`| Do not skip blocked MediaWiki accounts. |
65
-
|`--prune`|Overwrite`employment_contract_status`, and `website` or `organization` when their opt-in flag is not given, on existing items with an empty value, in a second edit of the page's jsondata after the store (default off; a normal run never writes `employment_contract_status` and never removes anything). |
67
+
|`--prune`|Remove`employment_contract_status` from the stored jsondata of existing items, and overwrite `website` or `organization`with an empty list when their opt-in flag is not given, in a second edit of the page's jsondata after the store (default off; a normal run never writes `employment_contract_status` and never removes anything). |
|`email`| Standard: always attempted; missing email is warned, not fatal; never removed. |
98
-
|`website`| Opt-in (`--with-websites`); without that flag, on existing items overwritten with an empty value only with `--prune`, in a second jsondata edit after the store. |
99
-
|`organization`| Opt-in (`--with-organizations`); without that flag, on existing items overwritten with an empty value only with `--prune`, in a second jsondata edit after the store. |
100
-
|`employment_contract_status`| Never written without `--prune`; with `--prune`, overwritten with an empty value on existing items in a second jsondata edit after the store. |
100
+
|`website`| Opt-in (`--with-websites`); without that flag, on existing items overwritten with an empty list only with `--prune`, in a second jsondata edit after the store. |
101
+
|`organization`| Opt-in (`--with-organizations`); without that flag, on existing items overwritten with an empty list only with `--prune`, in a second jsondata edit after the store. |
102
+
|`employment_contract_status`| Never written without `--prune`; with `--prune`, removed from the stored jsondata of existing items in a second jsondata edit after the store. |
0 commit comments