From d7bca0bb675e4d084975c7e30d39167241f61139 Mon Sep 17 00:00:00 2001 From: olivier Date: Wed, 3 May 2023 15:18:59 +0200 Subject: [PATCH 1/2] remove unused workflows --- .github/deactivated_workflows/backport.yml | 30 -- .../deactivated_workflows/build_develop.yml | 114 ------ .github/deactivated_workflows/dockerhub.yaml | 61 --- .../deactivated_workflows/issue_closed.yml | 156 -------- .../pending-reviews.yaml | 74 ---- .../deactivated_workflows/pull_request.yaml | 10 - .github/deactivated_workflows/sonarqube.yml | 15 - .../deactivated_workflows/triage-assigned.yml | 31 -- .../deactivated_workflows/triage-incoming.yml | 15 - .../deactivated_workflows/triage-labelled.yml | 356 ------------------ .../triage-move-review-requests.yml | 139 ------- .../triage-unlabelled.yml | 71 ---- .../upgrade_dependencies.yml | 8 - 13 files changed, 1080 deletions(-) delete mode 100644 .github/deactivated_workflows/backport.yml delete mode 100644 .github/deactivated_workflows/build_develop.yml delete mode 100644 .github/deactivated_workflows/dockerhub.yaml delete mode 100644 .github/deactivated_workflows/issue_closed.yml delete mode 100644 .github/deactivated_workflows/pending-reviews.yaml delete mode 100644 .github/deactivated_workflows/pull_request.yaml delete mode 100644 .github/deactivated_workflows/sonarqube.yml delete mode 100644 .github/deactivated_workflows/triage-assigned.yml delete mode 100644 .github/deactivated_workflows/triage-incoming.yml delete mode 100644 .github/deactivated_workflows/triage-labelled.yml delete mode 100644 .github/deactivated_workflows/triage-move-review-requests.yml delete mode 100644 .github/deactivated_workflows/triage-unlabelled.yml delete mode 100644 .github/deactivated_workflows/upgrade_dependencies.yml diff --git a/.github/deactivated_workflows/backport.yml b/.github/deactivated_workflows/backport.yml deleted file mode 100644 index e10937278..000000000 --- a/.github/deactivated_workflows/backport.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Backport -on: - pull_request_target: - types: - - closed - - labeled - branches: - - develop - -jobs: - backport: - name: Backport - runs-on: ubuntu-latest - # Only react to merged PRs for security reasons. - # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. - if: > - github.event.pull_request.merged - && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport') - ) - ) - steps: - - uses: tibdex/backport@2e217641d82d02ba0603f46b1aeedefb258890ac # v2 - with: - labels_template: "<%= JSON.stringify([...labels, 'X-Release-Blocker']) %>" - # We can't use GITHUB_TOKEN here or CI won't run on the new PR - github_token: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/deactivated_workflows/build_develop.yml b/.github/deactivated_workflows/build_develop.yml deleted file mode 100644 index 998d8d80b..000000000 --- a/.github/deactivated_workflows/build_develop.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Separate to the main build workflow for access to develop -# environment secrets, largely similar to build.yaml. -name: Build and Deploy develop -on: - push: - branches: [develop] - repository_dispatch: - types: [element-web-notify] -concurrency: - group: ${{ github.repository_owner }}-${{ github.workflow }}-${{ github.ref_name }} - cancel-in-progress: true -jobs: - build: - name: "Build & Deploy develop.element.io" - # Only respect triggers from our develop branch, ignore that of forks - if: github.repository == 'vector-im/element-web' - runs-on: ubuntu-latest - environment: develop - env: - R2_BUCKET: "element-web-develop" - R2_URL: ${{ secrets.CF_R2_S3_API }} - R2_PUBLIC_URL: "https://element-web-develop.element.io" - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - cache: "yarn" - - - name: Install Dependencies - run: "./scripts/layered.with.version.sh" - - - name: Build, Package & Upload sourcemaps - run: "./scripts/ci_package.sh" - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - SENTRY_URL: ${{ secrets.SENTRY_URL }} - SENTRY_ORG: element - SENTRY_PROJECT: riot-web - # We only deploy the latest bundles to Cloudflare Pages and use _redirects to fallback to R2 for - # older ones. This redirect means that 'self' is insufficient in the CSP, - # and we have to add the R2 URL. - # Once Cloudflare redirects support proxying mode we will be able to ditch this. - # See Proxying in support table at https://developers.cloudflare.com/pages/platform/redirects - CSP_EXTRA_SOURCE: ${{ env.R2_PUBLIC_URL }} - - - run: mv dist/element-*.tar.gz dist/develop.tar.gz - - - uses: actions/upload-artifact@v3 - with: - name: webapp - path: dist/develop.tar.gz - retention-days: 1 - - - name: Extract webapp - run: | - mkdir _deploy - tar xf dist/develop.tar.gz -C _deploy --strip-components=1 - - - name: Copy config - run: cp element.io/develop/config.json _deploy/config.json - - - name: Populate 404.html - run: echo "404 Not Found" > _deploy/404.html - - - name: Populate _headers - run: cp .github/cfp_headers _deploy/_headers - - # Redirect requests for the develop tarball and the historical bundles to R2 - - name: Populate _redirects - run: | - { - echo "/develop.tar.gz $R2_PUBLIC_URL/develop.tar.gz 301" - for bundle in $(aws s3 ls s3://$R2_BUCKET/bundles/ --endpoint-url $R2_URL --region=auto | awk '{print $2}'); do - echo "/bundles/${bundle}* $R2_PUBLIC_URL/bundles/${bundle}:splat 301" - done - } | tee _deploy/_redirects - env: - AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }} - - - name: Wait for other steps to succeed - uses: t3chguy/wait-on-check-action@05861d3a448898eb33dfce34153bd1ecb9422fb9 # fork - with: - ref: ${{ github.sha }} - running-workflow-name: "Build & Deploy develop.element.io" - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 - check-regexp: ^((?!SonarCloud|SonarQube|issue|board|label).)*$ - - # We keep the latest develop.tar.gz on R2 instead of relying on the github artifact uploaded earlier - # as the expires after 24h and requires auth to download. - # Element Desktop's fetch script uses this tarball to fetch latest develop to build Nightlies. - - name: Deploy to R2 - run: | - aws s3 cp dist/develop.tar.gz s3://$R2_BUCKET/develop.tar.gz --endpoint-url $R2_URL --region=auto - aws s3 cp _deploy/ s3://$R2_BUCKET/ --recursive --endpoint-url $R2_URL --region=auto - env: - AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }} - - - name: Deploy to Cloudflare Pages - id: cfp - uses: cloudflare/pages-action@61eafe73baad0195ab582cb447b2c6e15a0df9ce # v1 - with: - apiToken: ${{ secrets.CF_PAGES_TOKEN }} - accountId: ${{ secrets.CF_PAGES_ACCOUNT_ID }} - projectName: element-web-develop - directory: _deploy - gitHubToken: ${{ secrets.GITHUB_TOKEN }} - - - run: | - echo "Deployed to ${{ steps.cfp.outputs.url }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/deactivated_workflows/dockerhub.yaml b/.github/deactivated_workflows/dockerhub.yaml deleted file mode 100644 index d1804596c..000000000 --- a/.github/deactivated_workflows/dockerhub.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Dockerhub -on: - workflow_dispatch: {} - push: - tags: [v*] - schedule: - # This job can take a while, and we have usage limits, so just publish develop only twice a day - - cron: "0 7/12 * * *" -concurrency: ${{ github.workflow }}-${{ github.ref_name }} -jobs: - buildx: - name: Docker Buildx - runs-on: ubuntu-latest - environment: dockerhub - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # needed for docker-package to be able to calculate the version - - - name: Set up QEMU - uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2 - with: - install: true - - - name: Login to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4 - with: - images: | - vectorim/element-web - tags: | - type=ref,event=branch - type=ref,event=tag - flavor: | - latest=${{ contains(github.ref_name, '-rc.') && 'false' || 'auto' }} - - - name: Build and push - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4 - with: - context: . - push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Update repo description - uses: peter-evans/dockerhub-description@202973a37c8a723405c0c5f0a71b6d99db470dae # v3 - continue-on-error: true - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: vectorim/element-web diff --git a/.github/deactivated_workflows/issue_closed.yml b/.github/deactivated_workflows/issue_closed.yml deleted file mode 100644 index 751b2104b..000000000 --- a/.github/deactivated_workflows/issue_closed.yml +++ /dev/null @@ -1,156 +0,0 @@ -# For duplicate issues, ensure the close type is right (not planned), update it if not -# For all closed (completed) issues, cascade the closure onto any referenced rageshakes -# For all closed (not planned) issues, comment on rageshakes to move them into the canonical issue if one exists -on: - issues: - types: [closed] -jobs: - tidy: - name: Tidy closed issues - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - id: main - with: - # PAT needed as the GITHUB_TOKEN won't be able to see cross-references from other orgs (matrix-org) - github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} - script: | - const variables = { - owner: context.repo.owner, - name: context.repo.repo, - number: context.issue.number, - }; - - const query = `query($owner:String!, $name:String!, $number:Int!) { - repository(owner: $owner, name: $name) { - issue(number: $number) { - stateReason, - timelineItems(first: 100, itemTypes: [MARKED_AS_DUPLICATE_EVENT, UNMARKED_AS_DUPLICATE_EVENT, CROSS_REFERENCED_EVENT]) { - edges { - node { - __typename - ... on MarkedAsDuplicateEvent { - canonical { - ... on Issue { - repository { - nameWithOwner - } - number - } - ... on PullRequest { - repository { - nameWithOwner - } - number - } - } - } - ... on UnmarkedAsDuplicateEvent { - canonical { - ... on Issue { - repository { - nameWithOwner - } - number - } - ... on PullRequest { - repository { - nameWithOwner - } - number - } - } - } - ... on CrossReferencedEvent { - source { - ... on Issue { - repository { - nameWithOwner - } - number - } - ... on PullRequest { - repository { - nameWithOwner - } - number - } - } - } - } - } - } - } - } - }`; - - const result = await github.graphql(query, variables); - const { stateReason, timelineItems: { edges } } = result.repository.issue; - - const RAGESHAKE_OWNER = "matrix-org"; - const RAGESHAKE_REPO = "element-web-rageshakes"; - const rageshakes = new Set(); - const duplicateOf = new Set(); - - console.log("Edges: ", JSON.stringify(edges)); - - for (const { node } of edges) { - switch(node.__typename) { - case "MarkedAsDuplicateEvent": - duplicateOf.add(node.canonical.repository.nameWithOwner + "#" + node.canonical.number); - break; - case "UnmarkedAsDuplicateEvent": - duplicateOf.remove(node.canonical.repository.nameWithOwner + "#" + node.canonical.number); - break; - case "CrossReferencedEvent": - if (node.source.repository.nameWithOwner === (RAGESHAKE_OWNER + "/" + RAGESHAKE_REPO)) { - rageshakes.add(node.source.number); - } - break; - } - } - - console.log("Duplicate of: ", duplicateOf); - console.log("Found rageshakes: ", rageshakes); - - if (duplicateOf.size) { - const body = Array.from(duplicateOf).join("\n"); - - // Comment on all rageshakes to create relationship to the issue this was closed as duplicate of - for (const rageshake of rageshakes) { - github.rest.issues.createComment({ - owner: RAGESHAKE_OWNER, - repo: RAGESHAKE_REPO, - issue_number: rageshake, - body, - }); - } - - // Duplicate was closed with wrong reason, fix it - if (stateReason === "COMPLETED") { - core.setOutput("closeAsNotPlanned", "true"); - } - } else { - // This issue was closed, close all related rageshakes - for (const rageshake of rageshakes) { - github.rest.issues.update({ - owner: RAGESHAKE_OWNER, - repo: RAGESHAKE_REPO, - issue_number: rageshake, - state: "closed", - }); - } - } - - uses: actions/github-script@v6 - name: Close duplicate as Not Planned - if: steps.main.outputs.closeAsNotPlanned - with: - # We do this step separately, and with the default token so as to not re-trigger this workflow when re-closing - script: | - await github.graphql(`mutation($id:ID!) { - closeIssue(input: { issueId:$id, stateReason:NOT_PLANNED }) { - clientMutationId - } - }`, { - id: context.payload.issue.node_id, - }); diff --git a/.github/deactivated_workflows/pending-reviews.yaml b/.github/deactivated_workflows/pending-reviews.yaml deleted file mode 100644 index 82e49f8d3..000000000 --- a/.github/deactivated_workflows/pending-reviews.yaml +++ /dev/null @@ -1,74 +0,0 @@ -name: Pending reviews automation -on: - # We run it on a schedule instead of on pull_request_* events to not create confusing messaging in the PR - schedule: - - cron: "*/10 * * * *" -concurrency: ${{ github.workflow }} -jobs: - bot: - name: Pending reviews bot - runs-on: ubuntu-latest - environment: Matrix - env: - URL: "https://github.com/pulls?q=is%3Apr+is%3Aopen+repo%3Amatrix-org%2Fmatrix-js-sdk+repo%3Amatrix-org%2Fmatrix-react-sdk+repo%3Avector-im%2Felement-web+repo%3Avector-im%2Felement-desktop+review-requested%3A%40me+sort%3Aupdated-desc+" - steps: - - uses: actions/github-script@v6 - env: - HS_URL: ${{ secrets.BETABOT_HS_URL }} - ROOM_ID: ${{ secrets.ROOM_ID }} - TOKEN: ${{ secrets.BETABOT_ACCESS_TOKEN }} - with: - # PAT needed as the GITHUB_TOKEN won't be able to see cross-references from other orgs (matrix-org) - github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} - script: | - const repos = [ - "vector-im/element-desktop", - "vector-im/element-web", - "matrix-org/matrix-react-sdk", - "matrix-org/matrix-js-sdk", - ]; - const teams = [ - "matrix-org/element-web-app-team", - "matrix-org/element-web", - "vector-im/element-web-app-team", - "vector-im/element-web", - ]; - - let issueCount = 0; - for (const team of teams) { - const org = team.split("/", 2)[0]; - const reposInOrg = repos.filter(repo => repo.startsWith(org + "/")); - const { data } = await github.rest.search.issuesAndPullRequests({ - q: `is:pr is:open review:required ${reposInOrg.map(r => `repo:${r}`).join(" ")} team-review-requested:${team}`, - }); - issueCount += data.total_count; - } - - const { HS_URL, ROOM_ID, TOKEN, URL } = process.env; - const apiUrl = `${HS_URL}/_matrix/client/v3/rooms/${ROOM_ID}/state/re.jki.counter/gh_reviews`; - const headers = { - "Content-Type": "application/json", - "Authorization": `Bearer ${TOKEN}`, - }; - const res = await fetch(apiUrl, { - method: "GET", - headers, - }); - - const data = await res.json(); - - if (data.value === issueCount) { - console.log("Pending review count already correct"); - return; - } - - await fetch(apiUrl, { - method: "PUT", - body: JSON.stringify({ - "link": URL, - "severity": "warning", - "title": "Pending reviews", - "value": issueCount - }), - headers, - }); diff --git a/.github/deactivated_workflows/pull_request.yaml b/.github/deactivated_workflows/pull_request.yaml deleted file mode 100644 index 592268d88..000000000 --- a/.github/deactivated_workflows/pull_request.yaml +++ /dev/null @@ -1,10 +0,0 @@ -name: Pull Request -on: - pull_request_target: - types: [opened, edited, labeled, unlabeled, synchronize] -concurrency: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }} -jobs: - action: - uses: matrix-org/matrix-js-sdk/.github/workflows/pull_request.yaml@develop - secrets: - ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/deactivated_workflows/sonarqube.yml b/.github/deactivated_workflows/sonarqube.yml deleted file mode 100644 index b0d0415cf..000000000 --- a/.github/deactivated_workflows/sonarqube.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: SonarQube -on: - workflow_run: - workflows: ["Tests"] - types: - - completed -concurrency: - group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }} - cancel-in-progress: true -jobs: - sonarqube: - name: 🩻 SonarQube - uses: matrix-org/matrix-js-sdk/.github/workflows/sonarcloud.yml@develop - secrets: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/deactivated_workflows/triage-assigned.yml b/.github/deactivated_workflows/triage-assigned.yml deleted file mode 100644 index d2802c2eb..000000000 --- a/.github/deactivated_workflows/triage-assigned.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Move issued assigned to specific team members to their boards - -on: - issues: - types: [assigned] - -jobs: - web-app-team: - runs-on: ubuntu-latest - if: | - contains(github.event.issue.assignees.*.login, 't3chguy') || - contains(github.event.issue.assignees.*.login, 'andybalaam') || - contains(github.event.issue.assignees.*.login, 'justjanne') - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AKjJS" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/deactivated_workflows/triage-incoming.yml b/.github/deactivated_workflows/triage-incoming.yml deleted file mode 100644 index 1d9ed5ebd..000000000 --- a/.github/deactivated_workflows/triage-incoming.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Move new issues into Issue triage board - -on: - issues: - types: [opened] - -jobs: - automate-project-columns: - runs-on: ubuntu-latest - steps: - - uses: alex-page/github-project-automation-plus@7ffb872c64bd809d23563a130a0a97d01dfa8f43 - with: - project: Issue triage - column: Incoming - repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/deactivated_workflows/triage-labelled.yml b/.github/deactivated_workflows/triage-labelled.yml deleted file mode 100644 index 43422efab..000000000 --- a/.github/deactivated_workflows/triage-labelled.yml +++ /dev/null @@ -1,356 +0,0 @@ -name: Move labelled issues to correct projects - -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-Location-Sharing') || - contains(github.event.issue.labels.*.name, 'Z-IA') || - contains(github.event.issue.labels.*.name, 'A-Jump-To-Date ') || - 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-Video-Rooms') || - contains(github.event.issue.labels.*.name, 'A-Message-Starring') || - contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') || - contains(github.event.issue.labels.*.name, 'A-Element-Call') - steps: - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['Z-Labs'] - }) - - apply_Help-Wanted_label: - name: Add "Help Wanted" label to all "good first issue" and Hacktoberfest - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'good first issue') || - contains(github.event.issue.labels.*.name, 'Hacktoberfest') - steps: - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['Help Wanted'] - }) - - move_needs_info_issues: - name: X-Needs-Info issues to Need info column on triage board - runs-on: ubuntu-latest - steps: - - uses: konradpabjan/move-labeled-or-milestoned-issue@190352295fe309fcb113b49193bc81d9aaa9cb01 - with: - action-token: "${{ secrets.ELEMENT_BOT_TOKEN }}" - project-url: "https://github.com/vector-im/element-web/projects/27" - column-name: "Need info" - label-name: "X-Needs-Info" - - 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: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc0sUA" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - add_product_issues: - name: X-Needs-Product to product project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'X-Needs-Product') - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AAg6N" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - Search_issues_to_board: - name: Search issues to project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-New-Search-Experience') - steps: - - uses: octokit/graphql-action@v2.x - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4ADtaO" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - move_voice-message_issues: - name: A-Voice Messages to voice message board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-Voice Messages') - steps: - - uses: octokit/graphql-action@v2.x - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc2KCw" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - move_message_bubbles_issues: - name: A-Message-Bubbles to Message bubbles board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-Message-Bubbles') - steps: - - uses: octokit/graphql-action@v2.x - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc3m-g" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - move_ftue_issues: - name: Z-FTUE issues to the FTUE project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'Z-FTUE') - steps: - - uses: octokit/graphql-action@v2.x - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AAqVx" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - move_WTF_issues: - name: Z-WTF issues to the WTF project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'Z-WTF') - steps: - - uses: octokit/graphql-action@v2.x - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AArk0" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - ps_features1: - name: Add labelled issues to PS features team 1 - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-Polls') || - contains(github.event.issue.labels.*.name, 'A-Location-Sharing') || - (contains(github.event.issue.labels.*.name, 'A-Voice-Messages') && - !contains(github.event.issue.labels.*.name, 'A-Broadcast')) || - (contains(github.event.issue.labels.*.name, 'A-Session-Mgmt') && - contains(github.event.issue.labels.*.name, 'A-User-Settings')) - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AHJKF" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - ps_features2: - name: Add labelled issues to PS features team 2 - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-DM-Start') || - contains(github.event.issue.labels.*.name, 'A-Broadcast') - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AHJKd" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - ps_features3: - name: Add labelled issues to PS features team 3 - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AHJKW" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - voip: - name: Add labelled issues to VoIP project board - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'Team: VoIP') - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4ABMIk" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} - - verticals_feature: - name: Add labelled issues to Verticals Feature project - runs-on: ubuntu-latest - if: > - contains(github.event.issue.labels.*.name, 'Team: Verticals Feature') - steps: - - uses: octokit/graphql-action@v2.x - id: add_to_project - 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.issue.node_id }} - env: - PROJECT_ID: "PVT_kwDOAM0swc4AHJKW" - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} diff --git a/.github/deactivated_workflows/triage-move-review-requests.yml b/.github/deactivated_workflows/triage-move-review-requests.yml deleted file mode 100644 index d47904a57..000000000 --- a/.github/deactivated_workflows/triage-move-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: "vector-im") { - 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 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: "vector-im") { - 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/.github/deactivated_workflows/triage-unlabelled.yml b/.github/deactivated_workflows/triage-unlabelled.yml deleted file mode 100644 index df8f17955..000000000 --- a/.github/deactivated_workflows/triage-unlabelled.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Move unlabelled from needs info columns to triaged - -on: - issues: - types: [unlabeled] - -jobs: - Move_Unabeled_Issue_On_Project_Board: - name: Move no longer X-Needs-Info issues to Triaged - runs-on: ubuntu-latest - if: > - ${{ - !contains(github.event.issue.labels.*.name, 'X-Needs-Info') }} - env: - BOARD_NAME: "Issue triage" - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - ISSUE: ${{ github.event.issue.number }} - steps: - - name: Check if issue is already in "${{ env.BOARD_NAME }}" - run: | - json=$(curl -s -H 'Content-Type: application/json' -H "Authorization: bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"query": "query($issue: Int!, $owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { issue(number: $issue) { projectCards { nodes { project { name } isArchived } } } } } ", "variables" : "{ \"issue\": '${ISSUE}', \"owner\": \"'${OWNER}'\", \"repo\": \"'${REPO}'\" }" }' https://api.github.com/graphql) - if echo $json | jq '.data.repository.issue.projectCards.nodes | length'; then - if [[ $(echo $json | jq '.data.repository.issue.projectCards.nodes[0].project.name') =~ "${BOARD_NAME}" ]]; then - if [[ $(echo $json | jq '.data.repository.issue.projectCards.nodes[0].isArchived') == 'true' ]]; then - echo "Issue is already in Project '$BOARD_NAME', but is archived - skipping workflow"; - echo "SKIP_ACTION=true" >> $GITHUB_ENV - else - echo "Issue is already in Project '$BOARD_NAME', proceeding"; - echo "ALREADY_IN_BOARD=true" >> $GITHUB_ENV - fi - else - echo "Issue is not in project '$BOARD_NAME', cancelling this workflow" - echo "ALREADY_IN_BOARD=false" >> $GITHUB_ENV - fi - fi - - name: Move issue - uses: alex-page/github-project-automation-plus@7ffb872c64bd809d23563a130a0a97d01dfa8f43 - if: ${{ env.ALREADY_IN_BOARD == 'true' && env.SKIP_ACTION != 'true' }} - with: - project: Issue triage - column: Triaged - repo-token: ${{ secrets.ELEMENT_BOT_TOKEN }} - - remove_Z-Labs_label: - name: Remove Z-Labs label when features behind labs flags are removed - 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-Location-Sharing') || - contains(github.event.issue.labels.*.name, 'Z-IA') || - contains(github.event.issue.labels.*.name, 'A-Jump-To-Date') || - 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-Video-Rooms') || - contains(github.event.issue.labels.*.name, 'A-Message-Starring') || - contains(github.event.issue.labels.*.name, 'A-Rich-Text-Editor') || - contains(github.event.issue.labels.*.name, 'A-Element-Call')) && - contains(github.event.issue.labels.*.name, 'Z-Labs') - steps: - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.removeLabel({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: ['Z-Labs'] - }) diff --git a/.github/deactivated_workflows/upgrade_dependencies.yml b/.github/deactivated_workflows/upgrade_dependencies.yml deleted file mode 100644 index 0263ba9ca..000000000 --- a/.github/deactivated_workflows/upgrade_dependencies.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Upgrade Dependencies -on: - workflow_dispatch: {} -jobs: - upgrade: - uses: matrix-org/matrix-js-sdk/.github/workflows/upgrade_dependencies.yml@develop - secrets: - ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} From e604f1fc88897b8e7cb5ecadb0469d3700d0c949 Mon Sep 17 00:00:00 2001 From: olivier Date: Wed, 3 May 2023 15:20:51 +0200 Subject: [PATCH 2/2] update patches path --- patches/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/patches/README.md b/patches/README.md index 4d35725ee..221a15ad7 100644 --- a/patches/README.md +++ b/patches/README.md @@ -13,7 +13,7 @@ Note : if you are making a patch while your local env has yarn links, patch-pack First run the merge command, it takes long if you have multiple patches ``` -bash ./scripts/merge-patches.sh merge +bash ./scripts/tchap/merge-patches.sh merge ``` If some patches are in conflict, a folder is created in patches_temp/ @@ -21,13 +21,13 @@ If some patches are in conflict, a folder is created in patches_temp/ To see the conflicted files run : ``` -bash ./scripts/merge-patches.sh continue /tchap-web-v4/patches_temp/PATCH_NAME +bash ./scripts/tchap/merge-patches.sh continue /tchap-web-v4/patches_temp/PATCH_NAME ``` Fix the conlicts inside the /tchap-web-v4/patches_temp/PATCH_NAME/node_modules/.... After the conflict is solved, run again -bash ./scripts/merge-patches.sh continue /tchap-web-v4/patches_temp/PATCH_NAME +bash ./scripts/tchap/merge-patches.sh continue /tchap-web-v4/patches_temp/PATCH_NAME A notice should be in the log that a new patch has been created in folder : absolute_path>/tchap-web-v4/patches/ @@ -36,7 +36,7 @@ Compare the old patch and the new patch, if it looks ok to you then delete manua NB : merge command can be used with only one patch also ``` -bash ./scripts/merge-patches.sh merge /tchap-web-v4/patches/PATCH_NAME/PATCH_FILE.patch +bash ./scripts/tchap/merge-patches.sh merge /tchap-web-v4/patches/PATCH_NAME/PATCH_FILE.patch ``` ## How to deal with patch conflicts