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

ci: Generate docs for each PR #2547

Merged
merged 11 commits into from
Jul 26, 2024
Merged

ci: Generate docs for each PR #2547

merged 11 commits into from
Jul 26, 2024

Conversation

matheus23
Copy link
Contributor

@matheus23 matheus23 commented Jul 25, 2024

Description

Added a docs.yaml workflow that makes the github action bot reply to PRs with a link to built docs to your PRs.
It only does so once, and then just updates the comment (although actually it doesn't necessarily need to, the link is always the same, but it's still nice in case someone changes the workflow).

This is using the nightly toolchain, because we're using #[feature(doc_cfg)].

Motivation

I personally wanted this. Every now and then we get a PR with the description saying "the best way to review this is to start by looking at the generated docs". But then I need to checkout the PR, build the docs and open them. Having a link directly to the docs would be amazing IMO.

I also think that having easy access to docs on every PR will make people check out the rendered docs on PRs more often. My hope here is that doc quality will thus improve.

Breaking Changes

None of course. This is only CI.

Notes & open questions

Wdyt?

Change checklist

  • Self-review.
  • [ ] Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant.
  • [ ] All breaking changes documented.

@matheus23 matheus23 self-assigned this Jul 25, 2024
Copy link

github-actions bot commented Jul 25, 2024

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2547/docs/iroh/

Last updated: 2024-07-26T12:59:33Z

@matheus23
Copy link
Contributor Author

I think this isn't far from working, but I think someone with more access rights than I have needs to setup github pages in the settings for this to work.
Whoever has access, please ping me if you'd like to make this happen ✌️

@flub
Copy link
Contributor

flub commented Jul 26, 2024

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/2547/

Last updated: 2024-07-25T13:16:26Z

The link is a 404 now, is that expected? How long do they stay valid?

@matheus23
Copy link
Contributor Author

@flub see my msg above: #2547 (comment)

This doesn't work yet :( Need an admin to jump in.

@flub
Copy link
Contributor

flub commented Jul 26, 2024

@flub see my msg above: #2547 (comment)

This doesn't work yet :( Need an admin to jump in.

oops, missed that.

but do they stay valid forever? will we ever run out of space?

@matheus23
Copy link
Contributor Author

but do they stay valid forever? will we ever run out of space?

IIUC, the github action will push to a branch (that's gh-pages by default, but we can customize, I'd suggest using docs-preview).

My plan was for the github action to publish different PRs to different directories on that branch, indexed by PR number. We'd have one directory for each PR.

We can go in there by hand and remove old PRs. From reading the github documentation, I don't see any limits to repository size, though.

@flub
Copy link
Contributor

flub commented Jul 26, 2024

I guess if it's just a repo than we have unlimited storage and can as well leave it there. it's nicer that it doesn't expire. just surprises me they are that generous :)

@matheus23
Copy link
Contributor Author

You can see what this PR generates here: https://github.com/n0-computer/iroh/tree/generated-docs-preview

It just needs to be hosted now.

@matheus23 matheus23 marked this pull request as ready for review July 26, 2024 09:29
@matheus23
Copy link
Contributor Author

Forgot to mention this now just works (thus I flipped it to ready for review). The comment above is a demo of it working: #2547 (comment)

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

LGTM but please follow up on the two comments before merging

.github/workflows/docs.yaml Show resolved Hide resolved
.github/workflows/docs.yaml Outdated Show resolved Hide resolved
@matheus23 matheus23 enabled auto-merge July 26, 2024 13:00
@matheus23 matheus23 added this pull request to the merge queue Jul 26, 2024
Merged via the queue into main with commit 0812333 Jul 26, 2024
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants