Skip to content

feat: added suggested feeds to the Search UI#964

Merged
spacecowboy merged 22 commits into
spacecowboy:masterfrom
JaredTweed:master
Nov 2, 2025
Merged

feat: added suggested feeds to the Search UI#964
spacecowboy merged 22 commits into
spacecowboy:masterfrom
JaredTweed:master

Conversation

@JaredTweed

Copy link
Copy Markdown
Contributor

This will just make building easier for a lot of people; incentivizing more people to contribute.

@JaredTweed JaredTweed changed the title Improved build file Improved build file & made search suggestions work when adding a feed Oct 28, 2025
@spacecowboy

Copy link
Copy Markdown
Owner

Please do not modify gradle build scripts. There are release automations that depend on it not changing.

Instead please describe what you see as an issue and I can advise you what needs to be changed to togher, or similar.

@spacecowboy

Copy link
Copy Markdown
Owner

Regarding the other changes

  • Could you post some screenshots of your changes
  • How did you come up with the suggestions in the list? How can it be reproduced?

@spacecowboy spacecowboy changed the title Improved build file & made search suggestions work when adding a feed feat: added suggested feeds to the Search UI Oct 29, 2025
@spacecowboy spacecowboy self-assigned this Oct 29, 2025
@JaredTweed

Copy link
Copy Markdown
Contributor Author

Please do not modify gradle build scripts. There are release automations that depend on it not changing.

Instead please describe what you see as an issue and I can advise you what needs to be changed to togher, or similar.

The build had two issues for me:

  1. Hard-coded Java 17 toolchain fails on machines with only JDK 21
    • kotlin { jvmToolchain(17) } enforces JDK 17. On Fedora 42 and newer macOS setups, the system default is JDK 21; Gradle then throws Cannot find a Java installation … matching languageVersion=17.
    • In CI the legacy toolchain is present, but on contributor machines (including mine) it blocks any compose/AGP build until a second JDK is installed manually. I worked around it by picking max(17,
      currentJdkVersion).
  2. Git commands break configuration-cache / sparse clones
    • providers.exec { commandLine("git", …) } is invoked during configuration (lines 13–34/40 in tip-of-tree).
    • When Gradle’s configuration cache is enabled—as Android Studio now does by default—the build aborts because configuration-time process execution is disallowed (Process 'command 'git'' finished with non-
      zero exit value 128).
    • The same failure appears for users who fetch the source without git history (e.g., zip download or shallow checkout), where git describe/rev-list return 128.
    • I added fallbacks (gitOutputOrNull, baseVersionCode/baseVersionName) to keep Play/F-Droid versioning working, but the underlying issue is that the build currently requires a full git repo and no
      configuration cache.

@JaredTweed

JaredTweed commented Oct 29, 2025

Copy link
Copy Markdown
Contributor Author
Screenshot_20251029-124950

Here is a screenshot, just click "Add feed", then start typing.

The suggested feeds list is in here: ./app/src/main/res/raw/suggested_feeds.json

and I expect the list to be continuously growing by other contributers. I just tried to do research to find all the available feeds I could. There is a python file in the same folder than cleans the list and automatically removes anything that is not a working feed.

@spacecowboy

Copy link
Copy Markdown
Owner

Please do not modify gradle build scripts. There are release automations that depend on it not changing.
Instead please describe what you see as an issue and I can advise you what needs to be changed to togher, or similar.

The build had two issues for me:

1. Hard-coded Java 17 toolchain fails on machines with only JDK 21
   
   * kotlin { jvmToolchain(17) } enforces JDK 17. On Fedora 42 and newer macOS setups, the system default is JDK 21; Gradle then throws Cannot find a Java installation … matching languageVersion=17.
   * In CI the legacy toolchain is present, but on contributor machines (including mine) it blocks any compose/AGP build until a second JDK is installed manually. I worked around it by picking max(17,
     currentJdkVersion).

2. Git commands break configuration-cache / sparse clones
   
   * providers.exec { commandLine("git", …) } is invoked during configuration (lines 13–34/40 in tip-of-tree).
   * When Gradle’s configuration cache is enabled—as Android Studio now does by default—the build aborts because configuration-time process execution is disallowed (Process 'command 'git'' finished with non-
     zero exit value 128).
   * The same failure appears for users who fetch the source without git history (e.g., zip download or shallow checkout), where git describe/rev-list return 128.
   * I added fallbacks (gitOutputOrNull, baseVersionCode/baseVersionName) to keep Play/F-Droid versioning working, but the underlying issue is that the build currently requires a full git repo and no
     configuration cache.

Configuration cache works fine for me. The problem for you is that git returned a failure.

My main complaint is that you added baseVersionCode/baseVersionName, which by definition will be out of date, which can introduce silent failures in the release pipeline.

There are already correct values present:

        versionCode = 3813
        versionName = "2.15.1"

The release pipeline knows to how to find these lines and bump them.

The commitCount value is evaluated lazily. So you should not have any problem unless you try to build the play variant. Building the debug flavor (or f-droid) should never invoke git.

@spacecowboy

Copy link
Copy Markdown
Owner

As for the feature itself, I have considered something like it for a long time. But each entry needs to be vetted (by me presumably), so we don't end up with a bunch of nazi feeds or such.

@spacecowboy

spacecowboy commented Oct 30, 2025

Copy link
Copy Markdown
Owner

I'm fine you with fixing the java toolchain stuff

@spacecowboy spacecowboy self-requested a review October 30, 2025 15:46
@JaredTweed

Copy link
Copy Markdown
Contributor Author

As for the feature itself, I have considered something like it for a long time. But each entry needs to be vetted (by me presumably), so we don't end up with a bunch of nazi feeds or such.

Great! I am actually currently scraping all the feeds from sidestack, and we can just make sure it includes all the feeds with greater than 1000 subscribers.

@JaredTweed

Copy link
Copy Markdown
Contributor Author

Please do not modify gradle build scripts. There are release automations that depend on it not changing.
Instead please describe what you see as an issue and I can advise you what needs to be changed to togher, or similar.

The build had two issues for me:

1. Hard-coded Java 17 toolchain fails on machines with only JDK 21
   
   * kotlin { jvmToolchain(17) } enforces JDK 17. On Fedora 42 and newer macOS setups, the system default is JDK 21; Gradle then throws Cannot find a Java installation … matching languageVersion=17.
   * In CI the legacy toolchain is present, but on contributor machines (including mine) it blocks any compose/AGP build until a second JDK is installed manually. I worked around it by picking max(17,
     currentJdkVersion).

2. Git commands break configuration-cache / sparse clones
   
   * providers.exec { commandLine("git", …) } is invoked during configuration (lines 13–34/40 in tip-of-tree).
   * When Gradle’s configuration cache is enabled—as Android Studio now does by default—the build aborts because configuration-time process execution is disallowed (Process 'command 'git'' finished with non-
     zero exit value 128).
   * The same failure appears for users who fetch the source without git history (e.g., zip download or shallow checkout), where git describe/rev-list return 128.
   * I added fallbacks (gitOutputOrNull, baseVersionCode/baseVersionName) to keep Play/F-Droid versioning working, but the underlying issue is that the build currently requires a full git repo and no
     configuration cache.

Configuration cache works fine for me. The problem for you is that git returned a failure.

My main complaint is that you added baseVersionCode/baseVersionName, which by definition will be out of date, which can introduce silent failures in the release pipeline.

There are already correct values present:

        versionCode = 3813
        versionName = "2.15.1"

The release pipeline knows to how to find these lines and bump them.

The commitCount value is evaluated lazily. So you should not have any problem unless you try to build the play variant. Building the debug flavor (or f-droid) should never invoke git.

Oh, okay, I will try building again, with just that java fix, and see if that can work on my computer easily. That was the largest issue for me.

@JaredTweed

Copy link
Copy Markdown
Contributor Author

I think the feature is complete. Let me know if there is anything else to be added. By the way, I created this repo here to scrape the substacks: https://github.com/JaredTweed/sidestack_scraper

@JaredTweed

Copy link
Copy Markdown
Contributor Author

I made the changes as minimal as possible to the build file as I could, and now it builds without any issues.

@spacecowboy

Copy link
Copy Markdown
Owner

There are lint errors. Could you run ./gradlew ktlintformat please

@spacecowboy spacecowboy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small comments. I've tested it and I think it is good enough for a first version of the feature

Comment thread app/build.gradle.kts Outdated
}

val latestTag by project.extra {
if (!file(".git").exists()) return@extra "unknown"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the git command which is giving you the error. latestTag is unused.

  • Can you remove latestTag entirely
  • Move your workaround to commitCount instead, this is the property which is used
val commitCount by project.extra {
    if (!file(".git").exists()) return@extra 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I misunderstood my error somehow. If I remove latestTag (like I have in my most recent commit), I don't get any errors at all. Below is the error latestTag was giving me:

Configuration cache problems found in this build.

1 problem was found storing the configuration cache.
- Build file 'app/build.gradle.kts': failed to compute value with custom source 'org.gradle.api.internal.provider.sources.process.ProcessOutputValueSource' (output of the external process 'git') with org.gradle.process.ProcessExecutionException: Process 'command 'git'' finished with non-zero exit value 128

See the complete report at file:///home/jared/Repos/Feeder/build/reports/configuration-cache/2j05hzxg6syau6294zki64wh3/6iuaoko05omryjk13awau8is4/configuration-cache-report.html
> Process 'command 'git'' finished with non-zero exit value 128
Ask Gemini

@spacecowboy spacecowboy merged commit d00c572 into spacecowboy:master Nov 2, 2025
9 of 12 checks passed

@bretthowell714-source bretthowell714-source left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@spacecowboy

Copy link
Copy Markdown
Owner

Thanks

@bretthowell714-source I am confused how you are assigning and approving PRs but please stop doing that

@bretthowell714-source

Copy link
Copy Markdown

I just started using GitHub I barely even know what I'm doing I'm trying to learn

1 similar comment
@bretthowell714-source

Copy link
Copy Markdown

I just started using GitHub I barely even know what I'm doing I'm trying to learn

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.

3 participants