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

TASK: Remove --reset-projections flag from cr:setup command #5089

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

bwaidelich
Copy link
Member

@bwaidelich bwaidelich commented May 24, 2024

Removes the --reset-projections option from the cr:setup command because that could fail

Fixes: #5008

@mhsdesign
Copy link
Member

Thanks for implementing the stuff i complain about but now i understood what you thought and wrote at the other place. I simply ruled out this as this will defeat the purpose of --reset-projections. The flag is meant as hardcore fix in case we introduce a new schema config that cannot! be setup'd without having to empty the projections (because the content cant be migrated) see christians integer change etc.

Now the flag works well for this case, but if also a new table is introduced the reset will complain due to the table not existing.
Its a henn egg problem. Cant do any of them first. Thus i wanted to do a forgiving reset - which should be imo fine.

@bwaidelich
Copy link
Member Author

@mhsdesign can you elaborate in which cases a setUp() would break? IMO it should never. What is "christians integer change"?

@kitsunet
Copy link
Member

The relation anchors, that required an empty DB or no tables to exist as the existing table was incompatible with the new schema.

@bwaidelich
Copy link
Member Author

The relation anchors, that required an empty DB or no tables to exist as the existing table was incompatible with the new schema.

Ah, right.
But I stick to my claim: IMO setUp() should never fail. If the SchemaDiff can't handle it automatically we can add some custom statements to make it stable.

In general: I want to be able to run ./flow cr:setup in my CI

@mhsdesign
Copy link
Member

sure for ci it must always work when were 9.0 stable. but currently --reset-projections was a nice bruteforce introduced with #4864

We can remove this flag again as well but we thought at that time it was a good idea, or have we all forgotten :D

@bwaidelich
Copy link
Member Author

I'm OK with the flag and I'm confident that we can keep setUp non-crashing from now on

@mhsdesign
Copy link
Member

TLTR; remove it plz

I'm confident that we can keep setUp

haha no xD flow cr:setup --reset-projections will fail again soon. Once we introduce a new table for the content graph projection again with #5096

but that shows surely that it was a bad idea from me to introduce it ^^

though having our beta users have to run

flow cr:resetall --content-repository default // ignore the error it yields
flow cr:setup --content-repository default
flow cr:replayall --content-repository default

was also not cool thats why we introduced it. But it can go now idk. We dont plan any changes like #4791 anymore

@bwaidelich
Copy link
Member Author

flow cr:setup --reset-projections will fail again soon. Once we introduce a new table for the content graph projection again

Why should that fail??
setUp() will just create the new table, that's what it's there for – Or what am I missing?

Anyways, I'm fine with removing the flag – usually you want to trigger a catchup after reset anyways

@bwaidelich bwaidelich changed the title BUGFIX: Reset projections after setup in cr:setup command TASK: Remove --reset-projections flag from cr:setup command May 25, 2024
@github-actions github-actions bot added the Task label May 25, 2024
@mhsdesign
Copy link
Member

hen egg situation as said. One must basically now if this flag should be used now or not.

setUp() will just create the new table, that's what it's there for – Or what am I missing?

in this case a reset before a setup will fail.

But changing the order will not fix the original problem this flag tried to solve see #4791 (comment).

But as we dont want any breaking changes anymore in the schema that cant be automigrated with filled data (asking @kitsunet here?) we can drop it

Copy link
Member

@mhsdesign mhsdesign left a comment

Choose a reason for hiding this comment

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

sorry that everything i touch grows into a large discussion 😅

@mhsdesign
Copy link
Member

cant we just share one singleton instance of my brain part that holds the cr parts :D

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

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

Sounds like a dangerous thing anyways… 😎

@kdambekalns kdambekalns merged commit 332244b into 9.0 Jun 13, 2024
12 checks passed
@kdambekalns kdambekalns deleted the bugfix/5008-reset-projections-after-setup branch June 13, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flow cr:setup --reset-projections might fail if tables to be truncated dont exist
4 participants