Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spec] Make bikeshed check references to Private Aggregation API #219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dmcardle
Copy link
Contributor

@dmcardle dmcardle commented Jan 16, 2025

DO_NOT_MERGE Until the parent PR has been merged (#216).


Currently, all references to the private-aggregation-api spec are declared in the "anchors" block. According to the bikeshed docs, this is how you link to dfns in specs that aren't part in the autolinking database1. As a result, bikeshed hasn't actually been checking our references, nor has it always been generating the correct links2.

Private Aggregation spec is already in the database3, so I think we can promote these to actual references.

This commit makes the necessary adjustments to the "link-defaults" block. With this change, invalid references to the Private Aggregation spec are now compilation errors.


Preview | Diff

Footnotes

  1. https://speced.github.io/bikeshed/#custom-dfns

  2. For instance, clicking "context ID" in step 10 of "obtain the pre-specified report parameters" links to a non-existent anchor on the Private Aggregation spec.

  3. https://github.com/tobie/specref/blob/3569d1ecfa298461f3de0586ed2d13ffb000fa29/refs/browser-specs.json#L1179

@dmcardle dmcardle marked this pull request as ready for review January 16, 2025 19:09
@dmcardle
Copy link
Contributor Author

@alexmturner and @xyaoinum, PTAL!

(Ignore the first commit, this PR is based on #216.)

Copy link
Collaborator

@alexmturner alexmturner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w nits

@dmcardle dmcardle changed the title [spec] Make bikeshed check references to Private Aggregation API DO_NOT_MERGE [spec] Make bikeshed check references to Private Aggregation API Jan 16, 2025
@dmcardle dmcardle force-pushed the fix-autolinks branch 2 times, most recently from 03555e8 to 32d26a5 Compare January 16, 2025 21:57
@dmcardle dmcardle changed the title DO_NOT_MERGE [spec] Make bikeshed check references to Private Aggregation API [spec] Make bikeshed check references to Private Aggregation API Jan 16, 2025
@dmcardle
Copy link
Contributor Author

dmcardle commented Jan 16, 2025

Rebased, this is now disentangled from #216, modulo the fact that it imports the max contributions dfn (but never references it).

@@ -124,36 +147,6 @@ spec: permissions-policy; urlPrefix: https://www.w3.org/TR/permissions-policy/
spec: attestation; urlPrefix: https://github.com/privacysandbox/attestation
type: dfn
text: enrolled
spec: private-aggregation-api; urlPrefix: https://patcg-individual-drafts.github.io/private-aggregation-api/
type: dfn
text: Private Aggregation; url:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This little tidbit is what enabled us to link to the Private Aggregation spec with [=Private Aggregation=]. It's kind of a hack though -- it works by pretending there's a dfn with that name, then overriding the value of the URL hash as the empty string. Technically, it kind of got the job done, but I suppose it risks colliding with something that Private Aggregation actually wanted to export.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely a hack, but I don't think there's a real risk of collision here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, I was thinking that mixing and matching link-defaults and anchors might cause occurrences of [=Private Aggregation=] to incorrectly autolink to the permissions policy string, declared as <dfn>private-aggregation</dfn>, either now or in a future version of bikeshed.

Currently, all references to the Private Aggregation spec are declared
in the `anchors` block. It's not obvious from the name, but bikeshed
interprets this block as "custom definitions"[1]. Consequently, it has
not been checking our references to Private Aggregation, nor has it
always been generating the correct links[2].

Since the Private Aggregation spec is now in the database[3], I think we
can promote these to real references.

This commit removes the Private Aggregation lines from the `anchors`
block and makes the necessary adjustments to the `link-defaults` block.
With this change, invalid references to the Private Aggregation spec
become compilation errors.

[1]: https://speced.github.io/bikeshed/#custom-dfns
[2]: For instance, clicking "context ID" in step 10 of "obtain the
     pre-specified report parameters" links to a non-existent anchor on
     the Private Aggregation spec.
[3]: https://github.com/tobie/specref/blob/3569d1ecfa298461f3de0586ed2d13ffb000fa29/refs/browser-specs.json#L1179
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.

2 participants