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

Include TESTS in doc preview for PRs #38449

Merged
merged 4 commits into from
Nov 16, 2024

Conversation

kwankyu
Copy link
Collaborator

@kwankyu kwankyu commented Jul 30, 2024

We include TESTS blocks in development documentation, so that they are visible at least during development.

Then not to ruin CHANGES.html, we refactor doc build github workflow. The idea is to upload artifact doc-develop so that doc diffs are computed against the doc contained in the artifact.

test: https://doc-develop--sagemath-test.netlify.app/html/en/reference/structure/sage/structure/sage_object Look around for new "TESTS" blocks.

We also remove all spurious diffs caused by EXAMPLES tabs indices change. Tests for PR event:

doc-develop artifact: https://github.com/kwankyu/sage/actions/runs/11787561475
doc-build workflow run: https://github.com/kwankyu/sage/actions/runs/11789320959/job/32837887930

Note that doc build for this PR itself fails here, of course. We may ignore this.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

#38468

Copy link

Documentation preview for this PR (built with commit 3162bc8; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu kwankyu changed the title No parsed examples and yes to tests in development docs No parsed examples and yes TESTS in preview docs for PRs Jul 31, 2024
@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 1, 2024

And we include TESTS blocks in development documentation, so that they are visible at least during development.

Interesting idea. Do you have plans beyond this for the TESTS blocks?

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 5, 2024

And we include TESTS blocks in development documentation, so that they are visible at least during development.

Interesting idea. Do you have plans beyond this for the TESTS blocks?

No. Actually while investigating the cause of the hunk 1 in https://doc-pr-38468--sagemath.netlify.app/changes, I have now realized that this PR won't work as I expected, at least with the current infrastructure.

When we compute diffs to create CHANGES.html, we compare the "new" doc for the PR with the "old" doc built by CI Linux workflow for the develop branch. The "old" doc was built with parsed examples and no TESTS. We should not change this. For reasonable diffs, the "new" doc should not deviate from this mode.

One way to escape the dilemma is to get the "old" doc from the artifact produced by doc-build workflow run for develop branch. I don't know if this is doable or desirable...

I may close this PR for now.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 7, 2024

I did necessary refactoring to implement this PR. Now doc build for pull request event downloads doc-develop artifact to compute diffs to create CHANGES.html.

@kwankyu kwankyu marked this pull request as ready for review August 7, 2024 14:55
@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 7, 2024

One way to escape the dilemma is to get the "old" doc from the artifact produced by doc-build workflow run for develop branch. I don't know if this is doable or desirable...

Done.

@kwankyu kwankyu requested a review from mkoeppe August 8, 2024 01:50
@kwankyu kwankyu changed the title No parsed examples and yes TESTS in preview docs for PRs Use doc-develop artifact and include TESTS in preview docs for PRs Sep 6, 2024
@kwankyu kwankyu changed the title Use doc-develop artifact and include TESTS in preview docs for PRs Use doc-develop artifact and include TESTS in doc preview for PRs Sep 6, 2024
@kwankyu
Copy link
Collaborator Author

kwankyu commented Sep 6, 2024

@mkoeppe I think this PR is now tasty.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Sep 10, 2024

The last commit is to mitigate the "out of disk space" failure.

@kwankyu kwankyu changed the title Use doc-develop artifact and include TESTS in doc preview for PRs Include TESTS in doc preview for PRs Nov 11, 2024
@dimpase
Copy link
Member

dimpase commented Nov 12, 2024

build-doc CI step is failing, as you introduced new "target" doc-develop.

Is there a way to fix this?

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 12, 2024

It is expected, and cannot be "fixed" here. The artifact doc-develop will be generated at next beta release after merging this pr.

If you want to see a test result, I will prepare one in my repo. Wait some minutes.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 12, 2024

doc-build for a dummy PR for testing is running here:

https://github.com/kwankyu/sage/actions/runs/11789320959/job/32837887930

Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

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

Looks good.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 12, 2024

Thanks!

vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 13, 2024
    
We include TESTS blocks in development documentation, so that they are
visible at least during development.

Then not to ruin CHANGES.html, we refactor doc build github workflow.
The idea is to upload artifact `doc-develop` so that doc diffs are
computed against the doc contained in the artifact.

test: https://doc-develop--sagemath-
test.netlify.app/html/en/reference/structure/sage/structure/sage_object
Look around  for new "TESTS" blocks.

We also remove all spurious diffs caused by EXAMPLES tabs indices
change. Tests for PR event:

doc-develop artifact:
https://github.com/kwankyu/sage/actions/runs/11787561475
doc-build workflow run:
https://github.com/kwankyu/sage/actions/runs/11789320959/job/32837887930

Note that doc build for this PR itself fails here, of course. We may
ignore this.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

sagemath#38468
    
URL: sagemath#38449
Reported by: Kwankyu Lee
Reviewer(s): Dima Pasechnik
@vbraun vbraun merged commit 776d13c into sagemath:develop Nov 16, 2024
21 of 24 checks passed
@kwankyu kwankyu added this to the sage-10.5 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants