42us-stupidity icon indicating copy to clipboard operation
42us-stupidity copied to clipboard

There are no tests for d10ex06

Open rpdelaney opened this issue 6 years ago • 0 comments

n/t

rpdelaney avatar May 29 '18 04:05 rpdelaney

@shanthisagar-dhanya-kumar-db, can you comment the Traceback so I can see the error messages?

jdoiro3 avatar May 11 '22 13:05 jdoiro3

59 asyncio_run(batch_import(repos))60 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/util.py", line 124, in asyncio_run61 asyncio.run(futures)62 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/asyncio/runners.py", line 44, in run63 return loop.run_until_complete(main)64 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/asyncio/base_events.py", line 616, in run_until_complete65 return future.result()66 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 264, in batch_import67 repo = await import_async68 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/asyncio/tasks.py", line 616, in _wait_for_one69 return f.result() # May raise f.exception().70 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 245, in import_docs71 await self.sparse_clone([self.docs_dir, self.config])72 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 123, in sparse_clone73 if git_supports_sparse_clone():74 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/util.py", line 89, in git_supports_sparse_clone75 git_v = git_version()76 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/util.py", line 75, in git_version77 output = subprocess.run(["git", "--version"], **extra_run_args)78 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/subprocess.py", line 489, in run79 with Popen(*popenargs, **kwargs) as process:80 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/subprocess.py", line 854, in init81 self._execute_child(args, executable, preexec_fn, close_fds,82 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/subprocess.py", line 1702, in _execute_child83 raise child_exception_type(errno_num, err_msg, err_filename)84FileNotFoundError: [Errno 2] No such file or directory: 'git'85: 0%| | 0/2 [00:00<?, ?it/s]86Task exception was never retrieved87future: <Task finished name='Task-3' coro=<DocsRepo.import_docs() done, defined at /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py:233> exception=FileNotFoundError(2, 'No such file or directory')>88Traceback (most recent call last):89 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 245, in import_docs90 await self.sparse_clone([self.docs_dir, self.config])91 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 123, in sparse_clone92 if git_supports_sparse_clone():93 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/util.py", line 89, in git_supports_sparse_clone94 git_v = git_version()95 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/util.py", line 75, in git_version96 output = subprocess.run(["git", "--version"], **extra_run_args)97 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/subprocess.py", line 489, in run98 with Popen(*popenargs, **kwargs) as process:99 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/subprocess.py", line 854, in init100 self._execute_child(args, executable, preexec_fn, close_fds,101 File "/opt/rh/rh-python38/root/usr/lib64/python3.8/subprocess.py", line 1702, in _execute_child102 raise child_exception_type(errno_num, err_msg, err_filename)103FileNotFoundError: [Errno 2] No such file or directory: 'git'

And my main mkdocs.yaml looks like this

site_name: 'ADRs' site_description: 'Main documentation for Architecture Design Records'

repo_url: XXX

plugins:

  • techdocs-core
  • multirepo

nav:

  • Index: 'index.md'
  • CTO ADR: '!import XXXX/browse/CPDA-ADR/mkdocs.yaml'
  • GCP CDA ADR: '!import XXXX/browse/GCDA-ADR/mkdocs.yaml'

The error above "No such file or directory: 'git'", does this mean that there needs to have git installed on that server?

@shanthisagar-dhanya-kumar-db, the plugin does require Git to be installed.

If the OS is Linux/MacOS, it assumes it's installed on the machine, otherwise it try's to find the git directory. I need to update the documentation to point to the Git requirement and output better error messages when cases like this come up.

jdoiro3 avatar May 12 '22 03:05 jdoiro3

I have now installed git and that specific issue got resolved. But I have another one

✅ Got GA ASR Docs: 0%| | 0/1 [00:00<?, ?it/s]38✅ Got GA ASR Docs: 100%|██████████| 1/1 [00:00<00:00, 2.78it/s] ✅ Got GA ASR Docs: 100%|██████████| 1/1 [00:00<00:00, 2.78it/s]

3940Traceback (most recent call last):41 File "/opt/rh/rh-python38/root/usr/local/bin/mkdocs", line 8, in 42 sys.exit(cli())43 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/click/core.py", line 1130, in __call__44 return self.main(*args, **kwargs)45 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/click/core.py", line 1055, in main46 rv = self.invoke(ctx)47 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/click/core.py", line 1657, in invoke48 return _process_result(sub_ctx.command.invoke(sub_ctx))49 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke50 return ctx.invoke(self.callback, **ctx.params)51 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/click/core.py", line 760, in invoke52 return __callback(*args, **kwargs)53 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs/main.py", line 192, in build_command54 build.build(config.load_config(**kwargs), dirty=not clean)55 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs/commands/build.py", line 257, in build56 config = config['plugins'].run_event('config', config)57 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs/plugins.py", line 102, in run_event58 result = method(item, **kwargs)59 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/plugin.py", line 153, in on_config60 return self.handle_nav_based_import(config)61 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/plugin.py", line 108, in handle_nav_based_import62 repo_config = repo.load_config()63 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 251, in load_config64 config = super().load_config(self.config)65 File "/opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages/mkdocs_multirepo_plugin/structure.py", line 149, in load_config66 raise ImportDocsException(f"{self.name} doesn't have {yml_file} at {str(config_file)}")67mkdocs_multirepo_plugin.util.ImportDocsException: GA ASR doesn't have mkdocs.yml at /tmp/backstage-l3mObl/temp_dir/GA ASR/mkdocs.yml

When I looked into the network share, it isn't creating the "temp_dir" under /tmp/backstage-l3mObl/. And also forgot to mention, we are using backstage-techdocs

Any thoughts on this?

@shanthisagar-dhanya-kumar-db, can you try to run the plugin without backstage and confirm that it works? I think backstage techdocs and the plugin might be interfering with each other possibly. You can also set cleanup=false to confirm that the temp_dir isn't being created.

Also the !import statements don't look right, since it looks like a path and not a url.

CTO ADR: '!import XXXX/browse/CPDA-ADR/mkdocs.yaml'

The statement should look like this

nav:
  - Home: 'index.md'
  - MicroService: '!import {url}?branch={branch}?docs_dir={path}?multi_docs={True | False}?config={filename}.yml'

jdoiro3 avatar May 18 '22 22:05 jdoiro3

I tried setting cleanup=false but with no luck We are hosting the docs under bitbucket. Would this create issue?

Also the url I have specified is correct https://STASH_URL/projects/CPTCTO/repos/adr

Does the below mean that the plugin was able to successfully clone the git project

image

There were two issues basically

  1. The bitbucket url which I had given was wrong. Instead of scm url, i gave browse url
  2. I hadn't set the git credentials. ( it should have failed instead of saying Got XXXXX )

Now after setting the right credentials using the following git config --global user.name "xxx" git config --global user.email "xxx" git config --global user.password "xxx"

it still fails with the same error. Basically, it wasn't able to get the files from remote to local.

I can confirm that without backstage, it is working as expected.

With backstage techdocs-core plugin, it is failing.

But, this is very strange that it is failing to git clone

image

It is very strange. The way MkDocs plugins work it might be a case where backstage's plugins are interfering with this plugin. I've been busy but when I get a chance will try and look into it.

jdoiro3 avatar Jun 09 '22 13:06 jdoiro3

@jdoiro3 : Thanks for that. can we please do it sooner than later? Sorry for pushing this but in our organization there is this scenario that we have to use the multirepo plugin to demonstrate its goodness to the wider audience. I can help with some of the things if you want to nail down on a date and time so that I can respond to this thread

I'm on vacation until June 19th so it won't be until then. Feel free to fork the repo and try to figure out what's going on in this case. Also, buying me a beer (see link on README) increasing your chances I'll devote hours to the issue.

jdoiro3 avatar Jun 11 '22 11:06 jdoiro3