Navigation Menu

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

FEATURE: node migration kickstart command #2897

Conversation

crydotsnake
Copy link
Member

@crydotsnake crydotsnake commented Sep 7, 2022

Review instructions

This pull request contains a new feature for the Neos.Kickstarter package. The new command is: ./flow kickstart:nodemigration. I can provide a $packageKey. The $packageKey is the respective site package. It also appends the current $timeStamp in the format: YmdHis to the generated migration.

Demo:

create-migration-demo

The node migration is displayed as usual when running: ./flow node:migrationstatus:

Bildschirmfoto 2022-09-07 um 23 17 20

The created node migration comes also with a template, which can be customized directly. The template also contains information about the node migration part in the Neos documentation.

Template

#############################################################################################################################################################################
# For more information about node migrations in Neos, checkout the documentation: https://neos.readthedocs.io/en/stable/References/NodeMigrations.html?highlight=migrations #
#############################################################################################################################################################################
up:
  comments: 'Migration description'
  migration:
    -
      filters:
        -

down:
  comments: 'No down migration available'

Related information:

Checklist

  • Code follows the PSR-2 coding style
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked wit !!! and have upgrade-instructions

$relativeTargetPathAndFilename = substr($targetPathAndFilename, strrpos(substr($targetPathAndFilename, 0, strpos($targetPathAndFilename, 'Tests/') - 1), '/') + 1);
} else {
$relativeTargetPathAndFilename = substr($targetPathAndFilename, strrpos(substr($targetPathAndFilename, 0, strpos($targetPathAndFilename, 'Classes/') - 1), '/') + 1);
if (strpos($targetPathAndFilename, FLOW_PATH_PACKAGES) === 0) {
Copy link
Member Author

Choose a reason for hiding this comment

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

A little note about this change.

I had a discussion with @kitsunet about a problem that i had, while working on my ./flow kickstart:nodemigration feature. The problem was that the output in my generateNodeMigration() method looked like this:

Created .../Test20220906183945.yaml
Your node migration has been created successfully.

The full path to the file was missing. This was because the generateFile() method could only handle Resources, Tests and Classes. We refactored the generateFile() method so that it works the same as before. But now it also can handle the full path to a migration created with the ./flow kickstart:nodemigration command:

Created .../Sites/Neos.Demo/Migrations/ContentRepository/Test20220907193517.yaml
Your node migration has been created successfully.

@crydotsnake crydotsnake force-pushed the feature/node-migration-kickstart-command branch from b0eb20d to de58207 Compare September 7, 2022 21:29
@crydotsnake
Copy link
Member Author

crydotsnake commented Nov 16, 2022

⚠️ This feature will be moved to the Neos.ContentRepository Package. (WIP) ⚠️

@crydotsnake crydotsnake changed the title FEATURE: node migration kickstart command DRAFT: FEATURE: node migration kickstart command Nov 16, 2022
@crydotsnake crydotsnake changed the title DRAFT: FEATURE: node migration kickstart command FEATURE: node migration kickstart command Nov 16, 2022
@mhsdesign mhsdesign marked this pull request as draft November 22, 2022 17:50
@kitsunet
Copy link
Member

Closing as it needs to be done in another repository.

@kitsunet kitsunet closed this Feb 13, 2023
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.

None yet

2 participants