Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
composer_deploy
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
composer_deploy
Commits
90579427
Commit
90579427
authored
6 months ago
by
Florian Weber
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3076170
by webflo: Prevent notice/error if composer_deploy_git_hash is not found.
parent
ba03fe8f
No related branches found
No related tags found
No related merge requests found
Pipeline
#309084
passed with warnings
6 months ago
Stage: build
Stage: validate
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
composer_deploy.module
+13
-7
13 additions, 7 deletions
composer_deploy.module
with
13 additions
and
7 deletions
composer_deploy.module
+
13
−
7
View file @
90579427
...
...
@@ -93,16 +93,22 @@ function composer_deploy_preprocess_update_project_status(&$variables) {
$extensionName
=
array_key_first
(
$projects
[
$variables
[
'project'
][
'name'
]][
'includes'
]);
$projectData
=
\Drupal
::
service
(
'extension.list.'
.
$project_type
)
->
getExtensionInfo
(
$extensionName
);
foreach
(
$variables
[
'versions'
]
as
&
$
version
)
{
$currentVersion
=
$variables
[
'project'
][
'existing_version'
];
// Replace our current version with the specific hash when on -dev release.
if
(
s
ubstr
(
$variables
[
'project'
][
'existing_version'
],
-
3
)
==
'dev'
)
{
$currentVersion
=
$projectData
[
'composer_deploy_git_hash'
];
}
$currentVersion
=
$variables
[
'project'
][
'existing_
version
'
];
// Replace our current version with the specific hash when on -dev release.
if
(
s
tr_ends_with
(
$variables
[
'project'
][
'existing_version'
],
'dev'
)
)
{
$currentVersion
=
$projectData
[
'composer_deploy_git_hash'
]
??
NULL
;
}
// Unable to detect current version (git reference)
if
(
$currentVersion
===
NULL
)
{
return
;
}
foreach
(
$variables
[
'versions'
]
as
&
$version
)
{
$upstreamVersion
=
$version
[
'#version'
][
'tag'
];
// When the upstream is using dev, switch to branch tag.
if
(
s
ubstr
(
$version
[
'#version'
][
'tag'
],
-
3
)
==
'dev'
)
{
if
(
s
tr_ends_with
(
$version
[
'#version'
][
'tag'
],
'dev'
)
)
{
$upstreamVersion
=
substr
(
$version
[
'#version'
][
'tag'
],
0
,
-
4
);
}
...
...
This diff is collapsed.
Click to expand it.
Florian Weber
@webflo
mentioned in merge request
!3 (closed)
·
6 months ago
mentioned in merge request
!3 (closed)
mentioned in merge request !3
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment