Repository navigation
fix(desktop): verify single-stanza APT source identity - #12363
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR checks single-stanza deb822 sources against APT’s observed URI and suite. The latest changes preserve the concrete suite for export while keeping the authored value.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Authored source] --> C[Match APT target]
B[APT URI and selected suite] --> C
C --> D[Capture authored values and observed identity]
D --> E[Shared replay identity]
E --> F[Attribute package indexes]
E --> G[Deduplicate exported sources]
G --> H[Declare AptSource]
Reviews (10) · Last reviewed commit: "fix(desktop): replay the APT suite selec..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55b141b035
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4fdc8f937
ℹ️ 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".
Assert entryForTarget and repository facts keep the authored empty-port URI while matching the portless Repo-URI APT 2.8.3 emits, including the signing key. Co-authored-by: morluto <[email protected]>
Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c20192d81
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Match deb822 Repo-URI identity to APT's unsigned port: the host's last colon suffix is atoi'd, zero is omitted, and IPv6 brackets stay intact while the authored URI is kept. Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27ea7d34f5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Keep x86_64 as an APT architecture token for $(ARCH) identity, and stop growing a port magnitude once it passes the signed 64-bit limit. Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a0863c7f9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
An empty host with no path stays scheme://, matching APT 2.8.3. A path after that host still drops it, so file:///srv remains file:/srv. Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11f1d171b5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
APT 2.8.3 rewrites http:127.0.0.1:18743/archive to an http:// Repo-URI. Identity comparison follows that form and keeps the authored URI. Bracket removal copies each host character once. Co-authored-by: morluto <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3d54bb1e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
Validate URI and suite identity for single-URI deb822 source stanzas when matching APT index targets.
Problem
entryForTargettreated every stanza with one URI and one suite as an exact match. A.sourcesstanza with one URI therefore returned a repository entry even when APT's observedRepo-URIbelonged to another source or the observed release differed from the authored suite. Package attribution and replay could attach an APT index to the wrong declaration.One-line entries retain their existing exact-single-entry behavior. Deb822 entries now use the same observed URI and release checks as multi-value stanzas.
Validation
aptRepositories.test.tsandAptRepositoryInventory.test.tspassed: 51 tests.git diff --checkpassed.oxfmt.No target or external provider was used.
Review follow-up
e4fdc8f937matches both URI and suite templates usingAPT::Architectureand keeps the authored spellings. The source parser also carries its format fact directly to match selection. Offline APT 2.6.1 and 3.2.0 passed the configured-architecture and unavailable-configuration cases. All 124 targeted tests passed with seven platform skips.check:fastanddocs:checkpassed.Follow-up validation: the APT lookup identity now removes an empty authority port while retaining the authored URI. The source-matching regression and all 40 APT repository tests passed.
Author readiness
Human owner: @ShuaixinHuang
Summary
Validate URI and suite identity for single-URI deb822 source stanzas when matching APT index targets.
Problem
entryForTargettreated every stanza with one URI and one suite as an exact match. A.sourcesstanza with one URI therefore returned a repository entry even when APT's observedRepo-URIbelonged to another source or the observed release differed from the authored suite. Package attribution and replay could attach an APT index to the wrong declaration.One-line entries retain their existing exact-single-entry behavior. Deb822 entries now use the same observed URI and release checks as multi-value stanzas.
Validation
aptRepositories.test.tsandAptRepositoryInventory.test.tspassed: 51 tests.git diff --checkpassed.oxfmt.No target or external provider was used.
Review follow-up
e4fdc8f937matches both URI and suite templates usingAPT::Architectureand keeps the authored spellings. The source parser also carries its format fact directly to match selection. Offline APT 2.6.1 and 3.2.0 passed the configured-architecture and unavailable-configuration cases. All 124 targeted tests passed with seven platform skips.check:fastanddocs:checkpassed.Empty-port identity: APT 2.8.3
indextargetsreportsRepo-URI: https://vendor.invalid/archive/forURIs: https://vendor.invalid:/archive. Lookup omits an empty or all-zero port and keeps the authored URI.entryForTargetasserts the structured entry, and repository facts assert the authored URI, suite, and signing key.oxfmt,npm run check:fast, and the focused tests passed (56 tests) at1c20192d8. Mergedorigin/main.Port suffixes: APT 2.8.3 parses the host's last colon suffix with
atoiinto an unsigned 32-bit port.https://vendor.invalid:80abc/archivereportsRepo-URI: https://vendor.invalid:80/archive/, and:httpsis portless. IPv6 brackets stay in place. The authored URI is unchanged.entryForTargetand repository facts assert those structured values, including the signing key.oxfmt,npm run check:fast, and the focused tests passed (75 tests) at27ea7d34f.Architecture tokens and bounded ports: APT 2.8.3 expands
$(ARCH)tox86_64. That GNU CPU name is kept; a slash-bearing value is not. Port magnitudes stop growing at the signed 64-bit limit, and the unsigned port matches APT for long, signed, and overflowing suffixes.oxfmt,npm run check:fast, and the focused tests passed (93 tests) at7a0863c7f.Empty
file://: APT 2.8.3 reportsRepo-URI: file://forURIs: file://, andfile:/forfile:///. A Packages index with that Repo-URI keeps the authored URI and suite.file:///srvstill becomesfile:/srv/.oxfmt,npm run check:fast, and the focused tests passed (96 tests) at11f1d171b.Scheme shorthand: APT 2.8.3 reports
Repo-URI: http://127.0.0.1:18743/archive/forURIs: http:127.0.0.1:18743/archive. The comparison uses that form and the entry keeps the authored URI.copy:/srvandfile://stay as before. Bracket removal copies each host character once; a 16384-pair bracket host still returns the authored URI and suite.oxfmt,npm run check:fast, and the focused tests passed (101 tests) atd3d54bb1e.Maintainer follow-up
Commit
3a1cb5b34apreserves the concrete suite APT observed during capture and shares the replay identity across package attribution, source deduplication, and export. Older captures with only an unresolved suite template request recapture. Offline APT checks covered replay across different architecture settings and confirmed delimiter-only file URIs, authority shorthand, and bracketed host normalization.The focused suite passed with 248 tests and 11 skips.
check:fastanddocs:checkpassed. Validation used offline APT with no AgentEnv run.Author readiness
Human owner: @ShuaixinHuang