mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts: # css/css-variables.scss # datamodels/2.x/authent-cas/module.authent-cas.php # datamodels/2.x/authent-external/module.authent-external.php # datamodels/2.x/authent-ldap/module.authent-ldap.php # datamodels/2.x/authent-local/module.authent-local.php # datamodels/2.x/combodo-db-tools/module.combodo-db-tools.php # datamodels/2.x/itop-attachments/module.itop-attachments.php # datamodels/2.x/itop-backup/module.itop-backup.php # datamodels/2.x/itop-bridge-virtualization-storage/module.itop-bridge-virtualization-storage.php # datamodels/2.x/itop-change-mgmt-itil/module.itop-change-mgmt-itil.php # datamodels/2.x/itop-change-mgmt/module.itop-change-mgmt.php # datamodels/2.x/itop-config-mgmt/module.itop-config-mgmt.php # datamodels/2.x/itop-config/module.itop-config.php # datamodels/2.x/itop-core-update/module.itop-core-update.php # datamodels/2.x/itop-datacenter-mgmt/module.itop-datacenter-mgmt.php # datamodels/2.x/itop-endusers-devices/module.itop-endusers-devices.php # datamodels/2.x/itop-files-information/module.itop-files-information.php # datamodels/2.x/itop-full-itil/module.itop-full-itil.php # datamodels/2.x/itop-hub-connector/module.itop-hub-connector.php # datamodels/2.x/itop-incident-mgmt-itil/module.itop-incident-mgmt-itil.php # datamodels/2.x/itop-knownerror-mgmt/module.itop-knownerror-mgmt.php # datamodels/2.x/itop-portal-base/module.itop-portal-base.php # datamodels/2.x/itop-portal/module.itop-portal.php # datamodels/2.x/itop-problem-mgmt/module.itop-problem-mgmt.php # datamodels/2.x/itop-profiles-itil/module.itop-profiles-itil.php # datamodels/2.x/itop-request-mgmt-itil/module.itop-request-mgmt-itil.php # datamodels/2.x/itop-request-mgmt/module.itop-request-mgmt.php # datamodels/2.x/itop-service-mgmt-provider/module.itop-service-mgmt-provider.php # datamodels/2.x/itop-service-mgmt/module.itop-service-mgmt.php # datamodels/2.x/itop-sla-computation/module.itop-sla-computation.php # datamodels/2.x/itop-storage-mgmt/module.itop-storage-mgmt.php # datamodels/2.x/itop-tickets/module.itop-tickets.php # datamodels/2.x/itop-virtualization-mgmt/module.itop-virtualization-mgmt.php # datamodels/2.x/itop-welcome-itil/module.itop-welcome-itil.php # datamodels/2.x/version.xml
This commit is contained in:
77
.make/release/changelog.php
Normal file
77
.make/release/changelog.php
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Usage :
|
||||||
|
* `php changelog.php 2.7.4`
|
||||||
|
*
|
||||||
|
* As argument is passed the git ref (tag name or sha1) we want to use as reference
|
||||||
|
*
|
||||||
|
* Outputs :
|
||||||
|
*
|
||||||
|
* 1. List of bugs as CSV :
|
||||||
|
* bug ref;link
|
||||||
|
* Example :
|
||||||
|
* <code>
|
||||||
|
* Bug_ref;Bug_URL;sha1
|
||||||
|
* 1234;https://support.combodo.com/pages/UI.php?operation=details&class=Bug&id=1234;949b213f9|b1ca1f263|a1271da74
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* 2. List of commits sha1/message without bug ref
|
||||||
|
* Example :
|
||||||
|
* <code>
|
||||||
|
* sha1;subject
|
||||||
|
* a6aa183e2;:bookmark: Prepare 2.7.5
|
||||||
|
* </code>
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
if (count($argv) === 1) {
|
||||||
|
echo '⚠ You must pass the base tag/sha1 as parameter';
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
$sBaseReference = $argv[1];
|
||||||
|
|
||||||
|
|
||||||
|
//--- Get log
|
||||||
|
$sGitLogCommand = 'git log --decorate --pretty="%h;%s" --date-order --no-merges '.$sBaseReference.'..HEAD';
|
||||||
|
$sGitLogRaw = shell_exec($sGitLogCommand);
|
||||||
|
|
||||||
|
|
||||||
|
//--- Analyze log
|
||||||
|
$aGitLogLines = preg_split('/\n/', trim($sGitLogRaw));;
|
||||||
|
$aLogLinesWithBugRef = [];
|
||||||
|
$aLogLineNoBug = [];
|
||||||
|
foreach ($aGitLogLines as $sLogLine) {
|
||||||
|
$sBugRef = preg_match('/[nN]°(\d{3,4})/', $sLogLine, $aLineBugRef);
|
||||||
|
if (($sBugRef === false) || empty($aLineBugRef)) {
|
||||||
|
$aLogLineNoBug[] = $sLogLine;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$iBugId = $aLineBugRef[1];
|
||||||
|
$sSha = substr($sLogLine, 0, 9);
|
||||||
|
|
||||||
|
if (array_key_exists($iBugId, $aLogLinesWithBugRef)) {
|
||||||
|
$aBugShaRefs = $aLogLinesWithBugRef[$iBugId];
|
||||||
|
$aBugShaRefs[] = $sSha;
|
||||||
|
$aLogLinesWithBugRef[$iBugId] = $aBugShaRefs;
|
||||||
|
} else {
|
||||||
|
$aLogLinesWithBugRef[$iBugId] = [$sSha];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$aBugsList = array_keys($aLogLinesWithBugRef);
|
||||||
|
sort($aBugsList, SORT_NUMERIC);
|
||||||
|
|
||||||
|
|
||||||
|
//-- Output results
|
||||||
|
echo "# Bugs included\n";
|
||||||
|
echo "Bug_ref;Bug_URL;sha1\n";
|
||||||
|
foreach ($aBugsList as $sBugRef) {
|
||||||
|
$sShaRefs = implode('|', $aLogLinesWithBugRef[$sBugRef]);
|
||||||
|
echo "{$sBugRef};https://support.combodo.com/pages/UI.php?operation=details&class=Bug&id={$sBugRef};$sShaRefs\n";
|
||||||
|
}
|
||||||
|
echo "\n";
|
||||||
|
echo "# Logs line without bug referenced\n";
|
||||||
|
echo "sha1;subject\n";
|
||||||
|
foreach ($aLogLineNoBug as $sLogLine) {
|
||||||
|
echo "$sLogLine\n";
|
||||||
|
}
|
||||||
@@ -664,16 +664,16 @@ class utils
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to convert a value expressed in a 'user friendly format'
|
* @param mixed $value The value as read from php.ini (eg 256k, 2M, 1G etc.)
|
||||||
* as in php.ini, e.g. 256k, 2M, 1G etc. Into a number of bytes
|
|
||||||
*
|
*
|
||||||
* @param mixed $value The value as read from php.ini
|
* @return int conversion to number of bytes
|
||||||
*
|
*
|
||||||
* @return number
|
* @since 2.7.5 3.0.0 convert to int numeric values
|
||||||
|
*
|
||||||
|
* @link https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes Shorthand bytes value reference in PHP.net FAQ
|
||||||
*/
|
*/
|
||||||
public static function ConvertToBytes($value)
|
public static function ConvertToBytes($value)
|
||||||
{
|
{
|
||||||
$iReturn = $value;
|
|
||||||
if (!is_numeric($value)) {
|
if (!is_numeric($value)) {
|
||||||
$iLength = strlen($value);
|
$iLength = strlen($value);
|
||||||
$iReturn = substr($value, 0, $iLength - 1);
|
$iReturn = substr($value, 0, $iLength - 1);
|
||||||
@@ -686,6 +686,8 @@ class utils
|
|||||||
case 'K':
|
case 'K':
|
||||||
$iReturn *= 1024;
|
$iReturn *= 1024;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$iReturn = (int)$value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $iReturn;
|
return $iReturn;
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class MFCompiler
|
|||||||
* If this file is present, then we don't recalculate hkeys
|
* If this file is present, then we don't recalculate hkeys
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
|
* @since 2.7.5 3.0.0 N°4020
|
||||||
*/
|
*/
|
||||||
public const REBUILD_HKEYS_NEVER= APPROOT.'data/.setup-rebuild-hkeys-never';
|
public const REBUILD_HKEYS_NEVER= APPROOT.'data/.setup-rebuild-hkeys-never';
|
||||||
|
|
||||||
@@ -182,9 +183,9 @@ class MFCompiler
|
|||||||
* @uses \file_exists()
|
* @uses \file_exists()
|
||||||
* @uses REBUILD_HKEYS_NEVER
|
* @uses REBUILD_HKEYS_NEVER
|
||||||
*
|
*
|
||||||
* @since 2.7.5
|
* @since 2.7.5 3.0.0
|
||||||
*/
|
*/
|
||||||
public static function SkipRebuildHKeys(): bool
|
public static function SkipRebuildHKeys()
|
||||||
{
|
{
|
||||||
return (file_exists(static::REBUILD_HKEYS_NEVER));
|
return (file_exists(static::REBUILD_HKEYS_NEVER));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -562,12 +562,14 @@ class UtilsTest extends \Combodo\iTop\Test\UnitTest\ItopTestCase
|
|||||||
{
|
{
|
||||||
$iCurrentConvertedValue = utils::ConvertToBytes($sExpressionToConvert);
|
$iCurrentConvertedValue = utils::ConvertToBytes($sExpressionToConvert);
|
||||||
self::assertEquals($iExpectedConvertedValue, $iCurrentConvertedValue, 'Converted value wasn\'t the one expected !');
|
self::assertEquals($iExpectedConvertedValue, $iCurrentConvertedValue, 'Converted value wasn\'t the one expected !');
|
||||||
|
self::assertSame($iExpectedConvertedValue, $iCurrentConvertedValue, 'Value was converted but not of the expected type');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ConvertToBytesProvider()
|
public function ConvertToBytesProvider()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'123' => ['123', 123],
|
'123 int value' => ['123', 123],
|
||||||
|
'-1 no limit' => ['-1', -1],
|
||||||
'56k' => ['56k', 56 * 1024],
|
'56k' => ['56k', 56 * 1024],
|
||||||
'512M' => ['512M', 512 * 1024 * 1024],
|
'512M' => ['512M', 512 * 1024 * 1024],
|
||||||
'2G' => ['2G', 2 * 1024 * 1024 * 1024],
|
'2G' => ['2G', 2 * 1024 * 1024 * 1024],
|
||||||
|
|||||||
Reference in New Issue
Block a user