-
Notifications
You must be signed in to change notification settings - Fork 217
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
Show individual doc differences for rendered documentation preview on PRs #2647
Conversation
Full-stack documentation: https://docs.openverse.org/_preview/2647 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. Changed files 🔄: |
0b41ead
to
d969c79
Compare
47998bb
to
f77076d
Compare
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.
Awesome work! A lot of tricky edge-cases, too :) This will review the friction from reviewing the docs changes.
I wonder if we could add a change to a storybook story here to see if the link is generated. I've added a patch that updates the story for VLicenseElements, removing the deprecated default
parameters and replacing them with args
.
"CNAME", | ||
"*.pickle", | ||
"*.doctree", | ||
"*.inv", |
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.
"*.inv", | |
"*.inv", | |
"*.txt", | |
"*.map", |
These two also need to be excluded based on the comment to this PR. I'm not so sure about the txt
, though, would there ever be txt
files added that we would like to review?
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.
Would it be easier to only include relevant files (is it just HTML?), instead of playing whack-a-mole with file types?
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.
@sarayourfriend I've tried a few different attempts based off this approach (example) but for some reason diff
is still comparing files it should be excluding 😕 it's not ideal, but in the interest of not spending hours on this I'll add the additional exclusions and keep the current approach.
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.
I've also added some handling in 8e5ff36 to ensure we only display valid HTML pages in the diff.
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.
Nice addition! Maybe in the future we can ship this as a standalone action, I imagine it could be useful for many other projects.
@dhruvkb to your point, there seem to be a few existing actions which allow for listing changed files, for example: https://github.com/marketplace/actions/changed-files @AetherUnbound's custom approach is still better, I reckon, since it does the link formatting we need. |
The action we currently use to determine where changes have happened in the repo can also provide the list of changed files: https://github.com/dorny/paths-filter#usage If we add the |
The former will apparently change all files if a new page is added, which is not ideal!
2b515d2
to
ed74c93
Compare
Size Change: 0 B Total Size: 877 kB ℹ️ View Unchanged
|
876b38e
to
8e5ff36
Compare
Fixes
Fixes #2646 by @AetherUnbound
Description
This PR adds some new logic to the emit docs step to determine which files have been added or changed, and notes them in the docs preview. The easiest way I found to accomplish this was with the
diff
CLI tool, but the output of that tool is not necessarily machine-readable and thus more complicated than a series of bash commands inside a GitHub Actions'run
block. I instead put all the logic inside a python file which is called by the workflow. This emits a comment (preserved for posterity) like the one below:I knowingly did not add tests for this script - we don't yet have tests (but want to add them as part of #1916), and setting up testing for the automation scripts would be its own bolus of work. I didn't want to include that in this PR, so we can tackle that as part of #1916 down the line.
Testing Instructions
Check the emit docs comment!
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin