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

Unable to build multirepo docs for Gitlab Pages #133

Open
alexeych0 opened this issue Dec 17, 2023 · 3 comments
Open

Unable to build multirepo docs for Gitlab Pages #133

alexeych0 opened this issue Dec 17, 2023 · 3 comments

Comments

@alexeych0
Copy link

alexeych0 commented Dec 17, 2023

I'm using multirepo plugin with nav_repos config:

mkdocs.yml:

- multirepo:
    cleanup: false
    nav_repos:
        -
            name: developers-docs
            import_url: https://my.gitlab.com/project-online/developers-doc?edit_uri=edit/master
            imports:
                - 'docs/contracts/api.md'

Everything works fine, when I run mkdocs serve / mkdocs build locally. However, when building the docs from Gitlab CI job, I'm facing the issue that remote repositories are cloned only when the documentation already has been built. As a result, the output directory site doesn't have the imported repos, causing 404 errors.

Here's the example:

$ mkdocs build
INFO    -  DeprecationWarning: warning_filter doesn't do anything since MkDocs 1.2 and will be removed soon. All messages on the `mkdocs` logger get counted automatically.
  File "/usr/local/lib/python3.11/site-packages/mkdocs_multirepo_plugin/util.py", line 10, in <module>
    from mkdocs.utils import warning_filter
  File "/usr/local/lib/python3.11/site-packages/mkdocs/utils/__init__.py", line 453, in __getattr__
    warnings.warn(
INFO    -  [macros] - Macros arguments: {'module_name': 'main', 'modules': [], 'render_by_default': True, 'include_dir': '', 'include_yaml': [], 'j2_block_start_string': '', 'j2_block_end_string': '', 'j2_variable_start_string': '', 'j2_variable_end_string': '', 'on_undefined': 'keep', 'on_error_fail': False, 'verbose': False}
INFO    -  [macros] - Extra variables (config file): ['tags', 'generator', 'version', 'vars']
INFO    -  [macros] - Extra filters (module): ['pretty']
INFO    -  Multirepo plugin importing docs...
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /builds/project-online/general-doc/site
INFO    -  Documentation built in 3.87 seconds
🔳 developers-doc
✅ developers-doc (0.013 secs)

Notice line 10. Normally, developers-doc import is started and completed right after the log "Multirepo plugin importing docs...". But somehow running this command from Gitlab Runner alters this behavior and its execution postponed until it's already too late.

Do you have any ideas what's happening here?

@cardoe
Copy link
Contributor

cardoe commented Aug 9, 2024

I believe I'm hitting this as well and it's related to the usage of asyncio. Only have a couple of guesses here but another plugin could be calling asyncio.run() but the code definitely doesn't wait for the clone to finish for me as well.

@alexeych0
Copy link
Author

alexeych0 commented Aug 12, 2024

Eventually, wasn't able to locate the problem. But, the issue is resolved for us after we migrated Gitlab runners to k8s. Maybe it was something with the runner config or with the vm it was previously executed on

@cardoe
Copy link
Contributor

cardoe commented Sep 14, 2024

I would agree that it was a runner config after playing with this plugin a bit. It's not the async like I implied at first.

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

No branches or pull requests

2 participants