Skip to content

[WIP] Fix F-Droid index-v1.json parsing error causing workflow failure#9

Merged
sharpninja merged 1 commit intodevelopfrom
copilot/fix-fdroid-json-parsing-error
Feb 17, 2026
Merged

[WIP] Fix F-Droid index-v1.json parsing error causing workflow failure#9
sharpninja merged 1 commit intodevelopfrom
copilot/fix-fdroid-json-parsing-error

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Fix F-Droid index-v1.json parsing error causing workflow failure

Problem:
The workflow fails at the "Verify F-Droid repo APK hash" step with:

AttributeError: 'str' object has no attribute 'get'
  File "<stdin>", line 34, in <module>

This occurs at line 447 in .github/workflows/build-deploy.yml where the Python script assumes data.get('packages', []) returns a flat list of dictionaries. However, F-Droid's index-v1.json actually structures packages as a nested dictionary: {"package.id": [{...}, {...}]}, where each package ID maps to a list of version objects.

Required Fix:
Update the Python validation script in .github/workflows/build-deploy.yml (lines 444-453) to:

  1. Change from iterating over a flat list to iterating over the nested dictionary structure
  2. Use .items() to iterate over package IDs and their version lists
  3. Add isinstance() type checks to safely handle the list of version objects
  4. Maintain all existing hash and version validation logic

Expected code change:
Replace:

for p in data.get('packages', []):
    if p.get('apkName') == apkname:

With:

packages = data.get('packages', {})
for pkg_id, pkg_list in packages.items():
    if not isinstance(pkg_list, list):
        continue
    for p in pkg_list:
        if not isinstance(p, dict):
            continue
        if p.get('apkName') == apkname:

This will properly handle F-Droid's nested dictionary structure and prevent the AttributeError.

Related workflow run:
https://github.com/sharpninja/remote-agent/actions/runs/22082166067/job/63809798652

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@sharpninja sharpninja marked this pull request as ready for review February 17, 2026 02:01
@sharpninja sharpninja merged commit ffb5152 into develop Feb 17, 2026
1 check failed
Copilot AI requested a review from sharpninja February 17, 2026 02:01
Copilot stopped work on behalf of sharpninja due to an error February 17, 2026 02:01
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.

2 participants