-
Notifications
You must be signed in to change notification settings - Fork 4
3-way diff #37
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
3-way diff #37
Conversation
| (termNames, typeNames) <- foldMapM namesForReference withPGRefs | ||
| pure $ Names.fromTermsAndTypes termNames typeNames | ||
| where | ||
| -- TODO: Can probably speed this up by skipping suffixification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth testing one of the common queries on prod with and without suffixification to see if the real-world cost changes :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, how might we go about doing this? (Btw, this was one of the functions you authored before I took over)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little leg-work to do it, sorry >_>
The queries it's running are here: https://github.com/unisoncomputing/share-api/blob/main/src/Share/Postgres/NameLookups/Queries.hs#L44-L122
You'll need to copy-paste that, then manually fill in the parameters into the query which is a little annoying tbh; you can probably query a release or something from the debug_project_releases view, then cross reference that with scoped_term_name_lookup to get the params you need;
From there you can EXPLAIN ... and/or EXPLAIN ANALYSE on the queries with and without the suffixification.
If you need DB credentials you can get a read-only login for psql via vault read secret/production/enlil/userdb-readonly; For some reason our main DB is still called users 🤷🏼
Or my preferred method:
pgprod_ro () {
pg_secret=$(vault read /secret/production/enlil/userdb-readonly -format=json | jq .data)
PGPASSWORD="$(echo "$pg_secret" | jq -r .password)" psql --username "$(echo "$pg_secret" | jq -r .username)" --host "$(echo "$pg_secret" | jq -r .hostname)" --port "$(echo "$pg_secret" | jq -r .port)" -d users "$@"
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need a hand knowing where to poke around don't hesitate to ask, it's probably good to get more folks used to digging around :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the changes here (and in the other transcript changes) expected? Looks like a conflict was introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, good job on all of this!
I think I'd have expected to see some new transcripts, do the existing ones cover all the new cases w/r to propagated vs manual changes?
Regardless, if the transcript outputs look good we can let @hojberg know about the changes and once he's got a UI ready we can try it out locally and on staging.
Consider it approved ✅, but we should wait till the frontend is ready to handle this version before merging since otherwise it'll block Share deploys until that's done
Also, I see changes in the unison submodule, is there a related PR there that needs to be merged first?
Overview
The PR amends the namespace diff infrastructure to use the 3-way diff algorithm, and adds a new "propagated" diff entry type for propagated updates. It also adds a libdeps diff to the payload.
Test coverage
I've rerun the existing transcripts, which should cover all of the changes. I also amended one to demonstrate that a propagated update gets tagged as such.
Loose ends
One that will be implemented in a follow-on PR: