qgis / QGIS-Django

Django project for QGIS related activities such as plugin repository
http://qgis.org
GNU General Public License v2.0
86 stars 59 forks source link

Add support for renaming plugin name #302

Closed Xpirix closed 7 months ago

Xpirix commented 8 months ago

Please find in here the details for this PR

codecov-commenter commented 8 months ago

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (2057611) 37.76% compared to head (c1c706b) 34.57%.

Files Patch % Lines
qgis-app/plugins/tests/test_rename_plugin.py 31.37% 35 Missing :warning:
qgis-app/plugins/views.py 0.00% 4 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #302 +/- ## ========================================== - Coverage 37.76% 34.57% -3.19% ========================================== Files 96 67 -29 Lines 3948 3803 -145 ========================================== - Hits 1491 1315 -176 - Misses 2457 2488 +31 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dimasciput commented 8 months ago

Hi @Xpirix , can you add unit tests please?

PeterPetrik commented 7 months ago

thanks, Hard for me to understand the PR, but in case we can have new name set and upload new version of the plugin that will not override this new name I am fine :)

Xpirix commented 7 months ago

That's right. The new name will not change until the admin allows to read it from metadata.txt (Not allowed by default). So, the name value in the metadata.txt should be updated according to the new name.

Xpirix commented 7 months ago

Hi @dimasciput , Thank you for reminding me. I've added unit testing for the plugin's rename feature.

PeterPetrik commented 7 months ago

That's right. The new name will not change until the admin allows to read it from metadata.txt (Not allowed by default). So, the name value in the metadata.txt should be updated according to the new name.

So for me as plugin admin, what steps I need to do to update plugin visible name? I am bit confused

Xpirix commented 7 months ago

So for me as plugin admin, what steps I need to do to update plugin visible name? I am bit confused

Apologies for omitting the details in my previous message. Please refer to the screenshot and steps below for guidance on renaming a plugin via the administration page:

2023-11-13_07-39

Plugin Renaming in the Administration Page

  1. Navigate to the plugin of interest from the plugins list.
  2. Access the plugin details and modify the name field.
  3. Save the changes to reflect the updated name in both QGIS and on the plugins website.

Renaming a Plugin in a New Version

When an admin/owner uploads a new version with a name that doesn't match the existing one, an error will be triggered. To override this restriction, administrators can enable the "Allow Update Name" option by checking the corresponding checkbox as mentionned here.

PeterPetrik commented 7 months ago

When an admin/owner uploads a new version with a name that doesn't match the existing one, an error will be triggered.

This is what I do not understand: as a plugin developer, I thought name entry in metadata.txt should stay as the old plugin name, right? see https://docs.qgis.org/3.28/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#metadata-txt

I thought that as plugin developer

  1. I ask super-admin to change plugin name for me in the administrator page
  2. I can still upload my plugin zip via interface without any modification (== with old name)
  3. And my plugin will show the "new" name in QGIS install + web interface Is this correct?

I assume "Allow Update Name" = ON is how the stuff behaves before this PR , right?

Xpirix commented 7 months ago

You are absolutely right. Thanks for the feedbak.

I just fixed that. There is no more error when you upload a plugin zip with the old name that is different form the new name. These processes are correct:

as plugin developer

  1. I ask super-admin to change plugin name for me in the administrator page
  2. I can still upload my plugin zip via interface without any modification (== with old name)
  3. And my plugin will show the "new" name in QGIS install + web interface
PeterPetrik commented 7 months ago

👏

PeterPetrik commented 7 months ago

Great, let me know when this is released, so we can fix the name of Mergin plugin. Thanks!

Xpirix commented 7 months ago

@PeterPetrik Sure, we will let you know when this is released.

Xpirix commented 7 months ago

Dear @PeterPetrik, these changes are now released on the plugin website.

PeterPetrik commented 7 months ago

Very good, thanks

Xpirix commented 7 months ago

My pleasure.