Skip to content

Commit

Permalink
EZP-32097: Expose EzSystemInfo in Admin UI and SystemInfoDumpCommand (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza authored and mnocon committed Nov 4, 2020
1 parent f7e3e79 commit c47d5a1
Show file tree
Hide file tree
Showing 14 changed files with 342 additions and 156 deletions.
98 changes: 63 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,63 @@
dist: xenial
sudo: required

language: php

cache:
directories:
- $HOME/.composer/cache/files

matrix:
fast_finish: true
include:
- php: 7.3
env: CHECK_CS=true

# test only on matching branches (+ Pull requests)
branches:
only:
- master
- /^\d.\d+$/

before_script:
- travis_retry composer selfupdate
# Avoid memory issues on composer install
- phpenv config-rm xdebug.ini
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install packages
- travis_retry composer install --prefer-dist --no-interaction

script:
- php vendor/bin/phpunit
- if [ "$CHECK_CS" = "true" ]; then vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi

notifications:
email: false
dist: xenial
language: php

cache:
directories:
- $HOME/.composer/cache/files

matrix:
fast_finish: true
include:
- php: 7.3
name: "Code style"
env: CHECK_CS=true
- php: 7.3
name: "Unit tests"
env: UNIT_TESTS=true
- php: 7.3
name: "System informarion browser tests"
env:
- EZPLATFORM_REPO="https://github.com/ezsystems/ezplatform.git"
- APP_ENV=behat
- APP_DEBUG=1
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml"
- BEHAT_OPTS="--profile=adminui --suite=adminui --tags=@systemInformation"

# test only on matching branches (+ Pull requests)
branches:
only:
- master
- /^\d.\d+$/

notifications:
slack:
rooms:
- secure: "2f0W8DM1YKXN/AHjSTYKExKxss+XUrSqATrl2yrGr0qJAwTHxVZSfXCgpHqbKk3bSMeS08/xg5hsk4i5H0MBZVcqYNyP6XvKQ+8IlO9KCXrKbw6iK/9iPnG795wDbqyF9Aj0M5CzJ1AP3flR1/fuaq4at1Oyv7g5CUcHn/WigR262ByWuCEiCfJGAYDyEZ35WpE+LBDqVQ1fIhEThRxOnZH4EQpdY7wzKh8Ujo4V0c465OT6mcJ7XWkrJAcc0MVPpUP6Cgov9Nkc4Ahrdsv128LW6Mvb2Cf4wcrm1QUjeqoVcVb3Zm4h4ve4Px3nPP82wYgrDbe/eD2PUU0XRcmqYr7MTxjhieW/Eq6P5lY/peROb3WQrG0WNoFNWKciiNFOBgJ5xJyENMe77dt2ZJ2G/tqZ3/VWBAzmUoAFX0X2EXB3qMfNK1dnBzUrbBaG7C1UQLEvpV7PfHJB8inss+i29844lKxdJTDiilHMFEfyVbjXK/CsQlz7lqzgyGlPvr4iT9WW1x2UuRJlZDS0GRHGWaPZe8S+LRIP0o7k/MKsaIBO+sxm52UDWBwXbRz5FFHV26TG8d7HHvPUa3sXI4xGePcdW1qare4o+92ivmzxMLgQ+LZP2Pro+t+pTchotyeOgO7umZOQXPR5t92afxyewEQ8mpzo+1CDDfxp14tRcn4="
on_success: change
on_failure: always
on_pull_requests: false

before_script:
- travis_retry composer selfupdate
# Avoid memory issues on composer install
- phpenv config-rm xdebug.ini
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install packages
- if [ "${CHECK_CS}" != "" -o "${UNIT_TESTS}" != "" ] ; then travis_retry composer install ; fi
- if [ "${BEHAT_OPTS}" != "" ] ; then ./.travis/prepare_ezplatform.sh; fi

script:
- if [ "${UNIT_TESTS}" != "" ] ; then php vendor/bin/phpunit ; fi
- if [ "$CHECK_CS" = "true" ]; then vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi
- if [ "${BEHAT_OPTS}" != "" ] ; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/ezbehat ${BEHAT_OPTS}" ; fi

after_failure:
# Will show us the last bit of the log of container's main processes
# (not counting shell process above running php and behat)
# NOTE: errors during docker setup of travis build won't show up here (can't output all as it is too much in debug/verbose mode)
- docker-compose logs -t --tail=15
# Will show us what is up, and how long it's been up
- docker ps -s

after_script:
- if [ "${BEHAT_OPTS}" != "" ] ; then bin/ezreport ; fi
15 changes: 15 additions & 0 deletions .travis/prepare_ezplatform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

EZPLATFORM_BRANCH=`php -r 'echo json_decode(file_get_contents("./composer.json"))->extra->_ezplatform_branch_for_behat_tests;'`
EZPLATFORM_BRANCH="${EZPLATFORM_BRANCH:-master}"
PACKAGE_BUILD_DIR=$PWD
EZPLATFORM_BUILD_DIR=${HOME}/build/ezplatform

echo "> Cloning ezsystems/ezplatform:${EZPLATFORM_BRANCH}"
git clone --depth 1 --single-branch --branch "${EZPLATFORM_BRANCH}" ${EZPLATFORM_REPO} ${EZPLATFORM_BUILD_DIR}
cd ${EZPLATFORM_BUILD_DIR}

# Copy over auth.json
cp $TRAVIS_BUILD_DIR/auth.json .

/bin/bash ./bin/.travis/trusty/setup_ezplatform.sh "${COMPOSE_FILE}" '' "${PACKAGE_BUILD_DIR}"
88 changes: 45 additions & 43 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
{
"name": "ezsystems/ez-support-tools",
"description": "Providing information about the system eZ Platform/Enterprise/Commerce is running on, and eZ install itself",
"license": "GPL-2.0",
"type": "ezplatform-bundle",
"authors": [
{
"name": "eZ Systems",
"email": "dev-team@ez.no"
}
],
"require": {
"php": "^7.3",
"ezsystems/ezplatform-kernel": "~1.2.0@dev",
"ezsystems/ezplatform-core": "^2.1@dev",
"ezsystems/ezplatform-admin-ui": "^2.2@dev",
"ocramius/proxy-manager": "^2.2",
"symfony/proxy-manager-bridge": "^5.0",
"zetacomponents/system-information": "^1.1.1",
"doctrine/inflector": "^1.3"
},
"require-dev": {
"ezsystems/ezplatform-code-style": "^0.1",
"friendsofphp/php-cs-fixer": "^2.16",
"ezsystems/doctrine-dbal-schema": "^1.0@dev",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.0"
},
"autoload": {
"psr-4": {
"EzSystems\\EzSupportToolsBundle\\": "src/bundle/",
"EzSystems\\EzSupportTools\\": "src/lib/"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
}
}
{
"name": "ezsystems/ez-support-tools",
"description": "Providing information about the system eZ Platform/Enterprise/Commerce is running on, and eZ install itself",
"license": "GPL-2.0",
"type": "ezplatform-bundle",
"authors": [
{
"name": "eZ Systems",
"email": "dev-team@ez.no"
}
],
"require": {
"php": "^7.3",
"ezsystems/ezplatform-kernel": "~1.2.0@dev",
"ezsystems/ezplatform-core": "^2.1@dev",
"ezsystems/ezplatform-admin-ui": "^2.2@dev",
"ocramius/proxy-manager": "^2.2",
"symfony/proxy-manager-bridge": "^5.0",
"zetacomponents/system-information": "^1.1.1",
"doctrine/inflector": "^1.3"
},
"require-dev": {
"ezsystems/ezplatform-code-style": "^0.1",
"friendsofphp/php-cs-fixer": "^2.16",
"ezsystems/doctrine-dbal-schema": "^1.0@dev",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.0"
},
"autoload": {
"psr-4": {
"EzSystems\\EzSupportToolsBundle\\": "src/bundle/",
"EzSystems\\EzSupportTools\\": "src/lib/"
}
},
"extra": {
"_ezplatform_branch_for_behat_tests": "3.2",
"branch-alias": {
"dev-master": "2.2.x-dev",
"dev-tmp_ci_branch": "2.2.x-dev"
}
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
}
}
4 changes: 4 additions & 0 deletions src/bundle/Resources/config/default_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ parameters:
ezsettings.default.system_info_view: {}
ezsettings.global.system_info_view:
pjax_tab:
ibexa:
template: '@@ezdesign/system_info/my_ibexa.html.twig'
match:
SystemInfo\Identifier: 'ibexa'
composer:
template: '@@ezdesign/system_info/composer.html.twig'
match:
Expand Down
11 changes: 5 additions & 6 deletions src/bundle/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parameters:
support_tools.system_info.ezc.wrapper.class: EzSystems\EzSupportToolsBundle\SystemInfo\EzcSystemInfoWrapper
support_tools.system_info.collector.composer.lock_file.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\JsonComposerLockSystemInfoCollector
support_tools.system_info.collector.database.doctrine.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\DoctrineDatabaseSystemInfoCollector
support_tools.system_info.collector.system.ez.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzSystemInfoCollector
support_tools.system_info.collector.system.ibexa.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\IbexaSystemInfoCollector
support_tools.system_info.collector.hardware.ezc.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcHardwareSystemInfoCollector
support_tools.system_info.collector.php.ezc.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcPhpSystemInfoCollector
support_tools.system_info.collector.symfony.kernel.config.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\ConfigurationSymfonyKernelSystemInfoCollector
Expand Down Expand Up @@ -52,14 +52,13 @@ services:

# SystemInfoCollectors

support_tools.system_info.collector.system.ez:
class: "%support_tools.system_info.collector.system.ez.class%"
support_tools.system_info.collector.system.ibexa:
class: "%support_tools.system_info.collector.system.ibexa.class%"
arguments:
- "@support_tools.system_info.collector.composer.lock_file"
- "%kernel.debug%"
# Can't tag this before v0.3 (2.5?) as it will blow up in admin UI for missing templates there
# And it does not look like there is any way to add it from this package, so maybe it needs to be made extensible(?)
#tags: [{ name: "support_tools.system_info.collector", identifier: "ez" }]
tags:
- { name: "support_tools.system_info.collector", identifier: "ibexa" }

support_tools.system_info.collector.composer.lock_file:
class: "%support_tools.system_info.collector.composer.lock_file.class%"
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/view.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
autowire: true
arguments:
$template: '@@ezdesign/ui/dashboard/block/ez.html.twig'
$ezSystemInfo: "@=service('support_tools.system_info.collector.system.ez').collect()"
$ibexaSystemInfo: "@=service('support_tools.system_info.collector.system.ibexa').collect()"
$urlList: '%support_tools.ez_url_list%'
tags:
- { name: ezplatform.admin_ui.component, group: 'dashboard-blocks', priority: 200 }
45 changes: 45 additions & 0 deletions src/bundle/Resources/translations/systeminfo.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,46 @@
<target state="new">Disabled</target>
<note>key: disabled</note>
</trans-unit>
<trans-unit id="d87becd0d1497fe04536d2e9291290a8b07e9dfb" resname="ibexa.product">
<source>Product</source>
<target state="new">Product</target>
<note>key: ibexa.product</note>
</trans-unit>
<trans-unit id="b7ffaa791bbf39db2ea700efec5362a0bc4e2021" resname="ibexa.name">
<source>Name</source>
<target state="new">Name</target>
<note>key: ibexa.name</note>
</trans-unit>
<trans-unit id="d6025d67b03f12dac6c912f6224bb309347f6465" resname="ibexa.version">
<source>Version</source>
<target state="new">Version</target>
<note>key: ibexa.version</note>
</trans-unit>
<trans-unit id="4a9e6f9b28c3203784cb5f01ebe73e67661cc823" resname="ibexa.eom">
<source>End of Maintenance</source>
<target state="new">End of Maintenance</target>
<note>key: ibexa.eom</note>
</trans-unit>
<trans-unit id="ed1f723e05fbc74c1c90cfc6f64c2bcda6f4bb9d" resname="ibexa.eol">
<source>End of Life</source>
<target state="new">End of Life</target>
<note>key: ibexa.eol</note>
</trans-unit>
<trans-unit id="804e14084add4426182add3b4a0a710506ef742b" resname="ibexa.is_trial">
<source>Is Trial</source>
<target state="new">Is Trial</target>
<note>key: ibexa.is_trial</note>
</trans-unit>
<trans-unit id="341340ab8c700ad6fe83322ec29cb3977262f5df" resname="ibexa.stability">
<source>Stability</source>
<target state="new">Stability</target>
<note>key: ibexa.stability</note>
</trans-unit>
<trans-unit id="972bcf808b8ce2b0a08a21db7f0f15f520f4b87b" resname="ibexa.read_more">
<source>You can read more about Service Life for Ibexa DXP with a business license at</source>
<target state="new">You can read more about Service Life for Ibexa DXP with a business license at</target>
<note>key: ibexa.read_more</note>
</trans-unit>
<trans-unit id="608cb271bb7fb52c99a1a8e003e0f80f57fb41e1" resname="hardware">
<source>Hardware</source>
<target state="new">Hardware</target>
Expand Down Expand Up @@ -176,6 +216,11 @@
<target state="new">System Information</target>
<note>key: systeminfo</note>
</trans-unit>
<trans-unit id="7dd1b2ca71037e00112dfe0297383f47c6904c77" resname="tab.name.ibexa">
<source>My Ibexa</source>
<target state="new">My Ibexa</target>
<note>key: tab.name.ibexa</note>
</trans-unit>
<trans-unit id="a2a92e9d0e41ea4a14c99ab0f702d5df3ea017c3" resname="tab.name.composer">
<source>Composer</source>
<target state="new">Composer</target>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% trans_default_domain "systeminfo" %}

<!-- Tab name: {{ 'tab.name.ibexa'|trans|desc('My Ibexa') }} -->

<section class="ez-fieldgroup">
<h2 class="ez-fieldgroup__name">{{ 'ibexa.product'|trans|desc('Product') }}</h2>
<div class="ez-fieldgroup__content">
<table class="table ez-table ez-table--list ez-table--to-left">
<tbody>
<tr class="ez-table__row">
<td class="ez-table__cell">{{ 'ibexa.name'|trans|desc('Name') }}</td>
<td class="ez-table__cell">{{ info.name }}</td>
</tr>
<tr class="ez-table__row">
<td class="ez-table__cell">{{ 'ibexa.version'|trans|desc('Version') }}</td>
<td class="ez-table__cell">{{ info.release }}</td>
</tr>
<tr class="ez-table__row">
<td class="ez-table__cell">{{ 'ibexa.is_trial'|trans|desc('Is Trial') }}</td>
<td class="ez-table__cell">
<svg class="ez-icon ez-icon--small">
<use xlink:href="{{ ez_icon_path(info.isTrial ? 'checkmark' : 'discard') }}"></use>
</svg>
</td>
</tr>
<tr class="ez-table__row">
<td class="ez-table__cell">{{ 'ibexa.stability'|trans|desc('Stability') }}</td>
<td class="ez-table__cell">{{ info.stability }}</td>
</tr>
{% if info.isEnterprise %}
<tr class="ez-table__row">
<td class="ez-table__cell">{{ 'ibexa.eom'|trans|desc('End of Maintenance') }}*</td>
<td class="ez-table__cell">
{{ info.endOfMaintenanceDate is empty ? '' : info.endOfMaintenanceDate|date('F Y') }}
</td>
</tr>
<tr class="ez-table__row">
<td class="ez-table__cell">{{ 'ibexa.eol'|trans|desc('End of Life') }}*</td>
<td class="ez-table__cell">
{{ info.endOfLifeDate is empty ? '' : info.endOfLifeDate|date('F Y') }}
</td>
</tr>
<tr class="ez-table__row">
<td colspan="2">
<hr/>
* {{ 'ibexa.read_more'|trans|desc('You can read more about Service Life for Ibexa DXP with a business license at') }}
<a target="_blank" href="https://support.ibexa.co/Public/Service-Life">
https://support.ibexa.co/Public/Service-Life
</a>
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{% else %}
{{ 'dashboard.ez_version.non_stable_packages'|trans({'%stability%': ez.stability})|desc("Your setup is running with @%stability% composer packages. This is not recommended except when testing updates or during development.") }}
{% endif %}
{% if ez.isEnterpise %}
{% if ez.isEnterprise %}
{{ 'dashboard.ez_version.non_stable_ee'|trans({'%support_url%': urls['support']})|desc("If you need assistance, don't hesitate to <a target=\"_blank\" href=\"%support_url%\">get in touch with Ibexa support</a>.")|raw }}
{% endif %}
</div>
Expand Down Expand Up @@ -79,7 +79,7 @@
|raw }}
</div>
</div>
{% elseif not ez.isEnterpise %}
{% elseif not ez.isEnterprise %}
{% set badge = 'GPL' %}
{% if ez.isEndOfMaintenance %}
{# In the future with retrival of info from updates.ez.no we can detect missing (public) security fixes and then let this become an error #}
Expand Down
Loading

0 comments on commit c47d5a1

Please sign in to comment.