breg: keep `resultEffects` in the Action description for a profile that can read a Proposal but not start it

Offen
#2,719 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
openapi, rust
Bereich
api, backend

Rechercherichtung

Start with the Proposal metadata loop in crates/registry-breg/src/api/mod.rs:675-716 and the result effect filtering in crates/registry-breg/src/artifacts.rs:1331 and :1554-1566. Read the existing schema test at crates/registry-breg/src/tests/artifacts_response_schema_tests.rs:360-375, then add coverage for readable and hidden record types and confirm the reader still receives no routes. Done means reader-visible effects are filtered by record type, the existing populated-list test passes, and any changed schemas are regenerated.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Problem

A profile with a Proposal get grant but no Start grant receives an Action description in GET /v1/metadata. The description hides the routes, which is deliberate: the profile cannot start the Action. It also sets resultEffects to an empty list. A client cannot then tell which record fields or record types the Action changes, so it has to guess, for example when it shows a reader what a Proposal would do once applied.

The blanking may have been deliberate. Neither the code nor the pull request that introduced it (#2040) says why. If it exists to avoid disclosing effects on record types the reader cannot see, the fix should keep that protection rather than blank everything.

Evidence

All line numbers are on origin/main at 36d25ef652.

  • crates/registry-breg/src/api/mod.rs:675 to :716: the loop that adds a description for each visible Proposal get grant. It empties routes (:706), removes route and conditionRoute, empties requiredConditionKeys, then sets resultEffects to [] at :716. The comment at :675 states only the input-disclosure intent.
  • crates/registry-breg/src/artifacts.rs:1331: the public Action entry builds resultEffects by filtering action.effects through selected_result_effects.
  • crates/registry-breg/src/artifacts.rs:1554 to :1566 (action_selected_result_effects): with a selected profile, effects come only from that profile's Action permission results. A reader has no Action permission, so this path also yields an empty set. This is my reading of the code and I have not run it.
  • The set was introduced by commit 2ec3726883 (#2040, 2026-10-16). git log -S finds no earlier version of the line, and the #2040 description does not mention it.
  • crates/registry-breg/src/tests/artifacts_response_schema_tests.rs:360 to :375 asserts the populated list for a profile that holds an Action grant. No test asserts the empty list for a reader.
  • The clients decode the member as required: crates/registry-breg-client/src/metadata.rs:3310, and resultEffects in crates/registry-breg-client-node/client.d.ts:539.

Proposed change

  1. Stop blanking resultEffects for a Proposal reader. Derive the list from action.result_effects (the effects a Proposal applies), not from an Action permission.
  2. Keep record-type disclosure intact: list only effects whose recordType the profile may see in the same metadata response. Decide whether an effect on a hidden record type is omitted or listed without detail, and record the decision.
  3. Leave routes, route, conditionRoute and requiredConditionKeys as they are.
  4. Document the field for readers on the Proposals configuration page.

Acceptance

  • A test shows a Proposal reader sees the Action's effects for record types it can read.
  • A test shows an effect on a record type the reader cannot read is not disclosed.
  • A test shows the reader still gets no routes.
  • The existing populated-list test still passes.
  • The OpenAPI and metadata schema documents are regenerated with their generators if the change alters them.
Vorherrschende Sprache
Rust
Sterne
2
Forks
0
Ø Merge
9 Std. 48 Min.
Gemergte PRs (30 T.)
151

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus registrystack/registry-stack

Alle Issues in registrystack/registry-stack

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.