Skip to content

Corrige comportamento não-determinístico do atualizador de firmware (3rd/update_firmware.py)#7

Open
bmorcelli wants to merge 2 commits intomainfrom
codex/fix-issues-with-firmware-update-script
Open

Corrige comportamento não-determinístico do atualizador de firmware (3rd/update_firmware.py)#7
bmorcelli wants to merge 2 commits intomainfrom
codex/fix-issues-with-firmware-update-script

Conversation

@bmorcelli
Copy link
Copy Markdown
Owner

Motivation

  • O script estava removendo todas as entradas de um par github+author em cada JSON e somente as re-inseria quando encontrava novas releases, causando desaparecimento/aparecimento aleatório de firmwares entre execuções.

Description

  • Limitei a remoção/reconstrução para os fids esperados do JSON atual calculados com generate_fid, armazenados em expected_fids.
  • Passei a filtrar existing_entries apenas por fid presente em expected_fids além de github e author, evitando apagar entradas de outros firmwares no mesmo arquivo.
  • Removo apenas entradas cujo fid esteja em expected_fids e reescrevo-as combinando versões existentes com new_versions, preservando histórico quando não há novas releases.
  • Ajustei logs para diferenciar "Nenhuma versão disponível" de "Nenhuma versão nova" e mantive o corte para as últimas 10 versões.

Testing

  • Verificação de sintaxe com python -m py_compile 3rd/update_firmware.py executada com sucesso.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90eb068372

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

]
},
{
"name": "T-Deck",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid duplicate name entries in t-deck firmware list

Adding another entry with name: "T-Deck" causes the downstream generator to silently overwrite other T-Deck firmwares because 3rd/create_json.py builds new_map as {item["name"].strip(): item} (keyed only by name). In this commit that behavior already changed 3rd/r/t-deck.json from Bruce's T-Deck to Ratdeck, so users consuming the /r feeds get a different firmware than before even though both should coexist; this is a data regression tied to duplicate names in the source list.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant