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

Cull appview v2 down to frontend service #1982

Merged
merged 17 commits into from
Dec 29, 2023
Merged

Cull appview v2 down to frontend service #1982

merged 17 commits into from
Dec 29, 2023

Conversation

devinivy
Copy link
Collaborator

Reduces the appview down to only use the dataplane service, e.g. dropping the direct dependency on postgres. Removes all functionality not related to the appview frontends, i.e. indexing, ingestion, and the daemon. Some indexing functionality has been preserved in src/data-plane/server which is a postgres implementation of the dataplane.

Base automatically changed from bav-v2-hydration to appview-v2 December 21, 2023 20:51
import { AtpAgent } from '@atproto/api'
import { ImageInvalidator } from '../../src/image/invalidator'

describe('fuzzy matcher', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm ripping out automod stuff is definitely going to clash with my work, but hopefully by the time we're landing this branch, the separate automod service is in a good enough spot that it's alright 👌

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In my view we're ripping everything out in this PR to match the end state we want for the appview frontends. It's hard to imagine how automod functionality would remain here in v2, so I think we nix it and just handle the merge conflict in this branch at the next opportunity, even if it might be a little while.

import { Database } from '../src'
import { PrimaryDatabase } from '../src/db'
import { Leader } from '../src/db/leader'
import { Database, PrimaryDatabase } from '../src'

describe('db', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

since this is only used for mocks, you can probably just delete this whole test 🤷‍♂️

Copy link
Collaborator

Choose a reason for hiding this comment

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

actually same with several of these - did-cache, duplicate-records, handle-invalidation, etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sort of torn on this! If the code is still around and is important for correctness of the other tests, maybe it's worth keeping them around in some form. Pretty sure it will remain low cost to maintain. Perhaps they could just be collapsed into a single file and condensed a bit.

"val": "test-label-2",
},
],
"labels": Array [],
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm these were good integration tests that labels were being hydrated correctly - think we could just add these labels directly in the seed scripts?

not a huge deal, but we don't currently have separate tests for label hydration 😬

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems like a good idea! Will take a look at that.

@@ -19,11 +18,16 @@ describe('feedgen proxy view', () => {
beforeAll(async () => {
network = await TestNetwork.create({
dbPostgresSchema: 'proxy_feedgen',
bsky: { algos: makeAlgos(feedUri.host) },
bsky: {
// @TODO consider using makeAlgos() here if the appview begins supporting any feeds out of the box
Copy link
Collaborator

Choose a reason for hiding this comment

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

i might actually just cull all the tests related to this

import { NotificationServer } from '../src/notifications'
import { Database } from '../src'

describe('notification server', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

any idea the future of this stuff? it'll be handled by the dataplane indexer i guess? should just make a note so we don't forget about it 😅

Copy link
Collaborator Author

@devinivy devinivy Dec 28, 2023

Choose a reason for hiding this comment

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

Indeedy, looking like it will move into the indexer. I have notes on it, wont lose this!

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

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

High level comment, but I also think we can clean up a lot of unused stuff from the database now that it's just used for mocks (such as the database coordinator, background queue for indexing, etc).

But also we probably want to eventually just convert this to sqlite, so I don't think it's necessary to take a pass on all that right now

Copy link
Collaborator

@dholms dholms left a comment

Choose a reason for hiding this comment

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

Looks good! & stoked to get to cut all this out 🕺

I wasn't super thorough in my review, but I scanned the whole PR & grabbed the branch to poke around through the important bits.

The only big thing I think I'll miss is label hydration in all the snaps, it'd be great to find another way to get that in there if possible.

Besides that, I think there's just other code that can be culled as well, but it's not super pressing & we can probably save that for a clean up pass once it's all said & done

@devinivy
Copy link
Collaborator Author

@dholms made some changes!

  • got those labels back into the tests.
  • moved dataplane server-related tests out of the way into their own directory.
  • removed primary/replica/coordinator junk from the dataplane db.

@devinivy devinivy merged commit 1d8a4f1 into appview-v2 Dec 29, 2023
11 checks passed
@devinivy devinivy deleted the bav-v2-drop-pg branch December 29, 2023 16:27
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