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: Check against LiveWorkspaceName Instead Of Comparing CS Ids #5149

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Jun 19, 2024

With #5002 \Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder::isLiveContentStream is obsolete.

See #4996

Afterwards, affected Neos projections (e.g. ChangeProjection and UriPathProjection) should be simplified such that they no longer keep track of the workspace

Adjustments:

With neos#5002 `\Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder::isLiveContentStream` is obsolete.
Copy link
Member

@nezaniel nezaniel left a comment

Choose a reason for hiding this comment

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

one little thing, rest looks nice

@@ -22,8 +22,7 @@ public function __construct(
public function buildSchema(AbstractSchemaManager $schemaManager): Schema
{
$schema = DbalSchemaFactory::createSchemaWithTables($schemaManager, [
$this->createUriTable(),
$this->createLiveContentStreamsTable()
Copy link
Member

Choose a reason for hiding this comment

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

Also a more general question:
Wouldn't this be also responsible for now removing the deprecated table?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question in general. Have the same issue with another table. But does it make sence to check for removal on each setup? How long? When will we remove the removal code?

Copy link
Member

Choose a reason for hiding this comment

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

"Create" is a bit misleading here – it creates the schema for the table. There is no way to remove a schema here.
That's currently done in the projection itself (see https://github.com/neos/neos-development-collection/pull/5149/files#diff-2e3df51a3340b51e08cf9d2ba5aade329a8c0e073354c1d5a72e42c3aaf5a127R112)
But I'm with @kitsunet on this one: Let's leave those dangling for now. For 9.0 -> 9.1 ect we'll have to think of a way to migrate those things once

@mhsdesign
Copy link
Member Author

Updated branch and added migration to drop the tables

Copy link
Contributor

@dlubitz dlubitz 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 to me by reading.

Copy link
Member

@kitsunet kitsunet left a comment

Choose a reason for hiding this comment

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

Added comment, deleted comment, seems fine... Thanks!

$statements = DbalSchemaDiff::determineRequiredSqlStatements($this->dbal, $schema);
// MIGRATIONS
if ($this->dbal->getSchemaManager()->tablesExist([$this->tableNamePrefix . '_livecontentstreams'])) {
$statements[] = sprintf('DROP table %s_livecontentstreams;', $this->tableNamePrefix);
Copy link
Member

Choose a reason for hiding this comment

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

not a huge fan.... I would just leave this dangling, we can consider something for these cases after release...

Copy link
Member Author

Choose a reason for hiding this comment

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

im not a huge fan either from these hardcoded migrations, but Sebastian started introducing them and we can delete them at some point if we want. So thats why ill merge it.

Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

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

+1 by reading, thanks!
Re dropping the table I'm OK either way.

@nezaniel could you remove your -1 if you agree?

@mhsdesign mhsdesign dismissed nezaniel’s stale review September 25, 2024 17:08

Adjusted as wished

@mhsdesign mhsdesign merged commit 1fb99b7 into neos:9.0 Sep 25, 2024
9 checks passed
@mhsdesign mhsdesign deleted the task/refactorIsLiveContentStreamToUseWorkspaceNameOfEvent branch October 18, 2024 08:06
@mhsdesign
Copy link
Member Author

Stupidly this introduced a regression: #5293
As $event->workspaceName is not to be trusted.

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.

5 participants