Skip to content

Add error output to the phpcr cleanup command #7805

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

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

mamazu
Copy link
Contributor

@mamazu mamazu commented Feb 12, 2025

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Fixed tickets -
Related issues/PRs -
License MIT
Documentation PR -

What's in this PR?

  • Adding error output to the sulu:document:phpcr-cleanup -v command so that the user can see what went wrong.
  • Replacing the Confirmation question with a Symfony Confirmation question.
    image
  • Writing an error output of the single node clean command (right now it's just being caught and ignored)

Why?

  • Depending on the kind of error maybe re-running the command might help. Or further investigations need to be done.
  • Changing the default of the "do you want to do this" to yes:
    • makes it usable in scripts
    • you can now use the -n flag to skip the prompt
    • if you answer no, why did you call the command in the first place?

Example Usage

bin/console sulu:document:phpcr-cleanup
```
Same output as before. Just a list of ids.


bin/console sulu:document:phpcr-cleanup -v

Returns a list of ids and their error output. Maybe this should be redirected to a file then.

@mamazu mamazu force-pushed the error_output_for_clean_command branch from 2a630c6 to c0ed56e Compare February 12, 2025 12:48
@mamazu mamazu force-pushed the error_output_for_clean_command branch from c0ed56e to 57fbc53 Compare February 12, 2025 13:23
@@ -192,20 +182,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
if (0 !== $status) {
++$stats['erroredNodes'];
$erroredUuids[] = $uuid;
$erroredUuids[$uuid] = $process->getErrorOutput();
Copy link
Member

Choose a reason for hiding this comment

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

@mamazu we should also write this to the debug markdown file! then it also would be possible to have that for lots of errored nodes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error output should now be also logged.

@mamazu mamazu force-pushed the error_output_for_clean_command branch from a13cc38 to 8957116 Compare February 12, 2025 20:04
@alexander-schranz alexander-schranz added the DX Affecting the end developer label Feb 21, 2025
@alexander-schranz alexander-schranz changed the title Adding error output to the clean command Add error output to the phpcr cleanup command Feb 21, 2025
@wachterjohannes wachterjohannes merged commit e76ee88 into sulu:2.6 Feb 24, 2025
9 checks passed
@mamazu mamazu deleted the error_output_for_clean_command branch February 24, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants