-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
New version details extracted from git master vs last release #1040
Comments
Git Updater gets all its information via API calls from the designated branch. If you are tagging releases then the download package comes from the latest release. Data is cached for 12 hours. If you are developing on your primary branch it's possible that some stale data is present. Perhaps I'm not understanding? |
Here is an example: https://github.com/qTranslate/qtranslate-xt. On some of my prod site I was lagging behind, it proposed to install 3.14.0. In the details it shown the requirements as PHP7.1 and WP5.0 which is inconsistent with that release. It should have taken the info from 3.14.0, not the last one from master. Or there's something else I'm missing. |
The WordPress and PHP requirements are taken from the main plugin file and are consistent with what you have presented. |
Consistent with what? If it's taken from master it's not consistent with the last release. The info that is shown is not what is going to be installed. |
Last release is not the same as last commit. |
If I understand how it works, |
There is no data extracted from a tagged release. The only data re: tag is the download package of the latest tag. All other data obtained from the primary branch. The WP/PHP requirements are taken from the main plugin file. https://developer.wordpress.org/plugins/plugin-basics/header-requirements/#header-fields |
Since you have already committed the WP/PHP requirements to the primary branch, Git Updater has found them and uses them. |
But git-updater installs the tagged version, not the last commit, doesn't it? |
The tag is returned from an API call. |
Thanks for this information. I'll dig a bit into it and see if there's something possible (it would be an improvement in that case). |
My logic would be: That would make the following installation consistent with the information retrieved in (3). |
The problem is you are actively working in your release branch. If you want to do that I would recommend you not update the version until you are ready to tag a release. Otherwise I would suggest a git flow style of development. |
What you're describing above is not how this plugin works. |
What does that mean? The release branch is
That's what I already do. When a new version is released, I update the plugin version and tag the release. That's what |
For very big projects maybe several release branches are useful when maintaining multiple lines (e.g. fixes in version 1.x - while version 2.x is going forward). Maybe that's what you meant? But for smaller projects that's usually not the case, a single Anyway I don't think the branches change the logic of the release information. Given a branch (that is required by git-updater), the question remains the same - how to sync the information before install with the version that is effectively downloaded? the reference should always be the same. |
Git Updater parses no data from any specific commit or tag. It only parses data from a branch. I'm not really understanding what the issue seems to be. Is the data reported not present in the master branch in the main plugin file? |
It's not enough to reason in terms of branches. What identifies and defines strictly a git version is the commit SHA and nothing else. A tag is simply a shortcut to mark a given commit. A branch is nothing more than a HEAD pointing to the last commit. As far as I know there's no special relation between tags and branches.
Problem: (2) is what git-updater takes, but this is inconsistent with (1), the release that will be downloaded. It shows the information of a future release. It assumes the HEAD is pointing to the tagged commit but that assumption is wrong as soon as there's a new commit in that branch. |
Ideally I would also like to increase the plugin version in master (HEAD) before release to show for example |
This is the data parsed from the main plugin file. Your issue subject is exactly correct. No data is parsed from a specific commit, tag, or release. All data is parsed via API calls to the specified repository branch and the main plugin file in that branch. I'm sorry if Git Updater doesn't behave like you want it to behave. If you have data in the main plugin file that is the primary data Git Updater uses. If you have tagged releases and Git Updater identifies a higher remote version from the data in the main plugin file then an update will register and Git Updater assumes that since you tag your releases that the I invite you to read through the Knowledge Base to gain a better understanding of how Git Updater functions. |
It's not so much for me but for all the users of git-updater. There must be a way to retrieve the right commit with the API. |
Again, that is not the problem. The problem is the process before download tha assumes the branch of reference is frozen. This doesn't make sense for a |
What do you expect to happen? What do you see happening? |
Here is my suggestion, it should be pretty simple:
So thanks to the tag we don't even need to worry about the commit SHA. |
In fact as a direct benefit, I think this would fix the problem of "update loops" when the plugin version is changed in the working branch, before creating a release. That would give more flexibility to the developers, a nice improvement IMO :) |
The main philosophy is that git-updater only cares about the git releases. With this you could even remove the concept of required branch as a user parameter? Even if there are multiple lines of versions, the relevant part should be what the developer tick as "the latest release" (there's a checkbox). That should be the only reference extracted by step (1). |
Indeed I don't understand how the "Enable Branch Switching" feature works. Since there's an API call to get the latest release that is not related to any branch parameter, what is the meaning of setting a different branch? One more advanced feature that could be interesting for developers is to check for the last commit in a given branch. But in that case you would ignore the latest release. It would be a different mode. As I see it
|
Any update or future plan about this? Branches and releases are orthogonal concepts in git. Reasoning with the "last release" should not involve the need for specifying any branch. Conversely, specifying a branch eliminates the need to look at the releases. Both parts are exclusive. |
When a new version is available,
git-updater
seems to extract the version details from the latest commit ofmaster
. In the changelog tab it shows "Requires WordPress Version" and "Requires PHP Version".However these data may have changed in
master
thoughgit-updater
is supposed to extract the last Release, not the last commit inmaster
. So the information that is shown is incorrect, it doesn't correspond to the version deployed bygit-updater
which is confusing for system admins who deal with the requirements.Also, in the Knowledge Base I can't find how the data are extracted. Is if from README or the plugin PHP file?
The text was updated successfully, but these errors were encountered: