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

FYI F-Droid disabled Autoupdate #1163

Closed
licaon-kter opened this issue May 8, 2020 · 14 comments
Closed

FYI F-Droid disabled Autoupdate #1163

licaon-kter opened this issue May 8, 2020 · 14 comments

Comments

@licaon-kter
Copy link

...as it wasn't really working anyway: https://gitlab.com/fdroid/fdroiddata/-/commits/30c91f91e4b14385743253059fd7476dffb36678/metadata/de.blau.android.yml and we needed to manually fix it

In theory we could use: https://f-droid.org/en/docs/Build_Metadata_Reference/#UpdateCheckMode and grep https://github.com/MarcusWolschon/osmeditor4android/blob/master/src/main/AndroidManifest.xml and https://github.com/MarcusWolschon/osmeditor4android/blob/master/src/main/res/values/appname.xml to get versionCode/Name, but you update them at the start of the development and there's no corresponding Tag at that point so that does not help either.

So, in the future, after each release, someone needs to come and open a MR adding the new version, or at least inform us and, as time permits, we can update it.

@simonpoole
Copy link
Collaborator

simonpoole commented May 8, 2020

I'm not quite sure how this went from working to broken (given that we haven't changed our versioning for literally years).

All releases are tagged, only tags with a trailing ".0" need to be considered (all other ones are beta or other development releases),

UpdateCheckMode: Tags ^[0-9]+\.[0-9]+\.[0-9]+\.0$

seems to correctly do that. The android version code can be retrieved from the manifest that is again completely standard. The version name is hidden away in a resource file, but the tag can simply be used instead of that, and that seems to be what you are doing in any case.

In summary we don't seem to be doing anything that would cause things to break and given that it used to work I'm not sure what to do to fix the issue.

@licaon-kter
Copy link
Author

Update check mode is either Tags or HTTP, not both. If the data grepped via HTTP points to a version not-yet tagged we can't build anything. The easiest solution, with HTTP, is for you to update the versionName/Code just before tagging, aka at the end of the version development, not like right now.

I'm not quite sure how this went from working to broken (given that we haven't changed our versioning for literally years).

Not sure, maybe a fdroidserver change.

Log: https://gist.github.com/licaon-kter/48c6202e3fbb88df88b66f537cd2eadf

Ref: https://gitlab.com/fdroid/fdroidserver/-/issues/751

@simonpoole
Copy link
Collaborator

simonpoole commented May 8, 2020

Update check mode is either Tags or HTTP, not both. If the data grepped via HTTP points to a version not-yet tagged we can't build anything. The easiest solution, with HTTP, is for you to update the versionName/Code just before tagging, aka at the end of the version development, not like right now.

Why would you build a version that hasn't been tagged? Sorry, but none of the above makes any sense at all.

When you checkout the latest tag version you will always have correct versions so why would it on earth matter what they are before or after the tag was created (not to mention that normally I do actually bump the versions immediately before tagging)?

Looking at the log it seems the -actual- problem is totally clear:

DEBUG: Parsing manifest at 'build/de.blau.android/src/main/AndroidManifest.xml'
DEBUG: ..got package=de.blau.android, version=14.1.4.0, vercode=1407
DEBUG: Parsing manifest at 'build/de.blau.android/build.gradle'
DEBUG: Adding possible subdir .
DEBUG: Parsing manifest at 'build/de.blau.android/src/main/AndroidManifest.xml'
DEBUG: ..got package=de.blau.android, version=14.1.4.0, vercode=1407
DEBUG: Parsing manifest at 'build/de.blau.android/build.gradle'
DEBUG: Manifest exists in subdir '.'. Found version ${project.getVersionName()} (1407)
DEBUG: Parsing manifest at 'build/de.blau.android/src/main/AndroidManifest.xml'
DEBUG: ..got package=de.blau.android, version=14.1.4.0, vercode=1407
DEBUG: Adding possible subdir src/main
DEBUG: Parsing manifest at 'build/de.blau.android/src/main/AndroidManifest.xml'
DEBUG: ..got package=de.blau.android, version=14.1.4.0, vercode=1407
DEBUG: Manifest exists in subdir 'src/main'. Found version 14.1.4.0 (1407)
DEBUG: Parsing manifest at 'build/de.blau.android/src/current/AndroidManifest.xml'
DEBUG: ..got package=de.blau.android, version=None, vercode=None
DEBUG: Adding possible subdir src/current
DEBUG: Parsing manifest at 'build/de.blau.android/src/current/AndroidManifest.xml'
DEBUG: ..got package=de.blau.android, version=None, vercode=None
DEBUG: Parsing manifest at 'build/de.blau.android/src/androidTest/AndroidManifest.xml'
DEBUG: ..got package=None, version=None, vercode=None

You are grepping through all the different manifest files and are zapping package, version and vercode when they are not present in the specific manifest. But given manifests are actually merged at build time this is totally correct (that the version information isn't present) and avoids duplicating information and potentially having conflicting information in the manifests.

PS: and while I can't prove this, I suspect the reason why it was previously working was simply because the manifest files were processed in a different order.

@licaon-kter
Copy link
Author

Again, fdroid can either use the Tag and versionCode/Name from build.gradle/.kts and/or AndroidManifest.xml OR get info from those files, not BOTH, not right now.

@simonpoole
Copy link
Collaborator

Then "don't do that", just use the Tag.

I think you are assuming something wrong here: that the maintainers and developers of this app have something to do with the build process on f-droid, but we have absolute zero, zilch, nada to do with it. I'm happy to help with debugging and historically we've adapted certain things to help f-droid, after all it provides an important service to users that don't want to use any of the commercial app stores, but that is exactly where the line is.

@licaon-kter
Copy link
Author

Of course, my post was just a PSA so you know when users report bugs or complain that their version is old. :)

@licaon-kter
Copy link
Author

@jspricke
Copy link

I have extended F-Droid to support autoupdate for this app and enabled it:
https://gitlab.com/fdroid/fdroiddata/-/commit/d8356c8ed75378e95de05c5cc8dd5da8c6ddc6f0
I guess this can be closed.

@simonpoole
Copy link
Collaborator

simonpoole commented Jun 17, 2021

Thanks @jspricke

Just to be clear, this means that f-droid no longer has the issue that it is not checking out the tagged branch and due to that it found an unexpected version?

https://gitlab.com/fdroid/fdroidserver/-/merge_requests/937 would seem to indicate that the answer is "yes", so thanks again.

@jspricke
Copy link

Just to be clear, this means that f-droid no longer has the issue that it is not checking out the tagged branch and due to that it found an unexpected version?

yes

@simonpoole
Copy link
Collaborator

@jspricke

The build is currently failing https://f-droid.org/wiki/page/de.blau.android/lastbuild_1704 unluckily the log is not very helpful

Pinging @Bubu

@jspricke
Copy link

You can find the full build log here: https://monitor.f-droid.org/builds/log/de.blau.android/1704
It was already fixed:
https://gitlab.com/fdroid/fdroiddata/-/commit/74e891af5ae47058b04fbc1714000c408bdd8bd8#49fd777b5e286fa060feabc311254c1af436568e
and
https://gitlab.com/fdroid/fdroiddata/-/commit/f77b8a6507708abf73bd94f866e27bc5d6642ff4

so it should be build in the next cycle.

Btw. the wiki is not really maintained anymore, try https://monitor.f-droid.org/builds/running instead.

@simonpoole
Copy link
Collaborator

Thanks

Btw. the wiki is not really maintained anymore, try https://monitor.f-droid.org/builds/running instead.

Well I was just following the links on https://f-droid.org/en/packages/de.blau.android/ which I suspect you are saying should be changed?

@jspricke
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants