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

Add support for renaming plugin name #302

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

Xpirix
Copy link
Collaborator

@Xpirix Xpirix commented Nov 7, 2023

@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2023

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 ⚠️
qgis-app/plugins/views.py 0.00% 4 Missing ⚠️

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dimasciput
Copy link
Collaborator

Hi @Xpirix , can you add unit tests please?

@PeterPetrik
Copy link

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
Copy link
Collaborator Author

Xpirix commented Nov 8, 2023

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
Copy link
Collaborator Author

Xpirix commented Nov 8, 2023

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

@PeterPetrik
Copy link

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
Copy link
Collaborator Author

Xpirix commented Nov 13, 2023

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
Copy link

PeterPetrik commented Nov 13, 2023

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
Copy link
Collaborator Author

Xpirix commented Nov 13, 2023

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
Copy link

👏

@PeterPetrik
Copy link

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

@dimasciput dimasciput merged commit 694b2e1 into qgis:master Nov 20, 2023
2 checks passed
@Xpirix
Copy link
Collaborator Author

Xpirix commented Nov 20, 2023

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

@Xpirix
Copy link
Collaborator Author

Xpirix commented Nov 22, 2023

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

@PeterPetrik
Copy link

Very good, thanks

@Xpirix
Copy link
Collaborator Author

Xpirix commented Nov 22, 2023

My pleasure.

@Xpirix Xpirix deleted the support_rename_plugin branch January 2, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants