Merge pull request #6217 from normanjaeckel/UpdateFormat

Update format
This commit is contained in:
Norman Jäckel 2021-08-31 23:04:30 +02:00 committed by GitHub
commit c2f1d2b4b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 3398 additions and 2841 deletions

View File

@ -0,0 +1,20 @@
---
title: The initial-data.json got updated
assignees: tsiegleauq, ostcar, normanjaeckel, jsangmeister
labels: documentation, OpenSlides4, meta
---
# Changes to `initial-data.json` have just been added to OpenSlides
Please acknowledge the recent changes to `initial-data.json` and update your projects accordingly.
### Current `initial-data.json`
[docker/initial-data.json]({{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/blob/master/docker/initial-data.json)
### Corresponding Commit:
[{{ env.GITHUB_SHA }}]({{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/commit/{{ env.GITHUB_SHA }})
## Affected Projects
### Manage
https://github.com/OpenSlides/openslides-manage-service

View File

@ -0,0 +1,24 @@
---
name: Announce initial-data.json updates
on:
push:
branches:
- master
paths:
- 'docker/initial-data.json'
jobs:
announce-update:
name: 'Announce updates to initial-data.json'
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Create Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/announcement_templates/updates-to-initial-data.md

View File

@ -3,8 +3,7 @@ name: Announce model updates
on: on:
push: push:
branches: branches:
- openslides4-dev - master
# - master
paths: paths:
- 'docs/models.yml' - 'docs/models.yml'
@ -22,4 +21,4 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
filename: .github/announcement_templates/updates-to-models.md filename: .github/announcement_templates/updates-to-models.md

View File

@ -3,8 +3,7 @@ name: Announce permission updates
on: on:
push: push:
branches: branches:
- openslides4-dev - master
# - master
paths: paths:
- 'docs/permission.yml' - 'docs/permission.yml'
@ -22,4 +21,4 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
filename: .github/announcement_templates/updates-to-permissions.md filename: .github/announcement_templates/updates-to-permissions.md

View File

@ -21,4 +21,4 @@ jobs:
run: md5sum docker/initial-data.json run: md5sum docker/initial-data.json
- name: Validate and protect initial-data.json - name: Validate and protect initial-data.json
run: echo "79e29bd433253fac11899059d59cebe3 docker/initial-data.json" | md5sum -c - run: echo "4ecdf1325e840396f664c675dd6f35ea docker/initial-data.json" | md5sum -c -

View File

@ -1,5 +1,5 @@
--- ---
name: Validate models.yml and example data name: Validate models.yml, initial-data.json and example-data.json
on: [push, pull_request] on: [push, pull_request]
env: env:
PYTHON_VERSION: 3.9.6 PYTHON_VERSION: 3.9.6
@ -50,9 +50,35 @@ jobs:
- name: Validate example-data.json - name: Validate example-data.json
run: python openslides-backend/cli/check_json.py docs/example-data.json run: python openslides-backend/cli/check_json.py docs/example-data.json
validate-initial-data-1:
name: Validate initial-data.json without migration check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
validate-initial-data: - name: Checkout backend submodule
name: Validate initial-data.json run: git submodule update --init openslides-backend/
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install requirements
run: pip install -U -r openslides-backend/cli/requirements.txt
- name: set pythonpath
run: echo "PYTHONPATH=openslides-backend" >> $GITHUB_ENV
- name: generate models.py for next step
run: python openslides-backend/cli/generate_models.py docs/models.yml
- name: Validate example-data.json
run: python openslides-backend/cli/check_json.py docker/initial-data.json
validate-initial-data-2:
name: Validate initial-data.json with migration check
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code - name: Check out code
@ -87,23 +113,23 @@ jobs:
- name: Wait for action service # The datastore is started, too - name: Wait for action service # The datastore is started, too
working-directory: .github/initial-data-migrations/ working-directory: .github/initial-data-migrations/
run: docker-compose exec -T backend ./wait.sh backend 9002 run: docker-compose exec -T backend ./wait.sh backend 9002
- name: Inject initial data into the datastore - name: Inject initial data into the datastore
working-directory: .github/initial-data-migrations/ working-directory: .github/initial-data-migrations/
run: docker-compose exec -T writer bash -c "source export-database-variables.sh; echo '$(cat ../../docker/initial-data.json)' > /data.json; export DATASTORE_INITIAL_DATA_FILE=/data.json; python cli/create_initial_data.py" run: docker-compose exec -T writer bash -c "source export-database-variables.sh; echo '$(cat ../../docker/initial-data.json)' > /data.json; export DATASTORE_INITIAL_DATA_FILE=/data.json; python cli/create_initial_data.py"
- name: Export unmigrated data from the datastore #- name: Export unmigrated data from the datastore
run: "curl --header 'Content-Type: application/json' -d '{}' http://localhost:9010/internal/datastore/reader/get_everything 2> /dev/null | python3 dev-commands/strip-meta-fields.py > export.json" # run: "curl --header 'Content-Type: application/json' -d '{}' http://localhost:9010/internal/datastore/reader/get_everything 2> /dev/null | python3 dev-commands/strip-meta-fields.py > export.json"
- name: Validate initial-data.json. It must fail since it is unmigrated #- name: Validate initial-data.json. It must fail since it is unmigrated
run: if python openslides-backend/cli/check_json.py --partial export.json > /dev/null; then false; else true; fi # run: if python openslides-backend/cli/check_json.py --partial export.json > /dev/null; then false; else true; fi
- name: Migrate - name: Migrate (but there should be nothing to do)
working-directory: .github/initial-data-migrations/ working-directory: .github/initial-data-migrations/
run: docker-compose exec -T backend bash -c "source ./entrypoint.sh; cd migrations; python migrate.py finalize" run: docker-compose exec -T backend bash -c "source ./entrypoint.sh; cd migrations; python migrate.py finalize"
- name: Export migrated data from the datastore - name: Export migrated data from the datastore
run: "curl --header 'Content-Type: application/json' -d '{}' http://localhost:9010/internal/datastore/reader/get_everything 2> /dev/null | python3 dev-commands/strip-meta-fields.py > export.json" run: "curl --header 'Content-Type: application/json' -d '{}' http://localhost:9010/internal/datastore/reader/get_everything 2> /dev/null | python3 dev-commands/strip-meta-fields.py > export.json"
- name: Validate initial-data.json - name: Validate exported initial-data.json
run: python openslides-backend/cli/check_json.py --partial export.json run: python openslides-backend/cli/check_json.py --partial export.json

View File

@ -6,6 +6,7 @@ OpenSlides is a free, web based presentation and assembly system for
managing and projecting agenda, motions and elections of an assembly. See managing and projecting agenda, motions and elections of an assembly. See
https://openslides.com for more information. https://openslides.com for more information.
## Using OpenSlides productively ## Using OpenSlides productively
__OpenSlides 4 (this) is currently under heavy development!__ __OpenSlides 4 (this) is currently under heavy development!__
@ -13,7 +14,6 @@ __OpenSlides 4 (this) is currently under heavy development!__
If you are just looking to use OpenSlides in a productive manner, please refer If you are just looking to use OpenSlides in a productive manner, please refer
to the [OpenSlides 3.4 (stable)](https://github.com/OpenSlides/OpenSlides/tree/stable/3.4.x) to the [OpenSlides 3.4 (stable)](https://github.com/OpenSlides/OpenSlides/tree/stable/3.4.x)
__Everything else in this document is irrelevant for you__
## Installation ## Installation
@ -24,11 +24,21 @@ Compose](https://docs.docker.com/compose/install/).
### Setup OpenSlides ### Setup OpenSlides
For a productive setup of OpenSlides follow the instructions outlined in the [OpenSlides-manage-service](https://github.com/OpenSlides/openslides-manage-service) For a productive setup of OpenSlides get the [OpenSlides manage
tool](https://github.com/OpenSlides/openslides-manage-service/releases/tag/latest)
from GitHub and make it executable. E. g. run:
$ wget https://github.com/OpenSlides/openslides-manage-service/releases/download/latest/openslides
$ chmod +x openslides
Then follow the instructions outlined in the [OpenSlides Manage
Service](https://github.com/OpenSlides/openslides-manage-service).
## Development ## Development
For further information about developing OpenSlides, refer to [the development readme](DEVELOPMENT.md) For further information about developing OpenSlides, refer to [the development
readme](DEVELOPMENT.md).
### Architecture of OpenSlides 4 ### Architecture of OpenSlides 4
@ -36,7 +46,9 @@ For further information about developing OpenSlides, refer to [the development r
Read more about our [concept of OpenSlides 4.0](https://github.com/OpenSlides/OpenSlides/wiki/DE%3AKonzept-OpenSlides-4). Read more about our [concept of OpenSlides 4.0](https://github.com/OpenSlides/OpenSlides/wiki/DE%3AKonzept-OpenSlides-4).
The technical documentation about the internals, requests and functionality can be found [in the wiki](https://github.com/OpenSlides/OpenSlides/wiki/DE%3AKonzept-OpenSlides-4). The technical documentation about the internals, requests and functionality can
be found [in the wiki](https://github.com/OpenSlides/OpenSlides/wiki/DE%3AKonzept-OpenSlides-4).
## License and authors ## License and authors

View File

@ -4,9 +4,9 @@ import json
data = sys.stdin.read() data = sys.stdin.read()
json_data = json.loads(data) json_data = json.loads(data)
for collection, models in json_data.items(): for collection, models in json_data.items():
for model in models: for model in models.values():
for field in list(model.keys()): for field in list(model.keys()):
if field.startswith("meta_"): if field.startswith("meta_"):
del model[field] del model[field]
sys.stdout.write(json.dumps(json_data, separators=(',', ':'))) sys.stdout.write(json.dumps(json_data, separators=(',', ':')))

View File

@ -1,7 +1,7 @@
{ {
"_migration_index": 1, "_migration_index": 3,
"organization": [ "organization": {
{ "1": {
"id": 1, "id": 1,
"name": "[Your organization]", "name": "[Your organization]",
"description": "", "description": "",
@ -11,13 +11,19 @@
"theme": "openslides-default-light-theme", "theme": "openslides-default-light-theme",
"reset_password_verbose_errors": false, "reset_password_verbose_errors": false,
"enable_electronic_voting": false, "enable_electronic_voting": false,
"committee_ids": [1], "limit_of_meetings": 0,
"committee_ids": [
1
],
"active_meeting_ids": [
1
],
"resource_ids": [], "resource_ids": [],
"organization_tag_ids": [] "organization_tag_ids": []
} }
], },
"user": [ "user": {
{ "1": {
"id": 1, "id": 1,
"username": "superadmin", "username": "superadmin",
"title": "", "title": "",
@ -59,11 +65,11 @@
"vote_delegations_$_from_ids": [], "vote_delegations_$_from_ids": [],
"meeting_ids": [] "meeting_ids": []
} }
], },
"resource": [], "resource": {},
"organization_tag": [], "organization_tag": {},
"committee": [ "committee": {
{ "1": {
"id": 1, "id": 1,
"name": "Default committee", "name": "Default committee",
"description": "", "description": "",
@ -78,13 +84,14 @@
"organization_tag_ids": [], "organization_tag_ids": [],
"organization_id": 1 "organization_id": 1
} }
], },
"meeting": [ "meeting": {
{ "1": {
"id": 1, "id": 1,
"welcome_title": "Welcome to OpenSlides", "welcome_title": "Welcome to OpenSlides",
"welcome_text": "[Space for your welcome text]", "welcome_text": "[Space for your welcome text]",
"name": "Default meeting", "name": "Default meeting",
"is_active_in_organization_id": 1,
"description": "", "description": "",
"location": "", "location": "",
"start_time": 0, "start_time": 0,
@ -305,9 +312,9 @@
"default_group_id": 1, "default_group_id": 1,
"admin_group_id": 2 "admin_group_id": 2
} }
], },
"group": [ "group": {
{ "1": {
"id": 1, "id": 1,
"name": "Default", "name": "Default",
"permissions": [ "permissions": [
@ -337,7 +344,7 @@
"used_as_poll_default_id": null, "used_as_poll_default_id": null,
"meeting_id": 1 "meeting_id": 1
}, },
{ "2": {
"id": 2, "id": 2,
"name": "Admin", "name": "Admin",
"permissions": [], "permissions": [],
@ -356,7 +363,7 @@
"used_as_poll_default_id": null, "used_as_poll_default_id": null,
"meeting_id": 1 "meeting_id": 1
}, },
{ "3": {
"id": 3, "id": 3,
"name": "Delegates", "name": "Delegates",
"permissions": [ "permissions": [
@ -392,7 +399,7 @@
"used_as_poll_default_id": 1, "used_as_poll_default_id": 1,
"meeting_id": 1 "meeting_id": 1
}, },
{ "4": {
"id": 4, "id": 4,
"name": "Staff", "name": "Staff",
"permissions": [ "permissions": [
@ -440,22 +447,22 @@
"used_as_poll_default_id": null, "used_as_poll_default_id": null,
"meeting_id": 1 "meeting_id": 1
} }
], },
"personal_note": [], "personal_note": {},
"tag": [], "tag": {},
"agenda_item": [], "agenda_item": {},
"list_of_speakers": [], "list_of_speakers": {},
"speaker": [], "speaker": {},
"topic": [], "topic": {},
"motion": [], "motion": {},
"motion_submitter": [], "motion_submitter": {},
"motion_comment": [], "motion_comment": {},
"motion_comment_section": [], "motion_comment_section": {},
"motion_category": [], "motion_category": {},
"motion_block": [], "motion_block": {},
"motion_change_recommendation": [], "motion_change_recommendation": {},
"motion_state": [ "motion_state": {
{ "1": {
"id": 1, "id": 1,
"name": "submitted", "name": "submitted",
"recommendation_label": null, "recommendation_label": null,
@ -480,7 +487,7 @@
"first_state_of_workflow_id": 1, "first_state_of_workflow_id": 1,
"meeting_id": 1 "meeting_id": 1
}, },
{ "2": {
"id": 2, "id": 2,
"name": "accepted", "name": "accepted",
"recommendation_label": "Acceptance", "recommendation_label": "Acceptance",
@ -503,7 +510,7 @@
"first_state_of_workflow_id": null, "first_state_of_workflow_id": null,
"meeting_id": 1 "meeting_id": 1
}, },
{ "3": {
"id": 3, "id": 3,
"name": "rejected", "name": "rejected",
"recommendation_label": "Rejection", "recommendation_label": "Rejection",
@ -526,7 +533,7 @@
"first_state_of_workflow_id": null, "first_state_of_workflow_id": null,
"meeting_id": 1 "meeting_id": 1
}, },
{ "4": {
"id": 4, "id": 4,
"name": "not decided", "name": "not decided",
"recommendation_label": "No decision", "recommendation_label": "No decision",
@ -549,9 +556,9 @@
"first_state_of_workflow_id": null, "first_state_of_workflow_id": null,
"meeting_id": 1 "meeting_id": 1
} }
], },
"motion_workflow": [ "motion_workflow": {
{ "1": {
"id": 1, "id": 1,
"name": "Simple Workflow", "name": "Simple Workflow",
"state_ids": [ "state_ids": [
@ -566,16 +573,16 @@
"default_statute_amendment_workflow_meeting_id": 1, "default_statute_amendment_workflow_meeting_id": 1,
"meeting_id": 1 "meeting_id": 1
} }
], },
"motion_statute_paragraph": [], "motion_statute_paragraph": {},
"poll": [], "poll": {},
"option": [], "option": {},
"vote": [], "vote": {},
"assignment": [], "assignment": {},
"assignment_candidate": [], "assignment_candidate": {},
"mediafile": [], "mediafile": {},
"projector": [ "projector": {
{ "1": {
"id": 1, "id": 1,
"name": "Default projector", "name": "Default projector",
"scale": 0, "scale": 0,
@ -632,11 +639,11 @@
"used_as_default_$poll_in_meeting_id": 1, "used_as_default_$poll_in_meeting_id": 1,
"meeting_id": 1 "meeting_id": 1
} }
], },
"projection": [], "projection": {},
"projector_message": [], "projector_message": {},
"projector_countdown": [ "projector_countdown": {
{ "1": {
"id": 1, "id": 1,
"title": "List of speaker countdown", "title": "List of speaker countdown",
"description": "", "description": "",
@ -648,7 +655,7 @@
"used_as_poll_countdown_meeting_id": null, "used_as_poll_countdown_meeting_id": null,
"meeting_id": 1 "meeting_id": 1
}, },
{ "2": {
"id": 2, "id": 2,
"title": "Voting countdown", "title": "Voting countdown",
"description": "", "description": "",
@ -660,6 +667,6 @@
"used_as_poll_countdown_meeting_id": 1, "used_as_poll_countdown_meeting_id": 1,
"meeting_id": 1 "meeting_id": 1
} }
], },
"chat_group": [] "chat_group": {}
} }

View File

@ -1,9 +1,11 @@
#!/bin/bash #!/bin/bash
# This script sets password of user 1 (superadmin) to superadmin. You may also use the manage tool for this work.
set -e set -e
# hash the new password # Hash the new password
response=$(docker-compose exec auth curl --header "Content-Type: application/json" -d '{"toHash": "admin"}' http://localhost:9004/internal/auth/hash) response=$(docker-compose exec auth curl --header "Content-Type: application/json" -d '{"toHash": "superadmin"}' http://localhost:9004/internal/auth/hash)
hash=$(jq .hash <<< $response) hash=$(jq .hash <<< $response)
# Set user/1/password to $hash # Set user/1/password to $hash

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit 367525f5d4312d6d300c23962f5b93de08afad6c Subproject commit 93cf85bc96a01da5291928531167ed43384d0960

@ -1 +1 @@
Subproject commit 25233066f233eb00f53f8cc9d75546e0dfd6eebf Subproject commit 365ceb5b2431a3b0b976a237a9d779e949bcc095