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

Generate api docs for EESSI test suite #319

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

xinan1911
Copy link
Collaborator

@xinan1911 xinan1911 commented Oct 10, 2024

A dependency of this PR is on EESSI/test-suite#192 as PR 192 resolves the build error for API docs

@xinan1911
Copy link
Collaborator Author

@casparvl Adjusted the deploy and schedule. This is ready for test

@casparvl
Copy link
Collaborator

Just to log for myself: to test this, one needs to

  • Git clone this feature branch
  • Clone the test suite in an src subdir: mkdir src && cd src && git clone https://github.com/EESSI/test-suite.git
  • Run mkdocs serve -a localhost:<someport>
  • Create a reverse tunnel to that node using ssh -L <someport>:localhost:<someport> <host_running_mkdocs_serve>
  • Go to localhost:<someport> in your browser.

@@ -57,6 +56,7 @@ nav:
- Release notes: test-suite/release-notes.md
- Known issues and workarounds:
- v2023.06: known_issues/eessi-2023.06.md
- API documentation: api/
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would put this under Advanced usage => Test suite. I'm not sure if we should keep the test suite docs there indefinitely, might be better to have a separate test suite top level item. But that's of later concern. At least we should keep all the test suite stuff under the Test suite: list.

Copy link
Collaborator

@casparvl casparvl Nov 13, 2024

Choose a reason for hiding this comment

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

Probably put it at the bottom of all the other items, i.e. right under - Release notes:

uses: actions/checkout@v4
with:
repository: eessi/test-suite
path: src
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we just do this without path, i.e. in the current workdir? It will still clone into a subidr test-suite by default right? No need to nest that further inside a src I'd think.

# need to adjust to the test suite hook
#root = Path(__file__).parent.parent

TEST_SUITE = "src/test-suite"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, this would then just be `"test-suite"


import mkdocs_gen_files

# need to adjust to the test suite hook
Copy link
Collaborator

Choose a reason for hiding this comment

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

There seem to be quite some comments that are no longer relevant in this gen_ref_pages.py. Would be good to clean those up.

@@ -43,7 +43,6 @@ nav:
- Set up environment: using_eessi/setting_up_environment.md
- Basic commands: using_eessi/basic_commands.md
- Demos: using_eessi/eessi_demos.md
- EESSI in CI: using_eessi/eessi_in_ci.md
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure why this was removed here, but this has a conflict with upstream that needs to be resolved anyway. I guess that'll sort this out too.

default_handler: python
handlers:
python:
paths: [src/test-suite]
Copy link
Collaborator

@casparvl casparvl Nov 13, 2024

Choose a reason for hiding this comment

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

This could also be shortened to paths: [test-suite], see the above changes.

uses: actions/checkout@v4
with:
repository: eessi/test-suite
path: src
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we just do this without path, i.e. in the current workdir? It will still clone into a subidr test-suite by default right? No need to nest that further inside a src I'd think.

@@ -1,6 +1,9 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: deploy documentation (only on push to main branch)
on:
schedule:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, I don't think we want this in the regular deploy.yml. Having a cronjob that directly deploys the API docs means we have no human in the loop to check the changes to the API docs, and whether they make sense. I think the way this was implemented for the software overview in https://github.com/EESSI/docs/blob/main/.github/workflows/update_available_software.yml makes more sense for now: do a build of the docs, then create a PR based on that. It means the auto-generated docs will actually be part of this repo, i.e. the physical *.md files will be files within the EESSI/docs repo. That'll allow us to do a check on them before they get deployed.

Long term, we might want to do this fully automatically, without human in the loop. But to start with, I think the human in the loop would be a good thing (even if someone needs to keep an eye on those PRs and merge them).

Copy link
Collaborator

@casparvl casparvl left a comment

Choose a reason for hiding this comment

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

I think the main change I'd suggest here is to not do the API docs generation as part of the deploy.yml, but in a way similar to how the update_available_software.yml workflow works (i.e. copy that workflow, and adapt it to generate the API docs instead of the available software list). This workflow creates a PR to EESSI/docs every X time (on a cronjob), which allows us to have a human in the loop to check what was generated and if that makes sense.

In the future, we could even see if the workflow could be triggered on push to the main branch of EESSI/test-suite. It seems something like that should be possible https://medium.com/hostspaceng/triggering-workflows-in-another-repository-with-github-actions-4f581f8e0ceb but that's no priority right now.

@boegel boegel changed the title Generate api docs Generate api docs for EESSI test suite Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants