From 93f1bc1afc7d082ace318ba1875a825385b25ae7 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Wed, 9 Oct 2024 15:09:58 +0200 Subject: [PATCH 1/7] Bump version to 2.9.0-dev --- Source/MantisSourceBase.class.php | 2 +- docs/CHANGELOG.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/MantisSourceBase.class.php b/Source/MantisSourceBase.class.php index 5dfc36209..e4ac07e82 100644 --- a/Source/MantisSourceBase.class.php +++ b/Source/MantisSourceBase.class.php @@ -19,7 +19,7 @@ abstract class MantisSourceBase extends MantisPlugin * a change in the minimum required MantisBT version: 0=1.2; 1=1.3, 2=2.x. * The framework version is incremented when the plugin's core files change. */ - const FRAMEWORK_VERSION = '2.8.0'; + const FRAMEWORK_VERSION = '2.9.0-dev'; /** * Minimum required MantisBT version. diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 84977b6d3..d08770c81 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,9 @@ specification. # Releases for MantisBT 2.x +## [Unreleased] + + ## [2.8.0] - 2024-09-06 ### Added From 5fc3b816863d0cce72e7909676642143d70829f4 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Wed, 9 Oct 2024 15:11:08 +0200 Subject: [PATCH 2/7] Set minimum MantisBT version to 2.26.4 This allows checkin.php to return a proper HTTP response code when an error occurs, instead of always returning 200. Fixes #266, see upstream Issue [1] [1]: https://mantisbt.org/bugs/view.php?id=34634 --- Source/MantisSourceBase.class.php | 2 +- docs/CHANGELOG.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/MantisSourceBase.class.php b/Source/MantisSourceBase.class.php index e4ac07e82..6ee02c309 100644 --- a/Source/MantisSourceBase.class.php +++ b/Source/MantisSourceBase.class.php @@ -26,5 +26,5 @@ abstract class MantisSourceBase extends MantisPlugin * Used to define the default MantisCore dependency for all child plugins; * VCS plugins may override this based on their individual requirements. */ - const MANTIS_VERSION = '2.26.0'; + const MANTIS_VERSION = '2.26.4'; } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d08770c81..668df2a3d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -12,6 +12,11 @@ specification. ## [Unreleased] +### Fixed + +- checkin.php returning HTTP 200 when errors occur + [#266](https://github.com/mantisbt-plugins/source-integration/issues/266) + ## [2.8.0] - 2024-09-06 From 2b8b7a9e6f72a054640432dc7a66de6501359875 Mon Sep 17 00:00:00 2001 From: Scott Bradford Date: Fri, 17 Jan 2025 16:15:36 -0500 Subject: [PATCH 3/7] Gitweb: find parent commits with pathinfo URLs The current RegEx string only works when Gitweb is creating the links on the page with 'standard' URLs. Modify RegEx to support finding parent commit ID when GitWeb is using pathinfo-formatted URLs [1]. Fixes #418 [1]: https://git-scm.com/docs/gitweb#_path_info_usage Signed-off-by: Damien Regad --- SourceGitweb/SourceGitweb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index 69e70f93b..3b30f8ad4 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -355,7 +355,7 @@ private function commit_changeset( $p_repo, $p_input, $p_branch='' ) { $t_commit['message'] = trim( str_replace( '
', PHP_EOL, $t_matches[6] ) ); $t_parents = array(); - if ( preg_match_all( '#parent<[^>]*h=([0-9a-f]*)#', $t_gitweb_data, $t_matches ) ) { + if ( preg_match_all( '#parent<[^>]*(?:h=|/commit/)([0-9a-f]*)#', $t_gitweb_data, $t_matches ) ) { foreach( $t_matches[1] as $t_match ) { $t_parents[] = $t_commit['parent'] = $t_match; } From d341ed4b5de5c624fef7e1c194f8c62cb0813170 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Fri, 17 Jan 2025 22:30:37 +0100 Subject: [PATCH 4/7] Update Changelog --- docs/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 668df2a3d..ce953f04d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -12,10 +12,20 @@ specification. ## [Unreleased] +### Changed + +- Minimum MantisBT version increased to 2.26.4 + [#266](https://github.com/mantisbt-plugins/source-integration/issues/266) + [#380](https://github.com/mantisbt-plugins/source-integration/issues/380) + ### Fixed - checkin.php returning HTTP 200 when errors occur [#266](https://github.com/mantisbt-plugins/source-integration/issues/266) +- github: API token causes webhook to fail silently + [#380](https://github.com/mantisbt-plugins/source-integration/issues/380) +- gitweb: find parent commits with pathinfo URLs + [#418](https://github.com/mantisbt-plugins/source-integration/issues/418) ## [2.8.0] - 2024-09-06 From 3132addb9b5e1bd47b11b66b7ce785e373526a65 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Fri, 17 Jan 2025 22:32:48 +0100 Subject: [PATCH 5/7] Bump version to 2.9.0 VCS plugins changes: - SourceGitweb 2.1.2 --- Source/MantisSourceBase.class.php | 2 +- SourceGitweb/SourceGitweb.php | 2 +- docs/CHANGELOG.md | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/MantisSourceBase.class.php b/Source/MantisSourceBase.class.php index 6ee02c309..7b085208a 100644 --- a/Source/MantisSourceBase.class.php +++ b/Source/MantisSourceBase.class.php @@ -19,7 +19,7 @@ abstract class MantisSourceBase extends MantisPlugin * a change in the minimum required MantisBT version: 0=1.2; 1=1.3, 2=2.x. * The framework version is incremented when the plugin's core files change. */ - const FRAMEWORK_VERSION = '2.9.0-dev'; + const FRAMEWORK_VERSION = '2.9.0'; /** * Minimum required MantisBT version. diff --git a/SourceGitweb/SourceGitweb.php b/SourceGitweb/SourceGitweb.php index 3b30f8ad4..91a5cc0a5 100644 --- a/SourceGitweb/SourceGitweb.php +++ b/SourceGitweb/SourceGitweb.php @@ -11,7 +11,7 @@ class SourceGitwebPlugin extends MantisSourceGitBasePlugin { - const PLUGIN_VERSION = '2.1.1'; + const PLUGIN_VERSION = '2.1.2'; const FRAMEWORK_VERSION_REQUIRED = '2.5.0'; public $type = 'gitweb'; diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ce953f04d..df809459e 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,7 +10,7 @@ specification. # Releases for MantisBT 2.x -## [Unreleased] +## 2.9.0 - 2025-01-17 ### Changed @@ -707,8 +707,9 @@ Support for the 0.x branch ended on 2017-06-30. ## [0.9] - 2008-04-11 -[Unreleased]: https://github.com/mantisbt-plugins/source-integration/compare/v2.8.0...HEAD +[Unreleased]: https://github.com/mantisbt-plugins/source-integration/compare/v2.9.0...HEAD +[2.9.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.78.0...v2.9.0 [2.8.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.7.0...v2.8.0 [2.7.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.6.0...v2.7.0 [2.6.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.5.2...v2.6.0 From 7a0d70f417589c9ac9ed9b6b147a2c36a5509f61 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sun, 26 Jan 2025 12:48:13 +0100 Subject: [PATCH 6/7] Convert Changeset timestamp to UTC before saving This fixes display of the commit time in the wrong timezone when the original commit received from source control contains timezone info as was the case with SourceGitea plugin. Fixes #419 (originally reported in PR #416) --- Source/Source.API.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Source.API.php b/Source/Source.API.php index 9b8ba6ed1..c50ccdafe 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -954,7 +954,10 @@ function save() { # Commit timestamp: can't use DATE_ATOM format to insert datetime, # as MySQL < 8.0.19 does not support specifying timezone # @see https://dev.mysql.com/doc/refman/8.0/en/datetime.html - $t_timestamp = $this->timestamp->format( 'Y-m-d H:i:s' ); + # so we convert the timestamp to UTC first. + $t_timestamp = $this->timestamp + ->setTimezone( new DateTimeZone( 'UTC' ) ) + ->format( 'Y-m-d H:i:s' ); if ( 0 == $this->id ) { # create $t_query = "INSERT INTO $t_changeset_table ( repo_id, revision, parent, branch, user_id, From 389c1cb66d423a41460aebba9ddad23f4557e811 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sun, 26 Jan 2025 12:52:19 +0100 Subject: [PATCH 7/7] Bump version to 2.9.1 --- Source/MantisSourceBase.class.php | 2 +- docs/CHANGELOG.md | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/MantisSourceBase.class.php b/Source/MantisSourceBase.class.php index 7b085208a..98331db58 100644 --- a/Source/MantisSourceBase.class.php +++ b/Source/MantisSourceBase.class.php @@ -19,7 +19,7 @@ abstract class MantisSourceBase extends MantisPlugin * a change in the minimum required MantisBT version: 0=1.2; 1=1.3, 2=2.x. * The framework version is incremented when the plugin's core files change. */ - const FRAMEWORK_VERSION = '2.9.0'; + const FRAMEWORK_VERSION = '2.9.1'; /** * Minimum required MantisBT version. diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index df809459e..82a89b21d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,14 @@ specification. # Releases for MantisBT 2.x +## 2.9.1 - 2025-01-26 + +### Fixed + +- Commits time is displayed in the wrong timezone + [#419](https://github.com/mantisbt-plugins/source-integration/issues/419) + + ## 2.9.0 - 2025-01-17 ### Changed @@ -707,9 +715,10 @@ Support for the 0.x branch ended on 2017-06-30. ## [0.9] - 2008-04-11 -[Unreleased]: https://github.com/mantisbt-plugins/source-integration/compare/v2.9.0...HEAD +[Unreleased]: https://github.com/mantisbt-plugins/source-integration/compare/v2.9.1...HEAD -[2.9.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.78.0...v2.9.0 +[2.9.1]: https://github.com/mantisbt-plugins/source-integration/compare/v2.9.0...v2.9.1 +[2.9.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.8.0...v2.9.0 [2.8.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.7.0...v2.8.0 [2.7.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.6.0...v2.7.0 [2.6.0]: https://github.com/mantisbt-plugins/source-integration/compare/v2.5.2...v2.6.0