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

build(codegen): fix OpenAPI TypeError: error.response.data.on is not a function #2528

Merged
merged 1 commit into from
Jul 1, 2023

Conversation

petermetz
Copy link
Contributor

  1. Stopped using the openapi-generator-cli package to download the .jar files
    and instead went with a direct download approach after having reverse
    engineered the HTTP URLs that can be used for fetching the jars from
    the maven repository.
  2. The above appears to be a good fix because the third party service
    that was serving HTTP 504 errors was not the download link but the
    version validator link (e.g. a service that can tell us whether a
    specific version of the OpenAPI generator jar file exists or not). So,
    now that we just download exactly the versions of the .jars that we need
    there is no request sent to that other service and the problem therefore
    seems to have been solved.
  3. We no longer need to delete the openapitools.json file in the root
    because it no longer gets created to begin with due to the change from 1
  4. At this point it is really hard to tell if this is the last of this
    issue with the OpenAPI generator jar files, but one can hope.
  5. Attempting to speed up the CI by optimizing the build-dev job:
    It is no longer doing bundle name validation nor the custom checks by
    default and it also skips linting and codegen entirely which are now done
    by separate jobs that can run in parallel. This should also reduce the
    load we place on the public utility service that is hosting the .jar files
    for the OpenAPI generator because this way the 40+ CI jobs that we have
    at the moment won't each download a pair of >20 MB .jar files every time.

Fixes #2525

Signed-off-by: Peter Somogyvari [email protected]

@petermetz petermetz force-pushed the petermetz/issue2525 branch from c0fec5f to 7dbb26d Compare June 30, 2023 18:28
@petermetz petermetz self-assigned this Jun 30, 2023
…a function

1. Stopped using the openapi-generator-cli package to download the .jar files
and instead went with a direct download approach after having reverse
engineered the HTTP URLs that can be used for fetching the jars from
the maven repository.
2. The above appears to be a good fix because the third party service
that was serving HTTP 504 errors was not the download link but the
version validator link (e.g. a service that can tell us whether a
specific version of the OpenAPI generator jar file exists or not). So,
now that we just download exactly the versions of the .jars that we need
there is no request sent to that other service and the problem therefore
seems to have been solved.
3. We no longer need to delete the openapitools.json file in the root
because it no longer gets created to begin with due to the change from 1
4. At this point it is really hard to tell if this is the last of this
issue with the OpenAPI generator jar files, but one can hope.
5. Attempting to speed up the CI by optimizing the build-dev job:
It is no longer doing bundle name validation nor the custom checks by
default and it also skips linting and codegen entirely which are now done
by separate jobs that can run in parallel. This should also reduce the
load we place on the public utility service that is hosting the .jar files
for the OpenAPI generator because this way the 40+ CI jobs that we have
at the moment won't each download a pair of >20 MB .jar files every time.

Fixes hyperledger-cacti#2525

Signed-off-by: Peter Somogyvari <[email protected]>
@petermetz petermetz force-pushed the petermetz/issue2525 branch from 7dbb26d to 605173d Compare July 1, 2023 07:11
@petermetz petermetz merged commit 5f38831 into hyperledger-cacti:main Jul 1, 2023
@petermetz petermetz deleted the petermetz/issue2525 branch July 2, 2023 01:55
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.

build(codegen): fix OpenAPI TypeError: error.response.data.on is not a function
3 participants