Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
After running the tool and looking at the reports, the output of the report does not easily copy and paste into a ticket.
Proposed resolution
Update the output of the reports to be more like the phpcs output, so it can easily be copied and shared from the upgrade status report into other tools / ticketing systems.
Comment | File | Size | Author |
---|---|---|---|
#22 | 3053090-22.patch | 21.34 KB | Gábor Hojtsy |
#21 | 3053090-21.patch | 20.13 KB | Gábor Hojtsy |
#19 | 3053090-19.patch | 17.42 KB | Gábor Hojtsy |
#17 | 3053090-17.patch | 17.4 KB | Gábor Hojtsy |
#13 | upgrade-status-ascii-export-option-3053090-13.patch | 14.07 KB | rpsu |
Comments
Comment #2
Gábor HojtsyCan you paste a sample report format you would be looking to have?
Comment #3
mikemadison CreditAttribution: mikemadison at Acquia commentedIdeally it would do something like https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting (see below) as opposed to the tabular format that it's currently reporting out in. To be clear, this would be on the report page for the individual module, not necessarily on the overall upgrade status page that shows how many issues there are.
Sidenote, is there a plan to provide a drush interface to the module so that the upgrade status can be run from the terminal? Because ideally it would be the same output in both places!
Comment #4
Gábor HojtsyThe module is a UI on top of https://github.com/mglaman/drupal-check, which has this exact output by default you are requesting. If you are interested primarily in a CLI interface and that output, then you probably don't need the module :)
Comment #5
Gábor HojtsyThat said if this is superior to the HTML output and we can assume that everyone using the module wants this ASCII limited output for single and full site exports, then we should change our HTML output to be this instead. We can at least do away with our duplicated CSS in the single and full output templates (and even the templates themselves really).
Comment #6
Gábor HojtsyChanged title based on suggested change.
Comment #7
webchickThe main reason we went with HTML exports is that there are links in the generated text, and that makes them easy to click directly from the web interface. I don't have any problem with an HTML/ASCII selector, but I think making them only ASCII makes the output less usable, as you now need to select + copy + paste to get the same info.
Comment #8
mikemadison CreditAttribution: mikemadison at Acquia commentedthe links definitely helped in researching the problems, i did like that. i'm not sure if there's a way to do both?
Comment #9
herczogzoltanIf there's a need to add another export format, we can modify the current occurrence of the export to mention the format as well (something like "Export HTML" ?). We can also extend the operations for each project row with an extra link which will do the export in the desirable easy to copy format (something like "Export ASCII" ?) and place an extra button on the project report modal popup with the same title. Also modifications needed in constructing the current report, maybe adding a way to select the formatting mode. For example "formatted" and "plain", but we can think it through to make it a bit more extendable, in case somebody will need another format besides HTML or ASCII.
What do you think about the above? The button titles and changes on the report constructor are just suggestions.
Comment #10
Gábor HojtsyIf the links are all we care about for HTML then we can output in a HTML page in
<pre>
or<code>
and still inline the links as HTML. Then you can copy paste it (loosing the links) or use it as HTML (click links). I am not fond of adding a lot more UI weight for various more output formats if we can get the best of both worlds.I understand the copy-pasting for custom projects (to your own internal issue tracker), but for contrib modules, an issue could very well already exist, you may not be running the latest version, stuff may be fixed in dev, etc. So searching the queue first and figuring out how to engage with the maintainer is better. We do have plans to guide users of this module in that interaction. See #3053948: Guide users on how to best engage with a contrib project maintainer.
Comment #11
Gábor HojtsyComment #12
tsega CreditAttribution: tsega at Axelerant commented@gábor here is what I have so far on the ASCII export option. I feel there are two things left to make this a complete feature;
Comment #13
rpsuThe patch seems to have been done reversibly (wrong direction, thus no diff here). Attached patch fixes that, and adds dynamic export file extension.
Removed
phpstan/phpstan
version downgrade (mistake assumed), and html tags from the ascii export file twig template - seems to be cleaner this way.Comment #15
Gábor HojtsyI don't have enough composer fu (or time ATM) to figure out how to make a locally updated composer.json function when composer attempts to update the project either way. So I committed just the dependency update as a start to make it easier to test the rest.
Comment #16
Gábor Hojtsy@rpsu: you forgot to attach the twig file.
Comment #17
Gábor Hojtsy- Restored the twig ASCII template.
- Refactored the form integration a bit.
- Added security filtering to the single export format argument.
- Simplified the ASCII output format, more whitespace less lines.
Still definitely needs work in terms of the table structure and how the ASCII itself gets generated, because it has some duplicate code still.
Comment #19
Gábor HojtsyRemoved link generation from ASCII tables, I think its distracting.
Fixed test text looking for export button labels, so those should pass again.
Moved to per file tables instead of one table per project, this makes results a LOT more readable, like this:
I tried making tables fixed width but the library did not allow to do so. Although given how much we are doing ourselves now, not sure how much is left for the library to do really. Anyway, keeping that for now.
Comment #21
Gábor HojtsyFix the custom/contrib project labels.
Comment #22
Gábor HojtsyAdd its own test coverage.
Comment #23
Gábor HojtsyComment #25
Gábor HojtsyAll right, put this in, thanks both for your help :)