Repository navigation
feat(libs-data-access): resolve legacy device ids to canonical urls - #265
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Certified Devices の
idを canonical とし、既存の/devices/:id(例:i2c-ads1015) を解決して canonical URL へ redirect するようにしました。未登録 ID ではリクエスト ID を明示した Not Found UI を表示します。Type of change
Related issues
What changed?
idを canonical とし、大小無視・{tag}-{id}legacy・exampleNameAliases/ 複合デバイス model を alias として解決するJsonDeviceRepository.get()が alias 解決後のデバイスを返すdevices/:idで canonical と異なる ID はreplaceUrl付きで canonical URL へ redirect する/devices/ADS1015/ legacy / 大小違い / unknown / 一覧遷移の E2E を追加するAPI / Compatibility
@chirimen-device-dashboard/libs-data-accessにbuildDeviceIdIndex/parseCertifiedAliases/resolveDeviceIdを追加。DeviceRepository.get()は完全一致に加え legacy / alias / 大小違いでもデバイスを返すADS1015等) になる。既存のi2c-ads1015形式 URL は redirect で互換を維持する。generic なother-device*等、tag 衝突する ID は対象外How to test
pnpm nx test libs-data-accessとpnpm nx test webとpnpm nx test libs-device-detailを実行するpnpm nx serve webで/devices/ADS1015を開き、一覧からの遷移・リロードが同じ URL になることを確認する/devices/i2c-ads1015と/devices/ads1015が/devices/ADS1015へ redirect されること、/devices/not-a-real-deviceで Not Found になることを確認するpnpm nx e2e web-e2e -- --project=chromiumでdevice-id-compat.spec.tsが成功することを確認するEnvironment (if relevant)
Checklist
Made with Cursor