Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Show changelog - GSoC Expand Extensions Manager #17536

Closed
wants to merge 47 commits into from

Conversation

@NunoLopesPT
Copy link

NunoLopesPT commented Aug 14, 2017

Introduction

At this time, users have to look for external sources of information about changes in an extension, when they are going to update their extensions. In most cases, users install an extension without checking the changelog due to the difficulty to find the associated changelog. With this new feature, users can review the changelog of the extensions when they are about to install an update (granted that the changelog is provided by the extension's developer), and after the extension is installed.

Summary of Changes

Added a new parameter on the xml updateserver files 'changelogurl' and adding it to #__updates table.

Testing Instructions

I made some changes in the core databases so before testing you should fix your database:

screenshot from 2017-07-24 21-36-09

Extensions -> Database -> Fix
Extensions -> Updates -> Find Updates

Update View

Install my component: https://github.com/NunoLopes96/component_joomla
By default you will have always an update from 0.0.2 to 4.0.0 just for testing

If the changelog is not available it will show N/A like in the Folder column

screenshot from 2017-05-23 18-28-40

It will open a modal with an iframe of the changelogurl in the body.
The title of the modal is version ' - ' component_name

screenshot from 2017-05-17 19-54-50

Manage View

The changelogurl is supported for Components, Libraries, Modules, Plugins and Packages, you just need to add tags in your instalation xml with a valid url inside.

To test this you can use these modified packages:

(To test Package, Component, Module, Plugin)
pkg_weblinks_3.4.1-changelog.zip
screenshot from 2017-07-06 12-34-02

(To test Libraries)
lib_fof30-3.1.0-changelog.zip
screenshot from 2017-07-06 12-34-49

(To test languages)
The language installer its diferent from the others so you may want to test 2 cases:
1-Install without having it already in your extensions
2-Install without changelogurl and then install again with a changelogurl

This happens because it has 1 function to install and another one to update ( they are similar )

admin_pt-PT.zip
Extension name: Português (pt-PT)

(To test templates)
et_kidtoy_joomla_template_install_package_free.zip
Extension name: etkidtoy

(To test Files)
cli2zoombie.zip
Extension name: Zoombie - CLI Application

Expected result

In Updates View you will have a new column that will show a changelog button to open a modal if there is a changelogurl in the #__updates table.
In Manage View you will have an tag in the version with a info icon on the right side if your extension has a changelogurl in the #__extensions table.

Documentation Changes Required

Add changelogurl parameter on updatesite information and in extension

NunoLopesPT added 30 commits May 17, 2017
roland-d added 3 commits Jun 10, 2018
@roland-d

This comment has been minimized.

Copy link
Contributor

roland-d commented Jul 1, 2018

I have started to bring this PR inline with the 4.0-dev codebase and work out the issues and improve the featureset.

I am sure @Quy will help me with codestyle :) Now I also need help with styling the modal containing the updates. Have a look at this:
image

This contains all the possible sections that are available. @ciar4n is this something you can help me with?

As for the changelog.xml I am now using this format, any feedback for this is appreciated as well.

<?xml version="1.0" encoding="utf-8"?>
<changelogs>
    <changelog>
        <element>com_lists</element>
        <type>component</type>
        <version>0.0.4</version>
	<entries>
        <security>
            <item>CVE 1</item>
            <item>CVE 2</item>
        </security>
        <fix>
            <item>FIX 1</item>
            <item>FIX 2</item>
        </fix>
        <language>
            <item>LANG 1</item>
            <item>LANG 2</item>
        </language>
        <addition>
            <item>ADD 1</item>
            <item>ADD 2</item>
        </addition>
        <change>
            <item>CHANGE 1</item>
            <item>CHANGE 2</item>
        </change>
        <removed>
            <item>REMOVE 1</item>
            <item>REMOVE 2</item>
        </removed>
        <note>
            <item>NOTE 1</item>
            <item>NOTE 2</item>
        </note>
</entries>
    </changelog>
</changelogs>

This PR is not ready yet but I would appreciate feedback already so we can get this into a ready state.

COM_INSTALLER_CHANGELOG="Changelog"
COM_INSTALLER_CHANGELOG_SECURITY="Security Fixes"
COM_INSTALLER_CHANGELOG_FIX="Bug Fixes"
COM_INSTALLER_CHANGELOG_LANGUAGE="Changelog"

This comment has been minimized.

Copy link
@brianteeman

brianteeman Jul 1, 2018

Contributor

why is this _LANGUAGE ?? or is it the "Changelog" that is wrong?

This comment has been minimized.

Copy link
@roland-d

roland-d Jul 2, 2018

Contributor

It is actually "Changelog" that is wrong. This needs to be "Language" as it is about language file changes listed in the changelog.

This comment has been minimized.

Copy link
@brianteeman

brianteeman Jul 2, 2018

Contributor

Thanks

@@ -257,7 +258,7 @@ protected function finaliseUninstall(): bool
}
catch (\RuntimeException $e)
{
\JLog::add(\JText::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION', $e->getMessage()), \JLog::WARNING, 'jerror');
\JLog::add(Text::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION', $e->getMessage()), \JLog::WARNING, 'jerror');

This comment has been minimized.

Copy link
@brianteeman

brianteeman Jul 1, 2018

Contributor

please namespacce JLog

+use Joomla\CMS\Log\Log;

roland-d added 2 commits Jul 2, 2018
</td>
</tr>
<tr>
<td colspan="9">

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Change to 10

@@ -6,6 +6,14 @@
COM_INSTALLER="Installer"
COM_INSTALLER_AUTHOR_INFORMATION="Author Information"
COM_INSTALLER_CACHETIMEOUT_LABEL="Updates Caching (in hours)"
COM_INSTALLER_CHANGELOG="Changelog"

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Sort keys in alpha order

This comment has been minimized.

Copy link
@roland-d

roland-d Jul 2, 2018

Contributor

@Quy What is not sorted here? CA is before CH.

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Sort keys from lines 10 - 16.

This comment has been minimized.

Copy link
@roland-d

roland-d Jul 2, 2018

Contributor

All done.

$this->parent->extension->manifest_cache = json_encode($manifest_details);
$this->parent->extension->name = $manifest_details['name'];
$this->parent->extension->name = $manifest_details['name'];
if ($this->parent->extension->store())
{
return true;
}
else

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

No need to be in else statement.

<?php echo $item->type_translated; ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php if ($item->version != ''): ?>

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Add space before :

</td>
<td class="d-none d-md-table-cell text-center">
<?php if ($item->version != ''): ?>
<?php if ($item->changelogurl != null): ?>

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Add space before :

<span class="badge badge-success"><?php echo $item->version; ?></span>
</td>
<td class="d-none d-md-table-cell text-center">
<?php if ($item->changelogurl != null):?>

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Add space before and after :

'<iframe src="' . $item->changelogurl . '"></iframe>');
?>

<?php else:?>

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Add space before and after :


<?php else:?>
<span>
<?php echo Text::_('COM_INSTALLER_TYPE_NONAPPLICABLE')?>

This comment has been minimized.

Copy link
@Quy

Quy Jul 2, 2018

Contributor

Add ; and space

roland-d added 2 commits Jul 2, 2018
@wilsonge

This comment has been minimized.

Copy link
Contributor

wilsonge commented Jul 2, 2018

I don't think you need the type in your schema. This living on a foreign server where you are already matching against the element so I don't see what value it's providing?

Additionally I think we only need fix and note - not change - they should be covered by the other things

@roland-d

This comment has been minimized.

Copy link
Contributor

roland-d commented Jul 3, 2018

@wilsonge The reason the type is there is because we have it that way in the update XMLs as well. The only reason I took it as well is because I figured we can use it for better checking we have the correct type.

Additionally I think we only need fix and note - not change - they should be covered by the other things

As an extension developer I use all of them to clearly identify where the entry belongs to. Each has their own merit to me at least. I don't see any harm in offering them, extension developers don't have to use them of course. They are there for those who want to use more distinction.

@brianteeman

This comment has been minimized.

Copy link
Contributor

brianteeman commented Jul 3, 2018

Agree with roland - hardly changelog without listing any changes ;)

@roland-d

This comment has been minimized.

Copy link
Contributor

roland-d commented Feb 26, 2019

Closing this as I can't push to the repo anymore. Continuing in #24026

@roland-d roland-d closed this Feb 26, 2019
wilsonge added a commit that referenced this pull request Mar 25, 2019
…4026)

Thanks to @NunoLopes96 for the majority of the work on this!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.