High-value PRs to review first

Open
#207 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
c, cpp, github, github-actions
Domain
documentation

Research direction

Start with the issue’s Process section and review the ordered PR list and its merge status. The requested work is to keep this priority guide current: add qualifying PRs with a short explanation, maintain priority order, tick merged PRs, and close the issue when the list is empty.

Written by the indexing model from the issue text.

Description

Summary

I have a lot of PRs open, which makes it hard to see which ones matter most. This issue is a guide to the higher-value ones, in priority order, so review time goes to them first.

A PR is here when it is worth far more than the review time it takes: it improves the automated review of every incoming PR, fixes crashes that many users can hit, adds a shared helper that makes contributor PRs smaller and reduces the long term review burden, saves a lot of flash or RAM on real devices, or fixes a performance problem users feel. A helper pays back each time a contributor PR uses it instead of hand-writing the same code, and each time a reviewer no longer has to check that code.

The rest of my open PRs improve things for a smaller slice of users, so they merge as there is time.

PRs

1. Review skill improvements for incoming PRs
  • esphome/esphome#22708 [ai] Add the cleanups reviews keep missing to AGENTS.md and the review skill (mergeable, +69/−1)

Every incoming PR gets the automated review, so this helps with all of them. It adds to AGENTS.md (which Copilot reads) and the code-review skill the cleanups that multi-pass reviews keep finding in contributor PRs and the automated reviewer almost never flags: copied state, dead guards, member layout, codegen precompute, two-way tables, log noise, final, and parametrized tests. Each pattern came up on at least 3 of 119 contributor PRs. Once it merges, the automated review catches these on the first pass, so a human review no longer needs extra rounds to find them. It also points contributors at the shared helpers below.

2. Crash and use-after-free fixes
  • esphome/esphome#22695 [web_server] Serve /events with ESPHome's own sessions on ESP8266, RP2040 and LibreTiny, the last of a stack that merges in order:

    • esphome/esphome#21973 [web_server_idf] Add a long lived streaming response that components can use (mergeable, on dev)
    • esphome/esphome#22691 [web_server] Send each /events client's entity listing only to that client on ESP32
    • esphome/esphome#22694 [web_server] Move the ESP32 /events layer to web_server/event_source (moves code, no change in behaviour)

    On ESP8266, RP2040 and LibreTiny, the library's event source frees clients from network callbacks while the main loop walks them. That causes a use-after-free, races and crashes: the RP2 crash when streams open and close quickly (esphome/esphome#22690), the ESP8266 crash in AsyncEventSource::send and the LibreTiny task race. After the stack, every platform runs the one ESPHome /events implementation, where network callbacks only set flags and the main loop owns, writes and deletes every connection. It also drops the library's three allocations per event per client.

  • esphome/esphome#20447 [esp32] Fix new (std::nothrow) aborting instead of returning nullptr (mergeable): on ESP-IDF, new (std::nothrow) aborts when the heap is full instead of returning nullptr, so out-of-memory handling written for it still crashes.

3. Helpers that make contributor PRs smaller and reduce long term review burden

These save more review and contributor time than any single memory saving, so they come before it. Each of these adds one shared helper. The migration of existing components, where there is one, is stacked on it and can be reviewed after the helper.

  • esphome/esphome#22066 [sensor] Add measurement presets for sensor_schema (mergeable), with esphome/esphome#22068 [sensor] Use measurement presets in sensor_schema calls stacked on it: sensor.sensor_schema(kind=sensor.TEMPERATURE) replaces the unit, device class, state class and usual accuracy_decimals that each component writes out by hand today. A new contributor PR picks a kind instead of four values, so a wrong device class, state class or rounding no longer slips through review. esphome/esphome#22068 converts about 780 call sites in 228 components (−5,125 / +872 lines), with no change to firmware; it is large but mechanical, and its only visible change is the icon list in its description.
  • esphome/esphome#22860 [core] Accept enums and wide integers in PROGMEM_STRING_TABLE lookups and default the fallback (mergeable): a name lookup becomes get_log_str(mode) instead of a cast, a range guard and Name::LAST_INDEX at every call. 139 existing calls keep compiling; esphome/esphome#22855, esphome/esphome#22856 and esphome/esphome#22857 move 17 components' hand-written switch blocks onto these tables.
  • esphome/esphome#22709 [climate_ir] Add a shared PROGMEM code table for mode and fan mappings (mergeable), with esphome/esphome#22710 stacked on it: IR climate components map modes and fans with one table for both directions, instead of two switch blocks each. Covers 17 components, each smaller on ESP8266.
  • esphome/esphome#22316 [core] Share the hub status field decoding and on-change text publisher (mergeable): register hubs describe a status field as a table row that reads like the datasheet (cg.RegisterField), instead of hand-written bit decoding and a text publisher in each component.
  • esphome/esphome#21922 [core] Add cv.time_period_enum (mergeable), with esphome/esphome#21925 stacked on it: one validator for options limited to fixed time periods, in place of a hand-written validator function in each component. The language schema then lists the allowed values. Covers 10 components.
4. Significant memory savings
  • esphome/esphome#22596 [logger] Pick the console port at build time to drop the unused UART driver, add a console API (mergeable), with esphome/esphome#22597 [improv_serial] Use the logger console API and drop RAM held between sessions stacked on it: a device that logs over USB no longer links the ESP-IDF UART driver it never uses, saving 10.1 KB flash and 932 B RAM on an ESP32-S2 with USB CDC and improv_serial. UART builds save a little flash too.
5. Performance
  • esphome/esphome#21641 [esphome] Inflate compressed OTA uploads about 5 times faster (mergeable): on older BK72xx chips, inflating a compressed OTA upload was slow enough that compression made uploads slower than sending raw on a fast link. With a table lookup in place of reading each Huffman code one bit at a time, a BK7231N goes from 3.8 to about 0.74 µs per inflated byte, so a 2.25 MB UF2 costs about 1.7 s of CPU instead of 8.7 s. It costs about 740 B of flash, and 1.1 KB of heap only while a compressed upload runs; the wire protocol is unchanged.

Process

  • Add a PR here when its value is clearly larger than its review cost, and say why in one or two lines. Crash and use-after-free fixes, and new helper PRs that make contributor PRs smaller and reduce long term review burden, always qualify.
  • Keep the list in priority order.
  • Tick a PR when it merges, and close this issue when the list is empty.
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from esphome/backlog

All issues in esphome/backlog

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.