Skip to content

Run automatic translation on workflow_dispatch #11526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Aug 4, 2022

What it does

Fixes #11525

Instead of running on push (which only really works in our own repo), we instead create a workflow, which we'll manually start before creating a new release.

How to test

After merging this, a new workflow dispatch should be available, which automatically performs the translation update and creates a new PR based on the results. See msujew#7 for an example of how this would look like.

Review checklist

Reminder for reviewers

@msujew msujew added ci issues related to CI / tests localization issues related to localization/internalization/nls labels Aug 4, 2022
@vince-fugnitto
Copy link
Member

@msujew It might not even be possible from forks as the GITHUB_TOKEN only has read permissions for that special case:

https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/

@msujew
Copy link
Member Author

msujew commented Aug 4, 2022

@vince-fugnitto Yeah, I noticed multiple issues already, forks also (unsurprisingly) can't read from our secrets. I'm wondering whether my other idea would be better suited, as it only runs on our repo. The idea was to push to another branch when pushing to master (or merging into it) and merge this one when performing a release.

Anyway, I'm first looking into whether we can force push from Actions to a protected branch, since that would allow us to perform automatic translations after merging and simply amend it to the squashed commit, thereby preserving the history of why translations were added a bit better.

@vince-fugnitto
Copy link
Member

@msujew if we wanted, we can add a workflow_dispatch (so we can manually trigger the CI from the actions page) and do so on release as you mentioned (just need to document it in the release page). We can try to make the CI create pull-request with the updates. I'll leave the final decision up to you however :)

@msujew
Copy link
Member Author

msujew commented Aug 4, 2022

@vince-fugnitto Thanks for the hint! Seems like we also can't push, so automatically creating a PR sounds like the best approach. Works quite well, see msujew#5.

Quick question: Do you have an idea whether there's some Eclipse bot/fake email that's covered by the ECA? I'm using my own for now, but that seems a bit weird to me.

@msujew msujew changed the title Run automatic translation on pull_request Run automatic translation on workflow_dispatch Aug 4, 2022
@msujew msujew force-pushed the msujew/fix-external-translation-updates branch from 10aea73 to 10397ab Compare August 4, 2022 13:29
@msujew msujew marked this pull request as ready for review August 4, 2022 13:30
@vince-fugnitto
Copy link
Member

Quick question: Do you have an idea whether there's some Eclipse bot/fake email that's covered by the ECA? I'm using my own for now, but that seems a bit weird to me.

I'm not aware of any bot account :( Is it possible to use the actor?

@vince-fugnitto
Copy link
Member

@JonasHelming are you aware of any bot account in the foundation (covered by the ECA) that we can use to perform the automatic translation updates?

@msujew
Copy link
Member Author

msujew commented Aug 4, 2022

Is it possible to use the actor?

Unfortunately, github.actor only gives us the user name. However, in theory we should be able to get the email (if set) based on the user name by querying the github API. I'll see what I can do.

Anyway, I've also updated the publishing.md in my last push, this is ready for a review.

@msujew msujew force-pushed the msujew/fix-external-translation-updates branch from 10397ab to fbeec89 Compare August 4, 2022 13:45
@msujew
Copy link
Member Author

msujew commented Aug 4, 2022

@vince-fugnitto Running Github API requests inside of actions is surprisingly easy, the action now will always commit using the email of the user that triggered the workflow.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Glad we can figure out a way to make it generic (authorship) and hopefully it addresses the issues we experienced from forks.

@msujew
Copy link
Member Author

msujew commented Aug 4, 2022

@vince-fugnitto Thanks for the quick review. Please let me know if you find any issues once you run this. Maybe we should run this a day before the release to fix any potential issues?

@msujew msujew merged commit 7b29ac6 into eclipse-theia:master Aug 4, 2022
@vince-fugnitto vince-fugnitto added this to the 1.29.0 milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci issues related to CI / tests localization issues related to localization/internalization/nls
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic translations not available for external contributions
2 participants