Skip to content

Commit 4424e89

Browse files
committed
rustdoc-types-maintainers: Initial Version
1 parent 564dff9 commit 4424e89

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed
+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
- Feature Name: `rustdoc_types_maintainers`
2+
- Start Date: (fill me in with today's date, YYYY-MM-DD)
3+
- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000)
4+
- Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000)
5+
6+
# Summary
7+
[summary]: #summary
8+
9+
The [rustdoc-types](https://crates.io/crates/rustdoc-types) crate will go from be officialy maintained by the rustdoc team.
10+
11+
# Motivation
12+
[motivation]: #motivation
13+
14+
[`rustdoc-types`](https://crates.io/crates/rustdoc-types) is a crate published on crates.io. It is used by users of the unstable [rustdoc JSON](https://github.com/rust-lang/rust/issues/76578) backend to provided a type representing the output of `rustdoc --output-format json`.
15+
16+
17+
Currently I ([`@aDotInTheVoid`](https://github.com/aDotInTheVoid/)) maintain the `rustdoc-types` crate on [my personal github](https://github.com/aDotInTheVoid/rustdoc-types/). No-one else has either github or crates.io permissions. This means if I become unable (or more likely disinterested), the crate will not see updates.
18+
19+
Additionally, if an update to `rustdoc-json-types` happens while i'm away from a computer for an extended period of time, their will be a delay in this update being published on crates.io. [This almost happened](https://github.com/aDotInTheVoid/rustdoc-types/issues/25), but was avoided due to the bors queue being quiet at the time.
20+
21+
# Guide-level explanation
22+
[guide-level-explanation]: #guide-level-explanation
23+
24+
This involves:
25+
26+
1. Moving the [github.com/aDotInTheVoid/rustdoc-types](https://github.com/aDotInTheVoid/rustdoc-types/) repo to the `rust-lang` organization, and make `rust-lang/rustdoc` maintainers/owners.
27+
2. Move overship of `rustdoc-types` on crates.io to the rustdoc team.
28+
29+
# Reference-level explanation
30+
[reference-level-explanation]: #reference-level-explanation
31+
32+
`rustdoc-types` is a republishing of the in-tree [`rustdoc-json-types`](https://github.com/rust-lang/rust/tree/b8536c1aa1973dd2438841815b1eeec129480e45/src/rustdoc-json-types) crate. `rustdoc-json-types` is a dependency of `librustdoc`, and is the canonical source of truth for the canonical description of the rustdoc-json output format. Changes to the format are made a a PR to `rust-lang/rust`, and will modify `src/rustdoc-json-types`, `src/librustdoc/json` and `tests/rustdoc-json`. None of this will change.
33+
34+
However, the publishing of this to crates.io, so that it can be used by out-of-tree tools that take rustdoc-json as an input
35+
([eg](https://github.com/awslabs/cargo-check-external-types/blob/dc15c5ee7674a495d807481402fee46fdbdbb140/Cargo.toml#L16),
36+
[eg](https://github.com/Enselic/cargo-public-api/blob/19f15ce4146835691d489ec9db3518e021b638e8/public-api/Cargo.toml#L27),
37+
[eg](https://github.com/obi1kenobi/trustfall-rustdoc-adapter/blob/92cbbf9bc6c9dfaf40bba8adfbc56c0bb7aff12f/Cargo.toml#L15)). This is done with [a scipt](https://github.com/aDotInTheVoid/rustdoc-types/blob/577a774c2433beda669271102a201910c4169c0c/update.sh) so that it is as low maintence as possible. This also ensures that all format/documentation changes happen in the rust-lang/rust repo, and go through the normal review process there.
38+
39+
The update/publishing process will be moved to T-Rustdoc. In the medium term, I (`@aDotInTheVoid`) will still do it, but
40+
- In an offical capacity
41+
- With bus factor for when I stop.
42+
43+
## Actual Mechanics of the move
44+
45+
### Github
46+
47+
Github has a [list of requirements](https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository) for transfering repositories.
48+
49+
50+
- When you transfer a repository that you own to another personal account, the new owner will receive a confirmation email. The confirmation email includes instructions for accepting the transfer. If the new owner doesn't accept the transfer within one day, the invitation will expire.
51+
- N/A: Not transfering to
52+
- To transfer a repository that you own to an organization, you must have permission to create a repository in the target organization.
53+
- I (`@aDotInTheVoid`) don't have create-repo perms in the `rust-lang` org. Therefor I'll add a member of T-Infra as an owner to `aDotInTheVoid/rustdoc-types` (I can't add teams, as it's not in an org). They'll then move it to the repo to the `rust-lang` org. Once moved, T-Infra can become owners.
54+
- The target account must not have a repository with the same name, or a fork in the same network.
55+
- OK.
56+
- The original owner of the repository is added as a collaborator on the transferred repository. Other collaborators to the transferred repository remain intact.
57+
- OK. After the transfer. T-Rustdoc should be added as a colaborator, and I should be removed so that I only have permissions via my membership in T-Rustdoc.
58+
- Single repositories forked from a private upstream network cannot be transferred.
59+
- OK.
60+
61+
At the end of this we should have a crate in the rust-lang github org with T-Rustdoc as contributors, and T-infra as owners.
62+
63+
### crates.io
64+
65+
crats.io ownership is managed [via the command line](https://doc.rust-lang.org/cargo/reference/publishing.html#cargo-owner).
66+
67+
I will run the following commands to move ownership.
68+
69+
```
70+
cargo owner --add github:rust-lang:owners
71+
cargo owner --add rust-lang-owner
72+
cargo owner --remove aDotInTheVoid
73+
```
74+
75+
The `rust-lang-owner` is neaded because team owners cannot add new owners.
76+
77+
# Drawbacks
78+
[drawbacks]: #drawbacks
79+
80+
- Adds additional maintenence burden to rustdoc team.
81+
- One-time maintenece burden to infra team to support move.
82+
83+
84+
# Rationale and alternatives
85+
[rationale-and-alternatives]: #rationale-and-alternatives
86+
87+
- We could keep `rustdoc-types` as a personal project. This preserves the status quo (and is what will happen if this RFC (or something similar) isn't addopted). This is undesirable because
88+
- Bus factor: If I am unable or unwilling to maintain `rustdoc-types`, we cause a load of unnessessary churn when it becomes out of sync with
89+
- We could bundle `rustdoc-types` through rustup. This is undesirable as it means users can't depend on it in stable rust, and can't depend on multiple versions.
90+
- We could publish `rustdoc-json-types` directly from `rust-lang/rust`. However
91+
- `rust-lang/rust` doesn't currently publish to crates.io.
92+
- `rustdoc-json-types` doesn't currently bump the version field in cargo.toml
93+
- It may be desirable to use different types in rustdoc vs users, eg to have a specialized version of `Id` that doesn't allocate
94+
- `rustdoc-types` is a nicer name, and what people already depend on.
95+
96+
97+
# Prior art
98+
[prior-art]: #prior-art
99+
100+
- [Rust RFC 3119](https://rust-lang.github.io/rfcs/3119-rust-crate-ownership.html) establishes the Rust crate ownership policy. Under it's categories, `rustdoc-types` would be a **Intentional artifact**
101+
- [Some old zulip discussion about why `rustdoc-json-types` was created.](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/JSON.20Format/near/223685843) What was said then is that if T-Rustdoc want's to publish a crate, it needs to go through an RFC. This is that RFC.
102+
103+
# Unresolved questions
104+
[unresolved-questions]: #unresolved-questions
105+
106+
None yet
107+
108+
# Future possibilities
109+
[future-possibilities]: #future-possibilities
110+
111+
When the rustdoc-json feature is stabilized, we'll should release 1.0.0 to crates.io. How we can evolve the format post stabilization is an unanswered question. It's a blocker for stabilization, but not this RFC
112+

0 commit comments

Comments
 (0)