Skip to content
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

No useful output from tx pull #329

Open
brandones opened this issue Sep 1, 2021 · 2 comments
Open

No useful output from tx pull #329

brandones opened this issue Sep 1, 2021 · 2 comments

Comments

@brandones
Copy link

brandones commented Sep 1, 2021

I'm trying to set up a GitHub Action which uses tx pull to update translations. Here is the action:

name: Update translation files from Transifex 

on:
  schedule:
    - cron: '36 0 * * *'
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      TX_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - run: python -m pip install --upgrade pip
      - run: pip install transifex-client
      - run: tx init --force --no-interactive --traceback
      - run: tx pull -a --minimum-perc=1 --traceback --debug
      - uses: EndBug/add-and-commit@v7
        with:
          add: app/js/translations
          message: 'Update translations'

I'm testing it out using Act. I'm seeing the following output for the tx parts:

[Update translation files from Transifex/build] ⭐  Run tx init --force --no-interactive --traceback
[Update translation files from Transifex/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/brandon/Code/pih/openmrs-owa-orderentry/workflow/4] user=
| 
|  _____                    _  __
| |_   _| __ __ _ _ __  ___(_)/ _| _____  __
|   | || '__/ _` | '_ \/ __| | |_ / _ \ \/ /
|   | || | | (_| | | | \__ \ |  _|  __/>  <
|   |_||_|  \__,_|_| |_|___/_|_|  \___/_/\_\
| 
| 
| Welcome to the Transifex Client! Please follow the instructions to
| initialize your project.
| 
| tx INFO: Creating config file...
| tx INFO: No credentials file was found at /root/.transifexrc.
| tx INFO: Created /root/.transifexrc 
| tx INFO: Updating /root/.transifexrc file...
| tx INFO: Using TX_TOKEN environment variable. Credentials won't be saved to .transifexrc.
| tx INFO: Done.
[Update translation files from Transifex/build]   ✅  Success - tx init --force --no-interactive --traceback
[Update translation files from Transifex/build] ⭐  Run tx pull -a --minimum-perc=1 --traceback --debug
[Update translation files from Transifex/build]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /home/brandon/Code/pih/openmrs-owa-orderentry/workflow/5] user=
| tx DEBUG: Path to tx is /home/brandon/Code/pih/openmrs-owa-orderentry.
| tx DEBUG: Config file is /home/brandon/Code/pih/openmrs-owa-orderentry/.tx/config
| tx DEBUG: .transifexrc file is at /root
| tx INFO: Done.
[Update translation files from Transifex/build]   ✅  Success - tx pull -a --minimum-perc=1 --traceback --debug

So tx pull is evidently not actually doing anything, but neither is it offering any information that could be used to debug, even with both --debug and --traceback provided. It's even exiting with status code 0. This leaves me at a total impasse.

@brandones
Copy link
Author

brandones commented Sep 1, 2021

The problem was that tx init was overwriting the already-existing .tx/config file. Of course, tx pull should give some kind of useful output about the configuration in this case.

For the edification of future generations, this is the working workflow configuration:

name: Update translation files from Transifex 

on:
  schedule:
    - cron: '36 0 * * *'
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest

    env:
      TX_TOKEN: ${{ secrets.TRANSIFEX_API_KEY }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
      - run: python -m pip install --upgrade pip
      - run: pip install transifex-client
      - run: tx pull -a --minimum-perc=1 --traceback
      - uses: EndBug/add-and-commit@v7
        with:
          add: app/js/translations
          message: 'Update translations'

@RyanB99
Copy link

RyanB99 commented Sep 1, 2021

Hello,

Glad you figured it out. There is always room for improvement, so we will check out what you said.

However, we are also working on a new version of the TX client, which can be found here... https://github.com/transifex/cli. It is still considered an alpha version, but it is fairly stable, and it also uses the new version of the API (v3).

Let us know if you need anything else!

Regards,
Ryan
Transifex Support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants