-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: analytics module gets and updates PlanX DB #4071
Conversation
🤖 Hasura Change Summary compared a subset of table metadata including permissions: Updated Tables (1)
|
Removed vultr server and associated DNS entries |
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.
Just hopping on as I realised I'd forgotten to review these for you! This is looking pretty good to me, though we are getting an integration test failure:
FAIL teams.test.js > teams > api > cannot create, update, or delete teams
Error: 'teams' unexpectedly found in mutation(s) [update_teams,update_teams_by_pk,update_teams_many]
❯ teams.test.js:102:17
100|
101| test("cannot create, update, or delete teams", () => {
102| expect(i).toHaveNoMutationsFor("teams");
| ^
103| });
104| });
This is because we have added a mutation (update metabase ID in the teams table), where previously the api role did not have any mutations.
I guess we should update the test to instead expect the mutation (similar to the can query teams
test in the same file)
const response = await $api.client.request<GetMetabaseId>( | ||
gql` | ||
query GetTeamAndMetabaseId($name: String!) { | ||
teams(where: { name: { _ilike: $name } }) { |
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.
_ilike
could match both "North Somerset" and "South Somerset" - it would be better to match using _eq
on team slugs if possible which are guaranteed to be unique.
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.
Great catch! Updated in ba015dc.
after teams table migration
and match in planx db on equality instead
What's new in this PR
metabase_id
column toteams
in PlanX DBapi
to be able to read and update relevant valuesgetTeamIdAndMetabaseId
functionupdateMetabaseId
functionWhy
metabase_id
in the PlanX DB and check that instead