Skip to content

Conversation

@adrienne-deriv
Copy link
Contributor

@adrienne-deriv adrienne-deriv commented Jul 28, 2023

Changes:

Please provide a summary of the change.

  • Added automation to automatically download new translations and create/update the translations pull request when a target translation file in Crowdin has been fully approved
  • Added automation to upload new sources to Crowdin when commits are merged to master branch
  • Added Slack messages to be sent to translations team with the test link and app ID when the translations pull request is created/updated

Screenshots:

Screenshot 2023-07-28 at 1 04 54 PM

Please provide some screenshots of the change.

@vercel
Copy link

vercel bot commented Jul 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Aug 15, 2023 9:36am

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/9487](https://github.com/binary-com/deriv-app/pull/9487)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-adrienne-deriv-feq-453-translations-a-525215.binary.sx?qa_server=red.binaryws.com&app_id=32193
    - **Original**: https://deriv-app-git-fork-adrienne-deriv-feq-453-translations-a-525215.binary.sx
- **App ID**: `32193`

@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2023

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 21
🟧 Accessibility 75
🟢 Best practices 92
🟧 SEO 85
🟢 PWA 90

Lighthouse ran with https://deriv-app-git-fork-adrienne-deriv-feq-453-translations-a-525215.binary.sx/

@coveralls
Copy link

coveralls commented Jul 28, 2023

Coverage Status

coverage: 10.018%. remained the same when pulling f1b6826 on adrienne-deriv:feq-453/translations-automation-webhook into ea0d9cc on binary-com:master.

id: cache_npm
uses: actions/cache@v3
with:
key: translations-build-${{ hashFiles('**/package-lock.json') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caching the dependencies will speed up the workflow everytime the webhook event triggers (from 6.5 minutes to 1.5 minutes):
Screenshot 2023-07-28 at 12 55 49 PM

# - We download the latest translation files from Crowdin, if there are new files, we create a PR.
- name: Generate and push to Crowdin
run: |
branch_name="deriv_app_translations_2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We create a separate branch deriv_app_translations_2 to test out the workflow first without conflicting the current translations workflow push_and_pull_crowdin_translations.yml

content+=":link: *Test Link*: ${{ steps.vercel_preview_url.outputs.vercel_preview_url }}\n"
content+=":id: *App ID*: ${{ steps.generate_app_id.outputs.app_id }}"
curl -X POST -H 'Content-type: application/json' --data "{\"text\": \"$content\" }" ${{ secrets.SLACK_TRANSLATIONS_TEAM_WEBHOOK }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message to retrieve the test link can only be generated under the issue_comment edited event, the repository_dispatch event does not contain the context for retrieving the test links

Copy link
Contributor Author

@adrienne-deriv adrienne-deriv Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-28 at 1 54 46 PM

content+=":flag-${{ github.event.client_payload.targetLanguage.id }}: *Updated language*: $updated_language\n"
content+=":paperclip: *Pull Request*: $pull_request\n"
content+="_Paimon will soon post the generated test link for the pull request if its successful, hold on tight!_"
curl -X POST -H 'Content-type: application/json' --data "{\"text\": \"$content\" }" ${{ secrets.SLACK_TRANSLATIONS_TEAM_WEBHOOK }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-07-28 at 1 48 27 PM

Comment on lines 4 to 9
actions: write
checks: write
contents: write
deployments: write
pull-requests: write
statuses: write
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need all these permissions? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nopee, I'll remove the unnecessary ones

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.5% 2.5% Duplication

@github-actions
Copy link
Contributor

Generating Lighthouse report...

@github-actions
Copy link
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Oct 15, 2023
@github-actions
Copy link
Contributor

This PR was closed because it has been stalled for 5 days with no activity. Please reopen it if needed.

@github-actions github-actions bot closed this Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants