-
Notifications
You must be signed in to change notification settings - Fork 21
chore(scripts): factor git repo id #499
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
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
@@ -5,7 +5,6 @@ | |||
"javascript-search": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe there are others in this file that we could also factor like apiPackage
for JS etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found those:
js:
apiPackage
java:
- groupId
- apiPackage
- invokerPackage
- library
php:
- I can only see some leftovers for
php-query-suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the list ! I removed all of it
925c6b0
to
02b74a0
Compare
36b225f
to
ae4d23b
Compare
02b74a0
to
422e8d0
Compare
422e8d0
to
5b80150
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvement, I just had two small questions but nothing bad. 🚀
@@ -72,6 +72,7 @@ public void processOpts() { | |||
// generator specific options | |||
setApiNameSuffix(Utils.API_SUFFIX); | |||
setParameterNamingConvention("camelCase"); | |||
additionalProperties.put("invokerPackage", "Algolia\\AlgoliaSearch"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't possible to move it in clients.config.json
instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be the purpose of clients.config.json
is to make data available to everything: scripts, generators, ci...
here it's only needed in the generators so I put it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I thought the main goal was just to deduplicate the config, but whatever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the openapitools.json
is fed directly into the generators, it is for deduplicating config so we can put it in the common place, that is generators
@@ -88,4 +89,8 @@ public void processOpts() { | |||
) | |||
); | |||
} | |||
|
|||
public String getComposerPackageName() { | |||
return "algolia/algoliasearch-client-php"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default method which computes the name doesn't work anymore without gitRepoId
in the openapitool.json
file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I don't really get why, there is a bug in openapi generator where if no value is provided for gitRepoId
, it will default to GIT_REPO_ID
(stupid code) and break the getComposePackageName
function.
But this does the same in the end
Thanks for the review :) |
🧭 What and Why
remove almost all guessable value from
openapitools.json
and put it inclients.config.json
or generators (because it's defined per language).This doesn't change much, just simplify some logic.
🧪 Test
CI