Skip to content

add renderings table. Move gateway to walangmeta. Rename some properties…#5

Open
wkelly17 wants to merge 4 commits intodevfrom
wk-glchange
Open

add renderings table. Move gateway to walangmeta. Rename some properties…#5
wkelly17 wants to merge 4 commits intodevfrom
wk-glchange

Conversation

@wkelly17
Copy link
Copy Markdown
Contributor

@wkelly17 wkelly17 commented Mar 6, 2024

Several Things of note in here: .

  1. Changed local dev only to mount psql tools into the container to run migrations so that local matches what's deployed in dev regarding migration history.
  2. Renamed pivot table for languages/gateways - migration 15 90cec3e#diff-703fbd089a4d68217718970ca5071e3c9f176083d661cf5f5abce657b381d29a - I've renamed some old constraint that were getting truncated and changed name of languages_languages pivot table based on
  3. Added some fields related to rendering (see migrations 16,17)
  4. Rewrote the langnames.json view in migration 18 to look at the attached meta table. (which means until we reprocess all the repos, nothing will be marked as a gw)
  5. Added a listener from the reporendered bus events to populate the renderings and rendering-meta tables. These may need some further reworking and shoudl probably be looked at to see if it seems correct. NOTABLY, for this route, because we always replace blobs in place in the rendering pipeline, and this is a listener of those events essentially, I delete all renderigns associated with a project when a repo is rendered fresh. That logic is here - 90cec3e#diff-193ad64d8e5ad7825dd2cfbda8e234ce70a288f75de7f9c1aa1e3a25176cbbf9R51-R53
  6. I edited some of the hasura yaml files to remove camelCase, introduce snake_case, and rename a couple of hasura properties to clearer counterparts.
  7. Updated dependencies for the controller.

If y'all want to look at it locally, I'm fine to meet on it and show what different explorer looks like (the explorer on cloudflare pages below is pointing at dev, we don't have a preview db). Or if you just want to spin it up locally and take a look, I'm fine to help with any of that too.

Outstanding:
@rbnswartz is fixing some pathing issues for the rendered files.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 6, 2024

Deploying languageapi with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8f7c4f5
Status: ✅  Deploy successful!
Preview URL: https://79491075.languageapi.pages.dev
Branch Preview URL: https://wk-glchange.languageapi.pages.dev

View logs

Comment on lines +66 to +88
const doesExist = await checkContentExists(`${namespace}-${id}`);
if (!doesExist) {
context.log(
`${namespace}-${id} is not already in api. Creating new row in table`
);
const newContentRow: z.infer<typeof validators.contentPost> = [
{
namespace: "wacs",
id: `${parsed.User}/${parsed.Repo}`.toLowerCase(),
type: "text",
},
];
const newRowRes = await handleContentPost(newContentRow);
if (newRowRes.status !== 200) {
context.log(
`Failed to create new content row for ${`${parsed.User}/${parsed.Repo}`.toLowerCase()}`
);
throw new Error(
`Failed to create new content row for ${`${parsed.User}/${parsed.Repo}`.toLowerCase()}`
);
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@PurpleGuitar , @danparisd - Here is the logic for creating a content row in the db if it doesn't exist before proceeding to try to adjust add all the blobs/renders of that content

`received a message for ${parsed.Repo} of event type ${parsed.EventType}`
`GIT BUS RECEIVED: received a message for ${parsed.Repo} of event type ${parsed.EventType}`
);
const thatContentRowExists = await checkContentExists(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same logic here since these also have an fk to content and receive bus messages

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

Successfully merging this pull request may close these issues.

2 participants