newrelic / docs-website

Source code for @newrelic docs. We welcome pull requests and questions on our docs!
https://docs.newrelic.com
Other
172 stars 1.24k forks source link

[Machine Translation] Create project_id column in Production Postgres tables #4730

Closed rudouglas closed 2 years ago

rudouglas commented 2 years ago

Background

Follow the instructions in the Readme to set up your environment. This sets up a local docker container for a PGAdmin instance to manipulate the DB.

<!> Please use the https://github.com/newrelic/docs-website/tree/feature/machine-translation feature branch

In order to reduce code duplication and effort, we will be adding a new column called project_id to a couple of existing tables. This is so we don't need separate tables for each type of translation, and can re-use the same scripts with a little tweaking.

Edit Tables

Adding project_id to the following tables is necessary for us to know whether a page needs to be sent to Machine or Human translation project in Smartling, and also identify how it's been translated when we download it.

We can do that in the PGAdmin console via the Query Tool:

⚠️ SPOILER - Click to see image! Screenshot 2021-11-05 at 10 44 39
⚠️ SPOILER - Click to see SQL Code! ```sql ALTER TABLE IF EXISTS public.jobs ADD COLUMN project_id TEXT NOT NULL; ALTER TABLE IF EXISTS public.translations ADD COLUMN project_id TEXT NOT NULL; ```

Edit Resource Creation Code

We will also want to alter the SQL code for the Terraform resource creation in creation_and_cleanup.sql, adding the following to the CREATE TABLE translations() and CREATE TABLE jobs() functions:

⚠️ SPOILER - Click to see Code! - `project_id TEXT NOT NULL`

Testing Scripts

🛑 You can use the MT Project ID for this but only test with a 1 word change, see here

The reason for this is we have a 2 million word limit per year specifically for Machine Translation

Average is about 850 words per document. total is about 1.6 million. For MT it’s a total of 2 million words can be translated over a year. we have approximately 1800 pages x 850 (avg word count per page) = 1.6 million

Acceptance Criteria

note: All Deven team members should be given access to AWS. - @zstix

Useful Links

github-actions[bot] commented 2 years ago

Hi @rudouglas 👋 Thank you for filing an issue! We'll triage your issue and let you know if we have questions, and then route it to the appropriate team so we can get it solved.

moonlight-komorebi commented 2 years ago

tables updated. im going to update documentation as well as part of this ticket (since its not anywhere else 🙈 ).

moonlight-komorebi commented 2 years ago

gonna call this done since the criteria are met & sprint end. documentation is almost ready.