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

feat: make all templates free #9503

Merged
merged 5 commits into from
Mar 6, 2024
Merged

Conversation

nickoferrall
Copy link
Contributor

Fix #9472

I suggest that we don't remove all of the template limit logic as it's possible that we will want to implement template limits again in the near future.

So, we should just set isFree to true for all meeting templates.

When I run yarn pg:migrate up I get the following error locally:

  • 1709551949071_makeAllTemplatesFree
    Rolling back attempted migration ...
    RethinkDBError [ReqlOpFailedError]: Table actionDevelopment.MeetingTemplate does not exist in:
    r.db("actionDevelopment").table("TemplateDimension").getAll(r.args(["estimatedEffortTemplate", "p5L84RD2og", "nLmvkxa43S", "wsjfTemplate"]), {
    index: "templateId"
    }).merge((var_1) => {
    scale: r.db("actionDevelopment").table("TemplateScale").get(var_1("scaleId"))
    }).orderBy("sortOrder").group("templateId").ungroup().merge((var_1) => {
    name: r.db("actionDevelopment").table("MeetingTemplate").get(var_1("group"))("name"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    id: var_1("group"),
    dimensions: var_1("reduction")
    })
    at Cursor.handleErrors (/Users/nickoferrall/parabol/node_modules/rethinkdb-ts/lib/response/cursor.js:274:23)
    at Cursor.resolve (/Users/nickoferrall/parabol/node_modules/rethinkdb-ts/lib/response/cursor.js:190:18)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Function.run (/Users/nickoferrall/parabol/node_modules/rethinkdb-ts/lib/query-builder/query-runner.js:28:29) {
    msg: 'Table actionDevelopment.MeetingTemplate does not exist.',
    type: 17,
    cause: undefined,
    term: [ 35, [ [Array], [Array] ] ]
    }

This migration is almost identical to this one, so I assume it's a problem with my local set-up. It's referring to Rethinkdb when the table is in PG. Please let me know if you recognise the error. If not, I'll keep digging into it.

To test

  • Run the migration and see that all templates are free for all users

@github-actions github-actions bot requested a review from tianrunhe March 4, 2024 12:30
@github-actions github-actions bot added the size/s label Mar 4, 2024
@nickoferrall nickoferrall requested review from Dschoordsch and removed request for tianrunhe March 4, 2024 12:30
await client.end()
}

const PREV_FREE_TEMPLATES = [
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 This list is incomplete, after running the down migration I have 75 non-free templates. On production there are only 20. Running

select * from "MeetingTemplate" where "isFree" = false and "orgId" = 'aGhostOrg'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's because the first query in the down migration didn't check where orgId is aGhostOrg, so all of the custom templates were set to non-free.

I've updated the down migration and checked staging for the list of free template ids.

await client.end()
}

const PREV_FREE_TEMPLATE_IDS = [
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 We're still missing more free templates: https://github.com/ParabolInc/parabol/blob/master/packages/server/postgres/migrations/1698831891828_moreFreeRetroTemplates.ts

There are probably others as well. I'd rather skip the down migration altogether than making more templates paid than necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 This can now be removed

await client.end()
}

const PREV_FREE_TEMPLATE_IDS = [
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 This can now be removed

@Dschoordsch Dschoordsch merged commit 6762ebc into master Mar 6, 2024
5 checks passed
@Dschoordsch Dschoordsch deleted the feat/9472/make-templates-free branch March 6, 2024 09:05
@github-actions github-actions bot mentioned this pull request Mar 6, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make all templates free
2 participants