diff --git a/.github/workflows/add-TXrequest-to-notify-slack.yml b/.github/workflows/add-TXrequest-to-notify-slack.yml deleted file mode 100644 index ab3c7c25739..00000000000 --- a/.github/workflows/add-TXrequest-to-notify-slack.yml +++ /dev/null @@ -1,61 +0,0 @@ -# This workflow runs when a ticket is created. It checks if the ticket either: -# - title starts with '[TX Request]' -# - label 'translations-request' is present -# and if so, adds the translations-request label, and notifies the #wg-translations -# slack channel - -# Note: The "translations-request" label is NOT auto-applied to all tickets created -# using any `translations-request-*` template, because only those with write access -# can add the label. Instead the template inserts [TX Request] at the beginning. -# So, this automation is shakily governed by hoping users do not remove that phrase. - -name: Notifies slack channel wg-translations about newly created Translation Request tickets - -on: - issues: - types: [opened] - -jobs: - # First parse issue title and add label, if it doesn't have it already bc only - # repo members can add the label, even tho it's defined in the template >:( - add_label: - runs-on: ubuntu-latest - # This is defined on all 2 jobs - so need to change x2 if changing this. - if: ${{ contains(github.event.issue.title, '[TX Request]') && !contains(github.event.issue.labels.*.name, 'translations-request') }} - steps: - - name: apply translations-request label - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: translations-request - - notify: - runs-on: ubuntu-latest - if: ${{ contains(github.event.issue.title, '[TX Request]') || contains(github.event.issue.labels.*.name, 'translations-request') }} - steps: - - name: Generate token - id: generate_token - uses: tibdex/github-app-token@v1 - with: - app_id: ${{ secrets.GRAPHQL_AUTH_APP_ID }} - private_key: ${{ secrets.GRAPHQL_AUTH_APP_PEM }} - - - name: Alert in Slack - id: slack - uses: slackapi/slack-github-action@v1.18.0 - with: - channel-id: C037XDB9KN1 - slack-message: "Incoming Translations request: ${{ github.event.issue.title }}\nAuthor: ${{ github.event.issue.user.login }}\nURL: ${{ github.event.issue.html_url }}" - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }} - - - name: Auto-Reply to Translations Request - env: - URL: ${{ github.event.issue.comments_url }} - GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - run: | - curl \ - -X POST \ - $URL \ - -H "Content-Type: application/json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - --data '{ "body": "Thank you for your report! The Translations WG has been notified and will take a look as soon as they can." }' diff --git a/.github/workflows/add-depr-ticket-to-depr-board.yml b/.github/workflows/add-depr-ticket-to-depr-board.yml deleted file mode 100644 index 250e394abc1..00000000000 --- a/.github/workflows/add-depr-ticket-to-depr-board.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Run the workflow that adds new tickets that are either: -# - labelled "DEPR" -# - title starts with "[DEPR]" -# - body starts with "Proposal Date" (this is the first template field) -# to the org-wide DEPR project board - -name: Add newly created DEPR issues to the DEPR project board - -on: - issues: - types: [opened] - -jobs: - routeissue: - uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master - secrets: - GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }} - GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }} - SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }} diff --git a/.github/workflows/add-remove-label-on-comment.yml b/.github/workflows/add-remove-label-on-comment.yml deleted file mode 100644 index 0f369db7d29..00000000000 --- a/.github/workflows/add-remove-label-on-comment.yml +++ /dev/null @@ -1,20 +0,0 @@ -# This workflow runs when a comment is made on the ticket -# If the comment starts with "label: " it tries to apply -# the label indicated in rest of comment. -# If the comment starts with "remove label: ", it tries -# to remove the indicated label. -# Note: Labels are allowed to have spaces and this script does -# not parse spaces (as often a space is legitimate), so the command -# "label: really long lots of words label" will apply the -# label "really long lots of words label" - -name: Allows for the adding and removing of labels via comment - -on: - issue_comment: - types: [created] - -jobs: - add_remove_labels: - uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master - diff --git a/.github/workflows/automerge-transifex-app-prs.yml b/.github/workflows/automerge-transifex-app-prs.yml deleted file mode 100644 index f368dd54465..00000000000 --- a/.github/workflows/automerge-transifex-app-prs.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Automatically merge pull requests created by the "Transifex Integration" github app -# https://github.com/apps/transifex-integration - -name: Automerge Transifex GH app PRs - -on: - - pull_request - -jobs: - automerge-transifex-app-pr: - runs-on: ubuntu-latest - # Merges the pull request - steps: - - name: clone repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: merge pull request - uses: nick-fields/retry@v2 - id: mergePR - env: - # secrets can't be used in job conditionals, so we set them to env here - TRANSIFEX_APP_ACTOR_NAME: "${{ secrets.TRANSIFEX_APP_ACTOR_NAME }}" - TRANSIFEX_APP_ACTOR_ID: "${{ secrets.TRANSIFEX_APP_ACTOR_ID }}" - # This token requires Write access to the openedx-translations repo - GITHUB_TOKEN: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.number }} - if: "${{ github.actor == env.TRANSIFEX_APP_ACTOR_NAME && github.actor_id == env.TRANSIFEX_APP_ACTOR_ID }}" - with: - retry_wait_seconds: 60 - max_attempts: 5 - timeout_minutes: 15 - retry_on: error - command: | - # Attempt to merge the PR - gh pr merge ${{ github.head_ref }} --rebase --auto - - # The `fromdate | todate` are used merge to validate that `mergedAt` isn't null - # therefore verifying that the pull request was merged successfully. - gh pr view "$PR_NUMBER" --json mergedAt --jq '.mergedAt | fromdate | todate' diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml deleted file mode 100644 index fec11d6c259..00000000000 --- a/.github/workflows/commitlint.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Run commitlint on the commit messages in a pull request. - -name: Lint Commit Messages - -on: - - pull_request - -jobs: - commitlint: - uses: openedx/.github/.github/workflows/commitlint.yml@master diff --git a/.github/workflows/extract-translation-source-files.yml b/.github/workflows/extract-translation-source-files.yml index a1b6866657b..5d7bd8b9250 100644 --- a/.github/workflows/extract-translation-source-files.yml +++ b/.github/workflows/extract-translation-source-files.yml @@ -5,15 +5,9 @@ name: Extract Translation Source Files on: - workflow_dispatch: # by request - inputs: - repo: - description: 'Repository to extract translation source files from (leave blank to run all)' - required: false - type: string - - schedule: - - cron: '0 0 * * *' # every day at midnight + pull_request: + branches: + - "**" jobs: setup-matrix: @@ -142,7 +136,7 @@ jobs: - name: echo branch name id: date run: echo $BRANCH - - name: clone openedx/openedx-translations + - name: clone Zeit-Labs/openedx-translations uses: actions/checkout@v3 # creates the branch where all the translations will be added to @@ -165,7 +159,7 @@ jobs: steps: # Clones the openedx-translations repo - - name: clone openedx/openedx-translations + - name: clone Zeit-Labs/openedx-translations uses: actions/checkout@v3 with: ref: ${{ needs.setup-branch.outputs.branch }} @@ -175,10 +169,11 @@ jobs: run: sudo apt install -y gettext # Clones the repository - - name: clone openedx/${{ matrix.repo }} + - name: clone Zeit-Labs/${{ matrix.repo }} uses: actions/checkout@v3 with: - repository: openedx/${{ matrix.repo }} + repository: Zeit-Labs/${{ matrix.repo }} + ref: shadinaif/FC-0012-OEP-58 path: translations/${{ matrix.repo }} # Sets up Python @@ -258,84 +253,84 @@ jobs: # push changes to branch git push - js-translations: - if: ${{ !cancelled() && fromJson(needs.setup-matrix.outputs.has_js_repos) == true }} - needs: [setup-branch, setup-matrix, python-translations] - strategy: - # using max-parallel to avoid git push/pull issues when running in parallel - max-parallel: 1 - matrix: - # repos missing extract_translations target in makefile: - # * frontend-platform - # * frontend-enterprise? - # * frontend-app-learner-portal-enterprise - # * frontend-build? - # * frontend-app-learner-portal-programs - # * frontend-component-cookie-policy-banner - # * frontend-app-programs-dashboard - # repos with errors running extract_translations - # * frontend-template-application - repo: ${{ fromJson(needs.setup-matrix.outputs.js_repos) }} - runs-on: ubuntu-latest - continue-on-error: true - - steps: - # Clones the openedx-translations repo - - name: clone openedx/openedx-translations - uses: actions/checkout@v3 - with: - ref: ${{ needs.setup-branch.outputs.branch }} - - # Clones the repository - - name: clone openedx/${{ matrix.repo }} - uses: actions/checkout@v3 - with: - repository: openedx/${{ matrix.repo }} - path: translations/${{ matrix.repo }} - - # Sets up node/npm - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - # Extracts the translation source files - - name: extract translation source files - run: | - cd translations/${{ matrix.repo }} - make extract_translations - # git adds only the translation source files, found in src/i18n/transifex_input.json - - name: git add the translation source files - id: add-sources - run: | - # set identity - git config --global user.email "translations-bot@openedx.org" - git config --global user.name "edx-transifex-bot" - # Change directory to translations/${{ matrix.repo }} - cd translations/${{ matrix.repo }} - # remove translations/${{ matrix.repo }}/.git so we don't commit a submodule - rm -rf .git - # find transifex_input.json - TRANSIFEX_JSON_PATH=$(find . -name 'transifex_input.json') - # stage the transifex_input.json file generated by make - git add $TRANSIFEX_JSON_PATH -f -v - # Check the git status of the translation source files - echo "GIT_STATUS=$(git status $TRANSIFEX_JSON_PATH -s | wc -l)" >> $GITHUB_ENV - # Attempts to commit the translation source files if there is a difference - - name: git commit the translation source files - if: "${{ env.GIT_STATUS > 0 }}" - run: | - # commit the changes - git commit -m "chore: add extracted translation source files from ${{ matrix.repo }}" - # push changes to branch - git push +# js-translations: +# if: ${{ !cancelled() && fromJson(needs.setup-matrix.outputs.has_js_repos) == true }} +# needs: [setup-branch, setup-matrix, python-translations] +# strategy: +# # using max-parallel to avoid git push/pull issues when running in parallel +# max-parallel: 1 +# matrix: +# # repos missing extract_translations target in makefile: +# # * frontend-platform +# # * frontend-enterprise? +# # * frontend-app-learner-portal-enterprise +# # * frontend-build? +# # * frontend-app-learner-portal-programs +# # * frontend-component-cookie-policy-banner +# # * frontend-app-programs-dashboard +# # repos with errors running extract_translations +# # * frontend-template-application +# repo: ${{ fromJson(needs.setup-matrix.outputs.js_repos) }} +# runs-on: ubuntu-latest +# continue-on-error: true +# +# steps: +# # Clones the openedx-translations repo +# - name: clone Zeit-Labs/openedx-translations +# uses: actions/checkout@v3 +# with: +# ref: ${{ needs.setup-branch.outputs.branch }} +# +# # Clones the repository +# - name: clone Zeit-Labs/${{ matrix.repo }} +# uses: actions/checkout@v3 +# with: +# repository: Zeit-Labs/${{ matrix.repo }} +# path: translations/${{ matrix.repo }} +# +# # Sets up node/npm +# - name: setup node +# uses: actions/setup-node@v3 +# with: +# node-version: 16 +# +# # Extracts the translation source files +# - name: extract translation source files +# run: | +# cd translations/${{ matrix.repo }} +# make extract_translations +# # git adds only the translation source files, found in src/i18n/transifex_input.json +# - name: git add the translation source files +# id: add-sources +# run: | +# # set identity +# git config --global user.email "translations-bot@openedx.org" +# git config --global user.name "edx-transifex-bot" +# # Change directory to translations/${{ matrix.repo }} +# cd translations/${{ matrix.repo }} +# # remove translations/${{ matrix.repo }}/.git so we don't commit a submodule +# rm -rf .git +# # find transifex_input.json +# TRANSIFEX_JSON_PATH=$(find . -name 'transifex_input.json') +# # stage the transifex_input.json file generated by make +# git add $TRANSIFEX_JSON_PATH -f -v +# # Check the git status of the translation source files +# echo "GIT_STATUS=$(git status $TRANSIFEX_JSON_PATH -s | wc -l)" >> $GITHUB_ENV +# # Attempts to commit the translation source files if there is a difference +# - name: git commit the translation source files +# if: "${{ env.GIT_STATUS > 0 }}" +# run: | +# # commit the changes +# git commit -m "chore: add extracted translation source files from ${{ matrix.repo }}" +# # push changes to branch +# git push # Non-Django, non-JS repositories with a generic extraction interface. This # assumes that a `extract_translations` make target exists and will create # a transifex_input.yaml file in the root of the site. generic-translations: if: ${{ !cancelled() && fromJson(needs.setup-matrix.outputs.has_generic_repos) == true }} - needs: [setup-branch, setup-matrix, js-translations] + needs: [setup-branch, setup-matrix] #, js-translations] strategy: # using max-parallel to avoid git push/pull issues when running in parallel max-parallel: 1 @@ -347,16 +342,16 @@ jobs: steps: # Clones the openedx-translations repo - - name: clone openedx/openedx-translations + - name: clone Zeit-Labs/openedx-translations uses: actions/checkout@v3 with: ref: ${{ needs.setup-branch.outputs.branch }} # Clones the repository - - name: clone openedx/${{ matrix.repository_config.repo }} + - name: clone Zeit-Labs/${{ matrix.repository_config.repo }} uses: actions/checkout@v3 with: - repository: openedx/${{ matrix.repository_config.repo }} + repository: Zeit-Labs/${{ matrix.repository_config.repo }} path: translations/${{ matrix.repository_config.repo }} # Sets up Python @@ -406,11 +401,11 @@ jobs: merge-translations: runs-on: ubuntu-latest - needs: [setup-branch, python-translations, js-translations, generic-translations] + needs: [setup-branch, python-translations, generic-translations] #, js-translations] steps: # Clones the openedx-translations repo on the automated/extract-translation-source-files-# branch - - name: clone openedx/openedx-translations + - name: clone Zeit-Labs/openedx-translations uses: actions/checkout@v3 with: ref: ${{ needs.setup-branch.outputs.branch }} @@ -421,24 +416,24 @@ jobs: id: createPR env: # This token requires Write access to the openedx-translations repo - GITHUB_TOKEN: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} run: | echo "COMMIT_COUNT=$(git rev-list HEAD ^origin/main | wc -l)" >> $GITHUB_ENV - echo "PR_URL=$(gh pr create --title 'chore: add updated translation source files' --body 'This PR is auto-generated by [extract-translation-source-files](https://github.com/openedx/openedx-translations/blob/master/.github/workflows/extract-translation-source-files.yml).')" >> $GITHUB_ENV - - # Merges the pull request - - name: merge pull request - id: mergePR - env: - # This token requires Write access to the openedx-translations repo - GITHUB_TOKEN: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }} - if: "${{ env.COMMIT_COUNT > 0 }}" - run: gh pr merge ${{ env.PR_URL }} --merge --auto - - # Notify that branch did not merge because there were no new commits in the branch - # and delete the branch now that it is unnecessary - - name: notify of empty branch and delete branch - if: (steps.mergePR.outcome == 'skipped') - run: | - echo "The branch was not merged because the branch had 0 commits." - git push origin -d ${{ needs.setup-branch.outputs.branch }} + echo "PR_URL=$(gh pr create -d --title 'chore: add updated translation source files' --body 'This PR is auto-generated by [extract-translation-source-files](https://github.com/Zeit-Labs/openedx-translations/blob/master/.github/workflows/extract-translation-source-files.yml).')" >> $GITHUB_ENV + +# # Merges the pull request +# - name: merge pull request +# id: mergePR +# env: +# # This token requires Write access to the openedx-translations repo +# GITHUB_TOKEN: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }} +# if: "${{ env.COMMIT_COUNT > 0 }}" +# run: gh pr merge ${{ env.PR_URL }} --merge --auto +# +# # Notify that branch did not merge because there were no new commits in the branch +# # and delete the branch now that it is unnecessary +# - name: notify of empty branch and delete branch +# if: (steps.mergePR.outcome == 'skipped') +# run: | +# echo "The branch was not merged because the branch had 0 commits." +# git push origin -d ${{ needs.setup-branch.outputs.branch }} diff --git a/.github/workflows/fix-transifex-resource-names.yml b/.github/workflows/fix-transifex-resource-names.yml deleted file mode 100644 index 13273ea1b5c..00000000000 --- a/.github/workflows/fix-transifex-resource-names.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow runs fix-transifex-resource-names.py nightly - -name: Set the openedx-translations to readable resource names - -on: - workflow_dispatch: # by request - push: # after adding repositories to the openedx-translations repo - branches: [ main ] - paths: - - 'transifex.yml' - - '.github/workflows/extract-translation-source-files.yml' - schedule: # Also run monthly just in case there's a stall slug/name update - - cron: '0 0 1 * *' - -jobs: - python-translations: - runs-on: ubuntu-latest - - steps: - # Clones the openedx-translations repo - - name: clone openedx/openedx-translations - uses: actions/checkout@v3 - - # Sets up Python - - name: setup python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - - # Run the script - - name: Fix transifex automatic resource names - env: - TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }} - run: | - make translations_scripts_requirements - make fix_transifex_resource_names diff --git a/.github/workflows/self-assign-issue.yml b/.github/workflows/self-assign-issue.yml deleted file mode 100644 index 37522fd57b1..00000000000 --- a/.github/workflows/self-assign-issue.yml +++ /dev/null @@ -1,12 +0,0 @@ -# This workflow runs when a comment is made on the ticket -# If the comment starts with "assign me" it assigns the author to the -# ticket (case insensitive) - -name: Assign comment author to ticket if they say "assign me" -on: - issue_comment: - types: [created] - -jobs: - self_assign_by_comment: - uses: openedx/.github/.github/workflows/self-assign-issue.yml@master diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml deleted file mode 100644 index 3e985b05eba..00000000000 --- a/.github/workflows/upgrade-python-requirements.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Upgrade Python Requirements - -on: - schedule: - # https://crontab.guru/#0_0_*_*_1 - # At midnight on Mondays - - cron: "0 0 * * 1" - workflow_dispatch: - inputs: - branch: - description: "Target branch against which to create requirements PR" - required: true - # If copying this template manually, you must provide your default branch name - # in quotes, such as 'master' - default: 'main' - -jobs: - call-upgrade-python-requirements-workflow: - uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master - with: - # If copying manually, also provide your default branch name in quotes here - branch: ${{ github.event.inputs.branch || 'main' }} - # optional parameters below; fill in if you'd like github or email notifications - # user_reviewers: "" - # team_reviewers: "" - # email_address: "" - # send_success_notification: false - secrets: - requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }} - requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }} - edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }} - edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}