From e649730e67e9bb4f7babf775b5faa403217778bf Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Thu, 11 Apr 2024 16:14:06 +0200 Subject: [PATCH 1/2] Remove broken CI Element step --- .github/workflows/triage-move-labelled.yml | 59 -------- .github/workflows/triage-review-requests.yml | 139 ------------------- changelog.d/1013.bugfix | 1 + 3 files changed, 1 insertion(+), 198 deletions(-) delete mode 100644 .github/workflows/triage-move-labelled.yml delete mode 100644 .github/workflows/triage-review-requests.yml create mode 100644 changelog.d/1013.bugfix diff --git a/.github/workflows/triage-move-labelled.yml b/.github/workflows/triage-move-labelled.yml deleted file mode 100644 index b14355db8..000000000 --- a/.github/workflows/triage-move-labelled.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Move labelled issues to correct boards and columns - -on: - issues: - types: [labeled] - -jobs: - apply_Z-Labs_label: - name: Add Z-Labs label for features behind labs flags - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-Maths') || - contains(github.event.issue.labels.*.name, 'A-Message-Pinning') || - contains(github.event.issue.labels.*.name, 'A-Polls') || - contains(github.event.issue.labels.*.name, 'A-Location-Sharing') || - contains(github.event.issue.labels.*.name, 'A-Message-Bubbles') || - contains(github.event.issue.labels.*.name, 'Z-IA') || - contains(github.event.issue.labels.*.name, 'A-Themes-Custom') || - contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') || - contains(github.event.issue.labels.*.name, 'A-Tags') || - contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') - steps: - - uses: actions/github-script@v5 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['Z-Labs'] - }) - - add_priority_design_issues_to_project: - name: P1 X-Needs-Design to Design project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'X-Needs-Design') && - (contains(github.event.issue.labels.*.name, 'S-Critical') && - (contains(github.event.issue.labels.*.name, 'O-Frequent') || - contains(github.event.issue.labels.*.name, 'O-Occasional')) || - (contains(github.event.issue.labels.*.name, 'S-Major') && - contains(github.event.issue.labels.*.name, 'O-Frequent')) || - contains(github.event.issue.labels.*.name, 'A11y')) - steps: - - uses: actions/add-to-project@main - with: - project-url: https://github.com/orgs/element-hq/projects/18 - github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} - - add_product_issues_to_project: - name: X-Needs-Product to Design project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'X-Needs-Product') - steps: - - uses: actions/add-to-project@main - with: - project-url: https://github.com/orgs/element-hq/projects/28 - github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/workflows/triage-review-requests.yml b/.github/workflows/triage-review-requests.yml deleted file mode 100644 index d5396d48e..000000000 --- a/.github/workflows/triage-review-requests.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: Move pull requests asking for review to the relevant project -on: - pull_request_target: - types: [review_requested] - -jobs: - add_design_pr_to_project: - name: Move PRs asking for design review to the design board - runs-on: ubuntu-latest - steps: - - uses: octokit/graphql-action@v2.x - id: find_team_members - with: - headers: '{"GraphQL-Features": "projects_next_graphql"}' - query: | - query find_team_members($team: String!) { - organization(login: "element-hq") { - team(slug: $team) { - members { - nodes { - login - } - } - } - } - } - team: ${{ env.TEAM }} - env: - TEAM: "design" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - id: any_matching_reviewers - run: | - # Fetch requested reviewers, and people who are on the team - echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json - echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json - jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt - jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt - - # Fetch requested team reviewers, and the name of the team - echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json - jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt - echo '${{ env.TEAM }}' | tee /tmp/team.txt - - # If either a reviewer matches a team member, or a team matches our team, say "true" - if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then - echo "::set-output name=match::true" - elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then - echo "::set-output name=match::true" - else - echo "::set-output name=match::false" - fi - env: - TEAM: "design" - - uses: octokit/graphql-action@v2.x - id: add_to_project - if: steps.any_matching_reviewers.outputs.match == 'true' - with: - headers: '{"GraphQL-Features": "projects_next_graphql"}' - query: | - mutation add_to_project($projectid:ID!, $contentid:ID!) { - addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { - item { - id - } - } - } - projectid: ${{ env.PROJECT_ID }} - contentid: ${{ github.event.pull_request.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc0sUA" - TEAM: "design" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - add_product_pr_to_project: - name: Move PRs asking for product review to the product board - runs-on: ubuntu-latest - steps: - - uses: octokit/graphql-action@v2.x - id: find_team_members - with: - headers: '{"GraphQL-Features": "projects_next_graphql"}' - query: | - query find_team_members($team: String!) { - organization(login: "element-hq") { - team(slug: $team) { - members { - nodes { - login - } - } - } - } - } - team: ${{ env.TEAM }} - env: - TEAM: "product" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - id: any_matching_reviewers - run: | - # Fetch requested reviewers, and people who are on the team - echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json - echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json - jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt - jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt - - # Fetch requested team reviewers, and the name of the team - echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json - jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt - echo '${{ env.TEAM }}' | tee /tmp/team.txt - - # If either a reviewer matches a team member, or a team matches our team, say "true" - if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then - echo "::set-output name=match::true" - elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then - echo "::set-output name=match::true" - else - echo "::set-output name=match::false" - fi - env: - TEAM: "product" - - uses: octokit/graphql-action@v2.x - id: add_to_project - if: steps.any_matching_reviewers.outputs.match == 'true' - with: - headers: '{"GraphQL-Features": "projects_next_graphql"}' - query: | - mutation add_to_project($projectid:ID!, $contentid:ID!) { - addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) { - item { - id - } - } - } - projectid: ${{ env.PROJECT_ID }} - contentid: ${{ github.event.pull_request.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AAg6N" - TEAM: "product" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/changelog.d/1013.bugfix b/changelog.d/1013.bugfix new file mode 100644 index 000000000..2e8932703 --- /dev/null +++ b/changelog.d/1013.bugfix @@ -0,0 +1 @@ +Remove broken CI Element step \ No newline at end of file From 16b510ce8dce781504c6257a88f08ae54246fe6c Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Thu, 11 Apr 2024 16:16:35 +0200 Subject: [PATCH 2/2] Remove Sonar steps because linked to Element --- .github/workflows/sonarcloud.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml deleted file mode 100644 index d902ca136..000000000 --- a/.github/workflows/sonarcloud.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: SonarCloud analysis - -on: - push: - branches: [ "develop" ] - pull_request: - branches: [ "develop" ] - workflow_dispatch: - -permissions: - pull-requests: read # allows SonarCloud to decorate PRs with analysis results - -jobs: - Analysis: - runs-on: ubuntu-latest - - steps: - - name: Analyze with SonarCloud - - # You can pin the exact commit or the version. - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate the token on Sonarcloud.io, add it to the secrets of this repo - with: - # Additional arguments for the sonarcloud scanner - args: - -Dsonar.projectKey=vector-im_element-ios - -Dsonar.organization=new_vector_ltd_organization - -Dsonar.inclusions=RiotSwiftUI/** - # For more info about the parameters, please refer to https://docs.sonarcloud.io/advanced-setup/analysis-parameters/ \ No newline at end of file