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

jsonschema2md installation issue in github CI #334

Closed
shahzebsiddiqui opened this issue Aug 10, 2021 · 6 comments
Closed

jsonschema2md installation issue in github CI #334

shahzebsiddiqui opened this issue Aug 10, 2021 · 6 comments
Labels

Comments

@shahzebsiddiqui
Copy link

Expected Behaviour

I am trying to use my CI job to publish jsonschema into markdown pages which are pushed to gh-pages branch that is hosted at https://buildtesters.github.io/buildtest/. I have links to schemas but right now they are broken because the the jsonschema2md is not getting installed.

Actual Behaviour

I am getting an error during installation of jsonschema2md see https://github.com/buildtesters/buildtest/runs/3292731029?check_suite_focus=true#step:4:1

Run npm install -g @adobe/jsonschema2md
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
/opt/hostedtoolcache/node/14.17.4/x64/bin/jsonschema2md -> /opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/cli.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@adobe/jsonschema2md/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @adobe/jsonschema2md@6.1.0
added 653 packages from 342 contributors in 25.67s
loading 6 schemas
writing schemas
writing schemas to /home/runner/work/buildtest/buildtest/out
writing README
building readme
writing documentation
generating markdown
(node:1726) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'longdescription' of undefined
    at /opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:745:48
    at Array.map (<anonymous>)
    at makeproplist (/opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:744:61)
    at /opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:809:16
    at Array.map (<anonymous>)
    at makedefinitions (/opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:796:10)
    at /opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:866:10
    at /opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/node_modules/ferrum/src/sequence.js:1234:12
    at /opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/node_modules/ferrum/src/sequence.js:807:5
    at each [CURRY] (/opt/hostedtoolcache/node/14.17.4/x64/lib/node_modules/@adobe/jsonschema2md/node_modules/ferrum/src/functional.js:240:12)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1726) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

Reproduce Scenario (including but not limited to)

Here is a CI job that worked https://github.com/buildtesters/buildtest/runs/3210618355.

Steps to Reproduce

Please see my CI file https://github.com/buildtesters/buildtest/blob/devel/.github/workflows/jsonschemadocs.yml

Platform and Version

ubuntu-20.04
jsonschema2md@6.1.0

Logs taken while reproducing problem

@trieloff
Copy link
Collaborator

Looks like the installation works just fine, but there seems to be an issue with your schema. Are you able to create a minimal test case that throws the same error and share the schema?

@shahzebsiddiqui
Copy link
Author

Okay i have tried to install this locally to test this out and indeed i am running into error

(buildtest) bash-3.2$ jsonschema2md -d buildtest/schemas/ -o schemadocs
loading 6 schemas
writing schemas
writing schemas to /Users/siddiq90/Documents/GitHubDesktop/buildtest/out
writing README
building readme
writing documentation
generating markdown
/usr/local/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:745
        const description = definition[s.meta].longdescription || paragraph(text(i18n`no description`));
                                               ^

TypeError: Cannot read property 'longdescription' of undefined
    at /usr/local/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:745:48
    at Array.map (<anonymous>)
    at makeproplist (/usr/local/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:744:61)
    at /usr/local/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:809:16
    at Array.map (<anonymous>)
    at makedefinitions (/usr/local/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:796:10)
    at /usr/local/lib/node_modules/@adobe/jsonschema2md/lib/markdownBuilder.js:866:10
    at /usr/local/lib/node_modules/@adobe/jsonschema2md/node_modules/ferrum/src/sequence.js:1234:12
    at /usr/local/lib/node_modules/@adobe/jsonschema2md/node_modules/ferrum/src/sequence.js:807:5
    at each [CURRY] (/usr/local/lib/node_modules/@adobe/jsonschema2md/node_modules/ferrum/src/functional.js:240:12)

Here is some relevant details about my setup

(buildtest) bash-3.2$ npm --version
7.3.0
(buildtest) bash-3.2$ node --version
v15.5.1
(buildtest) bash-3.2$ jsonschema2md --version
6.1.0

@shahzebsiddiqui
Copy link
Author

shahzebsiddiqui commented Aug 12, 2021

Is there some debug option to show what is wrong with the schema. I know the schema is correct since i have regression tests against the schema files. What i don't understand is what is Cannot read property 'longdescription' of undefined

The schemas are located in https://github.com/buildtesters/buildtest/tree/devel/buildtest/schemas

I just did a quick search for description for all JSON files see https://github.com/buildtesters/buildtest/search?l=JSON&q=description not sure if this helps. I am wondering does the backticks cause issues i was informed that these get formatted correctly into markdown pages

@trieloff
Copy link
Collaborator

Thanks, I found and fixed the issue. Release is on the way.

trieloff pushed a commit that referenced this issue Aug 12, 2021
## [6.1.1](v6.1.0...v6.1.1) (2021-08-12)

### Bug Fixes

* **markdownbuilder:** guard against empty definitions object ([f1b90c2](f1b90c2)), closes [#334](#334)
@trieloff
Copy link
Collaborator

🎉 This issue has been resolved in version 6.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@shahzebsiddiqui
Copy link
Author

thanks @trieloff that fixed the issue with the new version. Just tested this out

(buildtest) bash-3.2$ jsonschema2md -d buildtest/schemas/ -o schemadocs
loading 6 schemas
writing schemas
writing schemas to /Users/siddiq90/Documents/GitHubDesktop/buildtest/out
writing README
building readme
writing documentation
generating markdown
/Users/siddiq90/Documents/GitHubDesktop/buildtest/schemadocs/README.md created

Now the markdown files are generated before i only saw one file

(buildtest) bash-3.2$ ls schemadocs/
README.md
compiler-v1-definitions-cc.md
compiler-v1-definitions-cflags.md
compiler-v1-definitions-compiler_declaration-properties-bb.md
compiler-v1-definitions-compiler_declaration-properties-bsub.md
compiler-v1-definitions-compiler_declaration-properties-cobalt.md
compiler-v1-definitions-compiler_declaration-properties-dw.md
compiler-v1-definitions-compiler_declaration-properties-module-properties-purge.md
compiler-v1-definitions-compiler_declaration-properties-module-properties-restore.md
compiler-v1-definitions-compiler_declaration-properties-module-properties-swap-items.md
compiler-v1-definitions-compiler_declaration-properties-module-properties-swap.md
compiler-v1-definitions-compiler_declaration-properties-module.md
compiler-v1-definitions-compiler_declaration-properties-pbs.md
compiler-v1-definitions-compiler_declaration-properties-sbatch.md
compiler-v1-definitions-compiler_declaration.md
compiler-v1-definitions-cppflags.md
compiler-v1-definitions-cxx.md
compiler-v1-definitions-cxxflags.md
compiler-v1-definitions-default_compiler_all-properties-bb.md
compiler-v1-definitions-default_compiler_all-properties-bsub.md
compiler-v1-definitions-default_compiler_all-properties-cobalt.md
compiler-v1-definitions-default_compiler_all-properties-dw.md
compiler-v1-definitions-default_compiler_all-properties-pbs.md
compiler-v1-definitions-default_compiler_all-properties-sbatch.md
compiler-v1-definitions-default_compiler_all.md
compiler-v1-definitions-default_compiler_config-properties-bb.md
compiler-v1-definitions-default_compiler_config-properties-bsub.md
compiler-v1-definitions-default_compiler_config-properties-cobalt.md
compiler-v1-definitions-default_compiler_config-properties-dw.md
compiler-v1-definitions-default_compiler_config-properties-pbs.md
compiler-v1-definitions-default_compiler_config-properties-sbatch.md
compiler-v1-definitions-default_compiler_config.md
compiler-v1-definitions-fc.md
compiler-v1-definitions-fflags.md
compiler-v1-definitions-ldflags.md
compiler-v1-definitions-post_build.md
compiler-v1-definitions-post_run.md
compiler-v1-definitions-pre_build.md
compiler-v1-definitions-pre_run.md
compiler-v1-definitions-run.md
compiler-v1-definitions.md
compiler-v1-properties-compilers-properties-config-patternproperties.md
compiler-v1-properties-compilers-properties-config.md
compiler-v1-properties-compilers-properties-default.md
compiler-v1-properties-compilers.md
compiler-v1-properties-description.md
compiler-v1-properties-executor.md
compiler-v1-properties-skip.md
compiler-v1-properties-source.md
compiler-v1-properties-tags.md
compiler-v1-properties-type.md
compiler-v1.md
definitions-definitions-batch-properties-account.md
definitions-definitions-batch-properties-begintime.md
definitions-definitions-batch-properties-cpucount.md
definitions-definitions-batch-properties-email-address.md
definitions-definitions-batch-properties-exclusive.md
definitions-definitions-batch-properties-memory.md
definitions-definitions-batch-properties-network.md
definitions-definitions-batch-properties-nodecount.md
definitions-definitions-batch-properties-qos.md
definitions-definitions-batch-properties-queue.md
definitions-definitions-batch-properties-tasks-per-core.md
definitions-definitions-batch-properties-tasks-per-node.md
definitions-definitions-batch-properties-tasks-per-socket.md
definitions-definitions-batch-properties-timelimit.md
definitions-definitions-batch.md
definitions-definitions-description.md
definitions-definitions-env-items-propertynames.md
definitions-definitions-env-items.md
definitions-definitions-env.md
definitions-definitions-executor.md
definitions-definitions-executors-patternproperties--properties.md
definitions-definitions-executors-patternproperties-.md
definitions-definitions-executors-patternproperties.md
definitions-definitions-executors.md
definitions-definitions-int_or_list-oneof-0.md
definitions-definitions-int_or_list.md
definitions-definitions-list_of_ints-items.md
definitions-definitions-list_of_ints.md
definitions-definitions-list_of_strings-items.md
definitions-definitions-list_of_strings.md
definitions-definitions-metrics-patternproperties.md
definitions-definitions-metrics.md
definitions-definitions-metrics_field-properties-env.md
definitions-definitions-metrics_field-properties-vars.md
definitions-definitions-metrics_field.md
definitions-definitions-regex-properties-exp.md
definitions-definitions-regex-properties-stream.md
definitions-definitions-regex.md
definitions-definitions-run_only-properties-linux_distro-items.md
definitions-definitions-run_only-properties-linux_distro.md
definitions-definitions-run_only-properties-platform.md
definitions-definitions-run_only-properties-scheduler.md
definitions-definitions-run_only-properties-user.md
definitions-definitions-run_only.md
definitions-definitions-skip.md
definitions-definitions-status-properties-runtime-properties-max.md
definitions-definitions-status-properties-runtime-properties-min.md
definitions-definitions-status-properties-runtime.md
definitions-definitions-status-properties-slurm_job_state.md
definitions-definitions-status.md
definitions-definitions-string_or_list-oneof-0.md
definitions-definitions-string_or_list.md
definitions-definitions.md
definitions.md
global-properties-buildspecs-propertynames.md
global-properties-buildspecs.md
global-properties-maintainers-items.md
global-properties-maintainers.md
global-properties-version.md
global.md
script-v1-properties-bb.md
script-v1-properties-bsub.md
script-v1-properties-cobalt.md
script-v1-properties-dw.md
script-v1-properties-pbs.md
script-v1-properties-run.md
script-v1-properties-sbatch.md
script-v1-properties-shebang.md
script-v1-properties-shell.md
script-v1-properties-tags.md
script-v1-properties-type.md
script-v1.md
settings-definitions-account.md
settings-definitions-cc.md
settings-definitions-cobalt-properties-account.md
settings-definitions-cobalt-properties-after_script.md
settings-definitions-cobalt-properties-before_script.md
settings-definitions-cobalt-properties-description.md
settings-definitions-cobalt-properties-launcher.md
settings-definitions-cobalt-properties-max_pend_time.md
settings-definitions-cobalt-properties-options-items.md
settings-definitions-cobalt-properties-options.md
settings-definitions-cobalt-properties-queue.md
settings-definitions-cobalt.md
settings-definitions-compiler_section-properties-cc.md
settings-definitions-compiler_section-properties-cxx.md
settings-definitions-compiler_section-properties-fc.md
settings-definitions-compiler_section.md
settings-definitions-cxx.md
settings-definitions-fc.md
settings-definitions-local-properties-before_script.md
settings-definitions-local-properties-description.md
settings-definitions-local-properties-shell.md
settings-definitions-local.md
settings-definitions-lsf-properties-account.md
settings-definitions-lsf-properties-after_script.md
settings-definitions-lsf-properties-before_script.md
settings-definitions-lsf-properties-description.md
settings-definitions-lsf-properties-launcher.md
settings-definitions-lsf-properties-max_pend_time.md
settings-definitions-lsf-properties-options-items.md
settings-definitions-lsf-properties-options.md
settings-definitions-lsf-properties-queue.md
settings-definitions-lsf.md
settings-definitions-max_pend_time.md
settings-definitions-module-properties-purge.md
settings-definitions-module-properties-swap-items.md
settings-definitions-module-properties-swap.md
settings-definitions-module.md
settings-definitions-pbs-properties-account.md
settings-definitions-pbs-properties-after_script.md
settings-definitions-pbs-properties-before_script.md
settings-definitions-pbs-properties-description.md
settings-definitions-pbs-properties-launcher.md
settings-definitions-pbs-properties-max_pend_time.md
settings-definitions-pbs-properties-options-items.md
settings-definitions-pbs-properties-options.md
settings-definitions-pbs-properties-queue.md
settings-definitions-pbs.md
settings-definitions-script-items.md
settings-definitions-script.md
settings-definitions-slurm-properties-account.md
settings-definitions-slurm-properties-after_script.md
settings-definitions-slurm-properties-before_script.md
settings-definitions-slurm-properties-cluster.md
settings-definitions-slurm-properties-description.md
settings-definitions-slurm-properties-launcher.md
settings-definitions-slurm-properties-max_pend_time.md
settings-definitions-slurm-properties-options-items.md
settings-definitions-slurm-properties-options.md
settings-definitions-slurm-properties-partition.md
settings-definitions-slurm-properties-qos.md
settings-definitions-slurm.md
settings-definitions-system-properties-buildspec_roots-items.md
settings-definitions-system-properties-buildspec_roots.md
settings-definitions-system-properties-cdash-properties-project.md
settings-definitions-system-properties-cdash-properties-site.md
settings-definitions-system-properties-cdash-properties-url.md
settings-definitions-system-properties-cdash.md
settings-definitions-system-properties-compilers-properties-compiler-properties-clang-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-clang.md
settings-definitions-system-properties-compilers-properties-compiler-properties-cray-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-cray.md
settings-definitions-system-properties-compilers-properties-compiler-properties-cuda-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-cuda.md
settings-definitions-system-properties-compilers-properties-compiler-properties-gcc-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-gcc.md
settings-definitions-system-properties-compilers-properties-compiler-properties-intel-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-intel.md
settings-definitions-system-properties-compilers-properties-compiler-properties-pgi-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-pgi.md
settings-definitions-system-properties-compilers-properties-compiler-properties-upcxx-patternproperties.md
settings-definitions-system-properties-compilers-properties-compiler-properties-upcxx.md
settings-definitions-system-properties-compilers-properties-compiler.md
settings-definitions-system-properties-compilers-properties-find-properties-clang.md
settings-definitions-system-properties-compilers-properties-find-properties-cray.md
settings-definitions-system-properties-compilers-properties-find-properties-cuda.md
settings-definitions-system-properties-compilers-properties-find-properties-gcc.md
settings-definitions-system-properties-compilers-properties-find-properties-intel.md
settings-definitions-system-properties-compilers-properties-find-properties-pgi.md
settings-definitions-system-properties-compilers-properties-find-properties-upcxx.md
settings-definitions-system-properties-compilers-properties-find.md
settings-definitions-system-properties-compilers.md
settings-definitions-system-properties-description.md
settings-definitions-system-properties-executors-properties-cobalt-patternproperties.md
settings-definitions-system-properties-executors-properties-cobalt.md
settings-definitions-system-properties-executors-properties-defaults-properties-account.md
settings-definitions-system-properties-executors-properties-defaults-properties-launcher.md
settings-definitions-system-properties-executors-properties-defaults-properties-max_pend_time.md
settings-definitions-system-properties-executors-properties-defaults-properties-pollinterval.md
settings-definitions-system-properties-executors-properties-defaults.md
settings-definitions-system-properties-executors-properties-local-patternproperties.md
settings-definitions-system-properties-executors-properties-local.md
settings-definitions-system-properties-executors-properties-lsf-patternproperties.md
settings-definitions-system-properties-executors-properties-lsf.md
settings-definitions-system-properties-executors-properties-pbs-patternproperties.md
settings-definitions-system-properties-executors-properties-pbs.md
settings-definitions-system-properties-executors-properties-slurm-patternproperties.md
settings-definitions-system-properties-executors-properties-slurm.md
settings-definitions-system-properties-executors.md
settings-definitions-system-properties-hostnames-items.md
settings-definitions-system-properties-hostnames.md
settings-definitions-system-properties-load_default_buildspecs.md
settings-definitions-system-properties-logdir.md
settings-definitions-system-properties-moduletool.md
settings-definitions-system-properties-processor-properties-arch.md
settings-definitions-system-properties-processor-properties-core_per_socket.md
settings-definitions-system-properties-processor-properties-cores.md
settings-definitions-system-properties-processor-properties-model.md
settings-definitions-system-properties-processor-properties-numcpus.md
settings-definitions-system-properties-processor-properties-sockets.md
settings-definitions-system-properties-processor-properties-threads_per_core.md
settings-definitions-system-properties-processor-properties-vendor.md
settings-definitions-system-properties-processor.md
settings-definitions-system-properties-testdir.md
settings-definitions-system.md
settings-definitions-unique_string_array-items.md
settings-definitions-unique_string_array.md
settings-definitions.md
settings-properties-system-patternproperties.md
settings-properties-system.md
settings.md
spack-v1-definitions-env-properties-activate-properties-dir.md
spack-v1-definitions-env-properties-activate-properties-name.md
spack-v1-definitions-env-properties-activate-properties-options.md
spack-v1-definitions-env-properties-activate.md
spack-v1-definitions-env-properties-concretize.md
spack-v1-definitions-env-properties-create-properties-dir.md
spack-v1-definitions-env-properties-create-properties-manifest.md
spack-v1-definitions-env-properties-create-properties-name.md
spack-v1-definitions-env-properties-create-properties-options.md
spack-v1-definitions-env-properties-create-properties-remove_environment.md
spack-v1-definitions-env-properties-create.md
spack-v1-definitions-env-properties-rm-properties-name.md
spack-v1-definitions-env-properties-rm.md
spack-v1-definitions-env.md
spack-v1-definitions-install-properties-options.md
spack-v1-definitions-install.md
spack-v1-definitions-test-properties-remove_tests.md
spack-v1-definitions-test-properties-results-anyof-0.md
spack-v1-definitions-test-properties-results-anyof-1.md
spack-v1-definitions-test-properties-results-anyof-2.md
spack-v1-definitions-test-properties-results-properties-option.md
spack-v1-definitions-test-properties-results.md
spack-v1-definitions-test-properties-run-properties-option.md
spack-v1-definitions-test-properties-run.md
spack-v1-definitions-test.md
spack-v1-definitions.md
spack-v1-properties-bb.md
spack-v1-properties-bsub.md
spack-v1-properties-cobalt.md
spack-v1-properties-dw.md
spack-v1-properties-pbs.md
spack-v1-properties-post_cmds.md
spack-v1-properties-pre_cmds.md
spack-v1-properties-sbatch.md
spack-v1-properties-spack-properties-compiler_find.md
spack-v1-properties-spack-properties-root.md
spack-v1-properties-spack-properties-verify_spack.md
spack-v1-properties-spack.md
spack-v1-properties-tags.md
spack-v1-properties-type.md
spack-v1.md

Thanks for all your help. That was quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants