From 95cb1bf03e116d1875a25d2f1c6dcc6b0179ef9c Mon Sep 17 00:00:00 2001 From: Elblinator Date: Fri, 26 Apr 2024 10:05:58 +0200 Subject: [PATCH 1/5] change restriction_mode from organization_managment_level to B --- models.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models.yml b/models.yml index 3f634c7f..2bebb539 100644 --- a/models.yml +++ b/models.yml @@ -317,7 +317,7 @@ user: - superadmin - can_manage_organization - can_manage_users - restriction_mode: E + restriction_mode: B is_present_in_meeting_ids: type: relation-list to: meeting/present_user_ids From a1c9a7e5fcf3b7c9114f4d542231f8c992de6afb Mon Sep 17 00:00:00 2001 From: Joshua Sangmeister Date: Fri, 26 Apr 2024 11:17:58 +0200 Subject: [PATCH 2/5] Add setting to forbid delegator from voting --- models.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models.yml b/models.yml index 2bebb539..a08043f1 100644 --- a/models.yml +++ b/models.yml @@ -1365,6 +1365,9 @@ meeting: users_forbid_delegator_as_supporter: type: boolean restriction_mode: B + users_forbid_delegator_to_vote: + type: boolean + restriction_mode: B # Assignments assignments_export_title: From d13157526cbca0016149f76db717e0dedbb34f77 Mon Sep 17 00:00:00 2001 From: Adrian Richter Date: Fri, 26 Apr 2024 12:52:42 +0200 Subject: [PATCH 3/5] Add action for cherry-picking staging changes Also extend Update meta actions to work on staging branch. --- .github/workflows/create-pr.yml | 10 +-- .github/workflows/create-prs-for-updates.yml | 1 + .github/workflows/pick-to-staging.yml | 66 ++++++++++++++++++++ 3 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pick-to-staging.yml diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml index c89cb330..3b445d97 100644 --- a/.github/workflows/create-pr.yml +++ b/.github/workflows/create-pr.yml @@ -27,18 +27,20 @@ jobs: - uses: actions/checkout@v4 with: path: current-meta-repository + ref: ${{ github.ref_name }} - uses: actions/checkout@v4 with: - repository: OpenSlides/${{ inputs.repository }} + repository: ${{ github.repository_owner }}/${{ inputs.repository }} path: service-repository + ref: ${{ github.ref_name }} fetch-depth: 0 submodules: true - name: Checkout meta repository commit working-directory: service-repository/.git/modules/openslides-meta/ run: git fetch origin && git checkout ${{ inputs.commit }} - + - name: Update repository files if: inputs.setup-action != '' uses: jenseng/dynamic-uses@v1 @@ -60,8 +62,8 @@ jobs: commit-message: Update meta repository branch: dep/update-meta-repo delete-branch: true - title: Update meta repository - body: "Triggered by commit [${{ inputs.commit }}](https://github.com/OpenSlides/openslides-meta/commit/${{ inputs.commit }})" + title: "Update meta repository (${{ github.ref_name }})" + body: "Triggered by commit [${{ inputs.commit }}](https://github.com/${{ github.repository_owner }}/openslides-meta/commit/${{ inputs.commit }})" reviewers: ${{ inputs.assignee }} assignees: ${{ inputs.assignee }} labels: dependencies diff --git a/.github/workflows/create-prs-for-updates.yml b/.github/workflows/create-prs-for-updates.yml index 493f73c3..47cd2865 100644 --- a/.github/workflows/create-prs-for-updates.yml +++ b/.github/workflows/create-prs-for-updates.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - staging/4* jobs: create-pull-requests: diff --git a/.github/workflows/pick-to-staging.yml b/.github/workflows/pick-to-staging.yml new file mode 100644 index 00000000..076a8764 --- /dev/null +++ b/.github/workflows/pick-to-staging.yml @@ -0,0 +1,66 @@ +name: Cherry pick staging PRs merged into main + +on: + pull_request: + types: + - closed + branches: + - 'main' + + +jobs: + create-pr-for-staging: + if: | + github.event.pull_request.merged == true && + contains(github.event.pull_request.labels.*.name, 'staging') + name: Create PR against staging branch + runs-on: ubuntu-latest + + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 2 + + - name: Fetch and checkout latest staging branch + run: | + branch=$(git ls-remote --heads origin 'staging*' | tail -1 | awk 'gsub(".*refs/heads/","")') + git fetch origin $branch + git checkout $branch + + - name: Set git credentials + run: | + git config --global user.name openslides-automation + git config --global user.email openslides-automation@users.noreply.github.com + + - name: Cherry-pick new commit + id: cherry-pick + run: | + git fetch origin + # -m 1 to also be able to cherry-pick merge commits + git cherry-pick -m 1 ${{ github.sha }} || { + echo "error=1" >> $GITHUB_OUTPUT + git add . + git cherry-pick --continue + } + + - name: Generate access token + uses: tibdex/github-app-token@v2 + id: generate-token + with: + app_id: ${{ secrets.AUTOMATION_APP_ID }} + private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} + + - name: Create or update PR + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ steps.generate-token.outputs.token }} + branch: apply/commit-${{ github.sha }} + delete-branch: true + title: "[Cherry-Pick] ${{ github.event.pull_request.title }}" + body: "Triggered by commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})\n\n${{ steps.cherry-pick.outputs.error && 'There were conflicts during the cherry-pick. These were commited without any resolving. Please resolve them manually and push the result to this branch before merging.' || 'The cherry-pick was successful without any conflicts. You should be able to simply merge this PR.' }}" + reviewers: ${{ github.event.pull_request.user.login }} + assignees: ${{ github.event.pull_request.user.login }} + labels: picked-to-staging + milestone: 4 From d9479e34d78a913b622256b71ca400a6b6278ec8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 23:20:53 +0000 Subject: [PATCH 4/5] Bump black from 24.4.1 to 24.4.2 in /dev Bumps [black](https://github.com/psf/black) from 24.4.1 to 24.4.2. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.4.1...24.4.2) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- dev/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/requirements.txt b/dev/requirements.txt index e969cdfb..6c7621cb 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,5 +1,5 @@ autoflake==2.3.1 -black==24.4.1 +black==24.4.2 flake8==7.0.0 isort==5.13.2 mypy==1.10.0 From f810524f82d70f701d9cd3687b5e849c5ed9ec95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 12:23:02 +0000 Subject: [PATCH 5/5] Bump pytest from 8.1.1 to 8.2.0 in /dev Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dev/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/requirements.txt b/dev/requirements.txt index 6c7621cb..1b2ae9f3 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -3,7 +3,7 @@ black==24.4.2 flake8==7.0.0 isort==5.13.2 mypy==1.10.0 -pytest==8.1.1 +pytest==8.2.0 pyupgrade==3.15.2 pyyaml==6.0.1 simplejson==3.19.2