-
Notifications
You must be signed in to change notification settings - Fork 645
enable crate maintainers to trigger docs.rs rebuilds from crates.io #11169
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this how the API could look like?
yeah, looks good to me at first glance. as I mentioned in the review comments, we might want to restrict it to cookie-only for now. this gives us a bit more flexibility in evolving the API, if necessary.
What's missing apart from tests?
- frontend implementation incl. tests, though we could also put that in a dedicated PR
- maybe some way to mock this? I'm not entirely sure yet how else we would test this otherwise 😅
where would I find the frontend parts?
the relevant part of the frontend is at
crates.io/app/components/crate-sidebar.hbs
Lines 73 to 79 in fba0b72
{{#if @version.documentationLink}} | |
<CrateSidebar::Link | |
@title="Documentation" | |
@url={{@version.documentationLink}} | |
data-test-docs-link | |
/> | |
{{/if}} |
the component we use there isn't particularly flexible at the moment though, so it might need a bit of a refactoring first. I'm happy to take it from here though, unless you want to dive in deeper :)
happy to talk about it in more detail during the all-hands
@Turbo87 thanks for the notes! I'll continue on the API & its tests, mocking the HTTP server.
That would take me quite some time, also @GuillaumeGomez offered to help if you don't have time. |
FWIW I'm wondering if it would make sense to extract a |
I extracted the client and used Does it look like what you would want? Then I'll start adding some tests. ( I'll squash the commits in the end ) |
I think this is ready for another review. main changes in commits, notable: the docs.rs config now is mandatory, not sure if that's ok? It made the whole Also, not all cases are covered in the endpoint & job tests. Do we have examples where jobs are unit-tested? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have examples where jobs are unit-tested?
mod tests { |
we basically extracted the core logic into a free function and tested that instead.
given the relatively straightforward implementation of the background job, and the fact that the client impl is tested independently, I'm not sure whether we need extensive tests for the background job though.
@Turbo87 from what I see, I covered everything except the frontend? I'm happy to add any other things that might be missing. I also manually tested the client via the example in |
This is a first draft because I need more pointers.
Generally I imagine that most limits should be applied from docs.rs, like how often a crate maintainer can trigger a rebuild.