Skip to content

Add settings to select which field groups are exported to KiCad - #1533

Open
lukas-runge wants to merge 2 commits into
Part-DB:masterfrom
lukas-runge:feature/kicad-export-field-switches
Open

Add settings to select which field groups are exported to KiCad#1533
lukas-runge wants to merge 2 commits into
Part-DB:masterfrom
lukas-runge:feature/kicad-export-field-switches

Conversation

@lukas-runge

@lukas-runge lukas-runge commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Note

🤖 Claude Fable 5.1 opening this PR on behalf of @lukas-runge

Important

Stacked on #1534 (cache fingerprint fix). Only the second commit belongs to this PR.

Motivation

KiCad compares the fields of every placed symbol with the HTTP library and reports each difference as a "library symbol mismatch" in the ERC. Part-DB exports stock, storage locations, supplier part numbers, KiCost fields, part info and tags as symbol fields, so every stock booking, supplier edit or tag change in Part-DB produces ERC warnings in all schematics that use the part. In a workshop with regular stock movements this makes the ERC effectively unusable.

Related: #536 asked for a configurable field selection (in the other direction, more fields), #1502 discusses which field changes the ERC picks up.

Changes

Five new settings in "KiCAD integration" (also via env, EnvVarMode::OVERWRITE):

Setting Fields
EDA_KICAD_EXPORT_STOCK_FIELDS Stock, Storage Location
EDA_KICAD_EXPORT_SUPPLIER_FIELDS <Supplier> SPN
EDA_KICAD_EXPORT_KICOST_FIELDS manf, manf#, <supplier>#
EDA_KICAD_EXPORT_PART_INFO_FIELDS Category, Manufacturing Status, Mass, Part-DB IPN, Part-DB Footprint, Part-DB Unit, Part-DB Custom state
EDA_KICAD_EXPORT_TAGS_AS_KEYWORDS symbol keywords

All default to true, so existing installations export exactly the same fields as before. Symbol, footprint, reference, value, datasheet, description, Manufacturer, MPN, Part-DB ID and Part-DB URL are always exported.

Tests

  • 7 new tests in KiCadHelperTest covering defaults, each switch, the independence of the supplier and KiCost switches, and that the new settings are part of the listing cache fingerprint from Fix stale KiCad category listing after EDA settings change #1534.
  • Docs: new section "Exported symbol fields" in docs/usage/eda_integration.md.

Running in production on a 2.17.0 instance since the 2.16 line.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.40%. Comparing base (0f0ee60) to head (87c2a14).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1533   +/-   ##
=========================================
  Coverage     62.39%   62.40%           
- Complexity     9879     9895   +16     
=========================================
  Files           736      736           
  Lines         31779    31798   +19     
=========================================
+ Hits          19829    19842   +13     
- Misses        11950    11956    +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lukas-runge and others added 2 commits September 9, 2026 18:04
The KiCad category parts listing is cached and only invalidated by
entity changes (parts, categories, footprints). Settings that change the
exported fields (datasheet as PDF, default parameter/orderdetail
visibility) did not invalidate it, so KiCad kept receiving the old
listing until any part was edited.

Include a fingerprint of these settings in the cache key, so a settings
change results in a fresh listing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
KiCad reports every difference between a placed symbol and its library
entry as a "library symbol mismatch" in the ERC. Since Part-DB exports
stock, storage locations, supplier part numbers, KiCost fields, part
info and tags as symbol fields, every stock booking, supplier edit or
tag change in Part-DB triggers ERC warnings in all schematics using the
part.

This adds five settings (also configurable via env, EnvVarMode::OVERWRITE)
to the KiCad integration settings that allow disabling these field
groups:

- EDA_KICAD_EXPORT_STOCK_FIELDS: Stock, Storage Location
- EDA_KICAD_EXPORT_SUPPLIER_FIELDS: <Supplier> SPN
- EDA_KICAD_EXPORT_KICOST_FIELDS: manf, manf#, <supplier>#
- EDA_KICAD_EXPORT_PART_INFO_FIELDS: Category, Manufacturing Status,
  Mass, Part-DB IPN/Footprint/Unit/Custom state
- EDA_KICAD_EXPORT_TAGS_AS_KEYWORDS: symbol keywords

All settings default to true, so the exported fields do not change for
existing installations. The new settings are part of the category
listing cache fingerprint.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant