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

Added knex repositories #20239

Closed
wants to merge 20 commits into from
Closed

Added knex repositories #20239

wants to merge 20 commits into from

Conversation

aileen
Copy link
Member

@aileen aileen commented May 22, 2024

ref MOM-123

  • Added knex repositories for actors and activities to store values in the DB

aileen and others added 3 commits May 22, 2024 13:35
refs https://linear.app/tryghost/issue/MOM-122

The data in ActivityPub is all different shapes - so we are using a JSON column to store it.
We've moved a few key pieces of data to their own columns to make searching easier.
@github-actions github-actions bot added the affects:admin Anything relating to Ghost Admin label May 22, 2024
@aileen aileen removed the affects:admin Anything relating to Ghost Admin label May 22, 2024
peterzimon and others added 10 commits May 22, 2024 07:56
DES-351

There's a frontend validation in Settings that rewrites the Twitter (X)
URL in social accounts to match the format: twitter.com. As of May 17, X
officially changed their domain to x.com so this validation is outdated.

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
DES-355

There's been an orphan in the schedule toast notification and the date
format was non-standard.
DES-194

The tooltip of scheduled posts always showed subscribers even if it was
not sent as a newsletter.
DES-342

A static site title ("The Local Host") was displayed in the newsletter
preview instead of the actual site title. Also, moved over the "Support
independent publishing" button to design tab in newsletter settings.
ref MOM-123

This is 100% a WIP and not ready yet. Many questions need to be answered first before proceeding
ref MOM-123

- Added a create factory to the `activity` entity, so we can return a new `Activity` entity when fetching the data from the db
ref MOM-123

Instead of create a knex timestamp, we take the one that exists on the entity already.
For this, I added a new date validation to the `create` factories, which ensures that the entities always have the correct timestamp
ref MOM-123

- Hook up the knex repositories to be used instead of the in-memory ones
@aileen aileen force-pushed the activitypub-aileen branch 2 times, most recently from a46ae95 to 7bbe364 Compare May 22, 2024 14:34
With the labs flags enabled by default in our e2e tests, some tests where triggering the ActivityPub services (e.g. post publishing). I added a mock util for now to stub out the requests.

In the future, we should add the data fixtures to the tests and include ActivityPub in the e2e test.
MOM-123

Added update functionality when an activity already exists.
Added a `getJSON` method to `activity` and `actor` entity, as well as `Article` object, to ensure we only store in the DB what we need to (no events, or other entity properties)
I'm still not entirely sure about the ID's. I added a small helper function to help exctract the ID from the URL, because creating an ObjectID from the whole URL doesn't work, as it's too long.
@aileen aileen deleted the activitypub-aileen branch June 20, 2024 14:52
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.

3 participants