feat(config): implement spec-compliant devcontainerId derivation#252
Conversation
Replace the old SHA-256 hex-prefix derivation with the algorithm from the official devcontainer CLI: SHA-256 of JSON-serialized sorted labels → BigInt → base-32 (0-9a-v alphabet) → left-pad to 52 characters. The new ComputeDevContainerID accepts a labels map, enabling --id-label override support. DeriveDevContainerID now takes both workspace folder and config file path to construct the default labels per spec. LegacyDeriveDevContainerID is retained for backward compatibility.
✅ Deploy Preview for devsydev canceled.
|
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Replaces the old devcontainerId derivation (SHA-256 hex prefix of workspace folder path, 20 chars) with the algorithm from the official devcontainer CLI source (
devcontainers/cliatsrc/spec-common/variableSubstitution.ts):JSON.stringify(labels, Object.keys(labels).sort()))BigInt.toString(32))The new
ComputeDevContainerID(labels map[string]string)function accepts arbitrary labels, supporting the--id-labelCLI flag which overrides defaults.DeriveDevContainerIDnow takes both workspace folder and config file path to construct the spec-required default labels (devcontainer.local_folderanddevcontainer.config_file).LegacyDeriveDevContainerIDis retained for backward compatibility. Container discovery is unaffected — it uses workspace UID viaGetIDLabels, which is independent of the${devcontainerId}variable substitution.