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

Move rustdoc-types crate to T-Rustdoc ownership. #3505

Closed

Conversation

aDotInTheVoid
Copy link
Member

@aDotInTheVoid aDotInTheVoid commented Oct 3, 2023

Rendered

CC @rust-lang/rustdoc @rust-lang/infra

@aDotInTheVoid aDotInTheVoid added the T-rustdoc Relevant to rustdoc team, which will review and decide on the RFC. label Oct 3, 2023
Co-authored-by: Joe ST <joe@fbstj.net>
@aDotInTheVoid aDotInTheVoid changed the title Move rustdoc-types to T-Rustdoc ownership. Move rustdoc-types crate to T-Rustdoc ownership. Oct 17, 2023
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.
2. Move overship of `rustdoc-types` on crates.io to the rustdoc team.

# Reference-level explanation
Copy link
Member

Choose a reason for hiding this comment

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

issue: I think we should carefully document what our versioning strategy is.

Copy link
Member Author

Choose a reason for hiding this comment

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

For the crate, or the FORMAT_VERSION constant?

For the crate, the current approach is "Follow semver, and don't release 1.0.0 until stabilization". The post 1.0.0 versioning strategy will be figured out in concert with designing the format for post-stabilization evolution.

How much detail on versioning strategy do you think this RFC needs? From a users POV, their should be no change from this, and new releases will be published in the same fashion as before.

Copy link
Member

Choose a reason for hiding this comment

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

The crate. We should both:

  • Document what we plan to do in the near future
  • Make a clear commitment; do we plan to do that for the forseeable future, or do we want flexibility to change how we do it. Are we going to make a release every time it changes? Do we guarantee that we will always pair rustdoc JSON changes with rustdoc-types changes? Or is it acceptable if we change rustdoc JSON in a way that breaks rustdoc-types but not immediately publish a new version?

It's going to be an official Rust artefact, we need to be a bit clearer to our users.

Co-authored-by: teor <teor@riseup.net>
@pietroalbini
Copy link
Member

From an infra point of view, I think we can just remove the GitHub section, and have someone from T-rustdoc ping infra on Zulip when the move needs to happen. Infra will then handle it like all repository moves we do.

@aDotInTheVoid
Copy link
Member Author

does this mean we're going to abandon rustdoc_json_types's FORMAT_VERSION constant in favor of updating the package version

No, not at all. We're going to keep increasing FORMAT_VERSION whenever we change the format, and versioning the crates.io release according to SemVer. Those 2 versions are not necessarily linked, eg we could go from pub struct Id(pub String) to pub struct Id(String) without needing to bump FORMAT_VERSION, but it would be a breaking change for the cargo version.


GitHub has a [list of requirements](https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository) for transferring repositories. T-infra will handle the permissions of moving the repository into the rust-lang GitHub organization.

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.
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum Jul 6, 2024

Choose a reason for hiding this comment

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

I'm not sure what this is trying to say here. "crate" is in crates.io, not GitHub typically. I also don't see what "T-infra as owners" means -- but it seems pretty surprising for T-infra to be an owner. Do we mean the rust-lang-owner account on crates.io?

The other sections don't seem to elaborate on this sentence.

I at least am not comfortable with infra being an owner for this crate or accompanying repository: it feels very much out of our general scope as a team, and very much "just" a rustdoc concern.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what this is trying to say here. "crate" is in crates.io, not GitHub typically.

Gah sorry, this is my bad writing. I mean the aDotInTheVoid/rustdoc-types repo.

I at least am not comfortable with infra being an owner for this crate or accompanying repository: it feels very much out of our general scope as a team, and very much "just" a rustdoc concern.

Agreed. I meant this in terms of GitHub permissions, not who'se maintaining the crate/repo. If the repo admin permissions should instead go to rust-lang-owner (instead of the infra team or even the rustdoc team) I'm happy to do that.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe I'm confused, but aren't we moving that repo into the rust-lang org? If so, then permissions are granted via the team repo and should only consist of teams that need access (in this case, presumably rustdoc).

Infra has access if needed through the org admins, but that is true for all repos in the org so generally doesn't need specific enumeration.

Copy link
Member

Choose a reason for hiding this comment

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

In any case, I'm happy with the intent now that I understand it :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe I'm confused, but aren't we moving that repo into the rust-lang org?

Yes

If so, then permissions are granted via the team repo and should only consist of teams that need access.

Ah. That makes things even simpler.

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

Thanks for writing this up! And my apologies for my delay in reviewing; I've been trying to catch up on RFCs. As mentioned on Zulip, I definitely agree with the principle of moving this crate to team ownership. However, I would rather not require two PRs (one to make the change and one to update rustdoc-types) every time we increase the FORMAT_VERSION or otherwise change the JSON API. I don't feel super strong about this, but it does seem unfortunate and like it would be easy for rustdoc-types to fall out of date. See my comments below for more detail.

text/0000-rustdoc-types-maintainers.md Outdated Show resolved Hide resolved
Comment on lines 60 to 61
normal SemVer. Changes to rustdoc-json in `rust-lang/rust` will not be accepted
if they would make it not possible to publish `rustdoc-types`.
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little unclear about how this could ever happen. Do you mind giving an example, and/or clarifying the wording to be more precise?

Copy link
Member Author

Choose a reason for hiding this comment

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

Stuff that depends on rust-lang/rust's "weird" build environment. In paticular:

  1. Access to rustc_private crates. We can't use types like DefId or Symbol here (at least on the user facing side).
  2. Using nightly language features/knowing the compiler version(s) being used to build

I'll add these to the RFC.

- 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 adopted). This is undesirable because
- Bus factor: If I am unable or unwilling to maintain `rustdoc-types`, we cause a load of unnecessary churn when it becomes out of sync with the in-tree `rustdoc-json-types`
- 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.
- We could publish `rustdoc-json-types` directly from `rust-lang/rust`. However
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I am a little concerned about having a separate repo because it would mean every PR that increases FORMAT_VERSION would also necessitate a separate PR to a different repo. Is there a downside to publishing from a folder in rust-lang/rust instead (or maybe even a git subtree)? See also my comments below about merging it with rustdoc-json-types, though my main concern is requiring multiple PRs.

Copy link
Member Author

Choose a reason for hiding this comment

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

though my main concern is requiring multiple PRs.

FWIW, this is how it's always been done, but that's defiantly not sufficient justification that it's the best way.

Is there a downside to publishing from a folder in rust-lang/rust instead (or maybe even a git subtree)?

  1. Can't tag the git repo with creates.io version
    • I'm not sure how compelling this is
  2. No way to diff view diff between releases
  3. Having the crate be a small repo makes it easier to depend on it via cargo's git feature (rather than having cargo clone rl/r). update.sh: Make user, repo, and branch easy to change rustdoc-types#14
  4. Requires re-engineering release procedures, and it's unclear how that would work in rust-lang/rust
    • Are we now going to cd into a local clone of rust-lang/rust and cargo publish? This is involved to
    • Alternatively, is rust-lang/rust CI going to autopublish? This is a whole can of worms, and it'd be much easier to set up auto-publishing on it's own repo.
    • Changelog generation get's tricky if it needs to be done in the PR that implements it.
      • Can't know the date it will be published to crates.io before merging, due to unpredictable bors delay
        • But maybe we don't need this in the changelog, it's not super intuitive how this is ties to crates.io (not rustup dates)
  5. I kinda like that the publish happens later, and gets another pass on it before going out to users:

Copy link
Member Author

Choose a reason for hiding this comment

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

Whats your concern with multiple PR's? Given that there's already a publish step, I don't think it cuts down on work (unless we autopublish from rust-lang/rust PR's, which I'm not fully comfortable with)

We could land this now (primarily for bus-factor reasons), and then move change things separately if it becomes a problem.

Copy link
Member

Choose a reason for hiding this comment

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

Whats your concern with multiple PR's? Given that there's already a publish step, I don't think it cuts down on work (unless we autopublish from rust-lang/rust PR's, which I'm not fully comfortable with)

Fair enough since all that's needed to update the repo is to run a script.

We could land this now (primarily for bus-factor reasons), and then move change things separately if it becomes a problem.

Yeah, I guess that makes sense since it wouldn't even need a whole RFC for a small administrative change like that.

Copy link
Member

Choose a reason for hiding this comment

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

I kinda like that the publish happens later, and gets another pass on it before going out to users:

Ah, the impression I got from the RFC text was you wanted publishing to happen almost as soon as the format version changed. I agree that there's benefit to reviewing the changes before publishing a new crate version.

- It could help with stabilization:
- Allows making structs/enums `#[non_exhaustive]`
- Allows potentially supporting multiple format versions.
- `rustdoc-types` is a nicer name, and what people already depend on.
Copy link
Member

Choose a reason for hiding this comment

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

This seems irrelevant since we could just rename rustdoc-json-types to rustdoc-types.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fair.

- We could publish `rustdoc-json-types` directly from `rust-lang/rust`. However
- `rust-lang/rust` doesn't currently publish to crates.io.
- `rustdoc-json-types` doesn't currently bump the version field in `Cargo.toml`
- It may be desirable to one day use different types for rustdoc serialization vs users deserialization
Copy link
Member

Choose a reason for hiding this comment

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

FWIW we could use cfgs for this (like feature = "unstable_internal_rustdoc" for the internal rustdoc version). I don't think we'd want to maintain two completely separate versions of the API anyway, since it would be confusing to keep in sync.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we should probably do that either way, to replace the increasing pile of regex we currently use.

@camelid
Copy link
Member

camelid commented Sep 22, 2024

@rfcbot concern out-of-tree (see above review)

@camelid
Copy link
Member

camelid commented Sep 22, 2024

@rfcbot reviewed

I'm ticking my box because my only concern is about the crate being out-of-tree (meaning outside of rust-lang/rust).

Co-authored-by: Noah Lev <camelidcamel@gmail.com>
Comment on lines +1 to +2
- Feature Name: `rustdoc_types_maintainers`
- Start Date: 2023-10-3
Copy link
Member

@camelid camelid Sep 23, 2024

Choose a reason for hiding this comment

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

nits: (no need for a feature name if there's no actual feature)

Suggested change
- Feature Name: `rustdoc_types_maintainers`
- Start Date: 2023-10-3
- Start Date: 2023-10-03

Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

@rfcbot resolve out-of-tree

It sounds like being out of tree does make more sense overall, and we can always adjust this later. Good to get the bus factor dealt with no matter the precise details of the infrastructure.

@camelid
Copy link
Member

camelid commented Sep 23, 2024

@rfcbot resolve out-of-tree (see above review)

@rfcbot rfcbot added the final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. label Sep 23, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 23, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Currently awaiting signoff of all team members in order to enter the final comment period. label Sep 23, 2024
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this RFC. to-announce and removed final-comment-period Will be merged/postponed/closed in ~10 calendar days unless new substational objections are raised. labels Oct 3, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Oct 3, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@GuillaumeGomez
Copy link
Member

Thanks for this PR! I'll make changes and then push it.

GuillaumeGomez pushed a commit to GuillaumeGomez/rfcs that referenced this pull request Oct 3, 2024
GuillaumeGomez pushed a commit to GuillaumeGomez/rfcs that referenced this pull request Oct 3, 2024
GuillaumeGomez pushed a commit to GuillaumeGomez/rfcs that referenced this pull request Oct 3, 2024
@GuillaumeGomez
Copy link
Member

Took your commits, rebased them and renamed the RFC file in #3705. RFC has been merged, thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This RFC is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this RFC. T-rustdoc Relevant to rustdoc team, which will review and decide on the RFC. to-announce
Projects
None yet
Development

Successfully merging this pull request may close these issues.