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

feat(go): bootstrap go ingestion client #1102

Closed
wants to merge 18 commits into from
Closed

feat(go): bootstrap go ingestion client #1102

wants to merge 18 commits into from

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Oct 23, 2022

🧭 What and Why

Bootstrap the GO api client generation, with the ingestion API as a first test.
This is very basic for now, but it works good enough for the ingestion API, it's not ready for the other Algolia API yet.

There is no CI support for now, maybe in the next PR.

The go client is compatible with golang 1.13, like the current algoliasearch-client-go package.

Changes included:

  • Add GO to the docker image
  • Create the go-ingestion client
  • Create custom GO generator

🧪 Test

The CTS is being made in #1115.

You can try the playground by running yarn docker playground go ingestion.

@millotp millotp self-assigned this Oct 23, 2022
@millotp millotp requested a review from a team as a code owner October 23, 2022 10:01
@millotp millotp requested review from damcou and shortcuts and removed request for a team October 23, 2022 10:01
@algolia-bot
Copy link
Collaborator

algolia-bot commented Oct 23, 2022

✔️ Code generated!

Name Link
🔨 Triggered by 14d00c601fb684d7c911616c07591b27fc7e3cbb
🔍 Generated code 47693a19488f1e3309a155160897af9a15a12333
🌲 Generated branch generated/feat/go-client

@netlify
Copy link

netlify bot commented Oct 23, 2022

Deploy Preview for api-clients-automation ready!

Name Link
🔨 Latest commit 14d00c6
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/6398576a33d2bc00089cbd7e
😎 Deploy Preview https://deploy-preview-1102--api-clients-automation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@millotp millotp force-pushed the feat/go-client branch 3 times, most recently from aa28692 to 29f247c Compare October 27, 2022 08:28
@millotp millotp force-pushed the feat/ingestion-client branch from 98e6ec5 to fbec6ec Compare October 27, 2022 08:38
@millotp millotp force-pushed the feat/go-client branch 2 times, most recently from 4036310 to 9a0ea0f Compare October 27, 2022 17:58
@millotp millotp force-pushed the feat/go-client branch 2 times, most recently from 1935d4b to bbd5f47 Compare November 3, 2022 14:10
@millotp millotp force-pushed the feat/ingestion-client branch from 5845069 to e5b5230 Compare December 12, 2022 13:23
Base automatically changed from feat/ingestion-client to main December 12, 2022 17:22
mehmetaligok added a commit that referenced this pull request Mar 28, 2023
## 🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-656

Go API client generation initial setup to prepare the groundwork is implemented. It is heavily inspired by #1102. As decided in the RFC Go 1.19 is set as the version to go for now. 

### Changes included:

- CI pipeline updated to not break current flows. 
- Dockerfile updated to support go. 
- Client configs are created according to https://github.com/algolia/algoliasearch-client-go. 
- Go code generator implemented in `generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java` to follow a similar folder/packaging as the original client.
- Basic playground setup for ingestion client is created. 
- Initial Go templates are created. It is mostly copied from #1102 and some parts are altered to cover other cases. Most of the creation problems are fixed but still, there are some problems to be handled in the future. Since it is already far from ready. It is not logical to block groundwork development for now. 

### Future Steps:
 - Go mustache templates still need more improvements.
     - Optional body parameters are not properly handled yet. In some cases, code generation is not working as expected.
     - All the [client requirements](https://api-clients-automation.netlify.app/docs/contributing/add-new-language/#algolia-requirements) should be implemented in the generated code. 
 - CTS development should be done. 
 - The release pipeline for the generated code should be set to create automated releases on the API client. 
 - (Nice to Have) fix docker container PATH to recognize go with yarn commands.
     - Somehow [`run`](https://github.com/algolia/api-clients-automation/blob/main/scripts/common.ts#L78) function PATH was not capturing the PATH updates that I made in Dockerfile. I have tried different approaches but couldn't resolve it properly.

## 🧪 Test

A small playground example was added. Initial linting with the generated code is fine except for some cases mentioned on `Future Steps`.
@millotp
Copy link
Collaborator Author

millotp commented Apr 6, 2023

No longer relevant

@millotp millotp closed this Apr 6, 2023
@millotp millotp deleted the feat/go-client branch April 6, 2023 10:11
mehmetaligok added a commit to algolia/algoliasearch-client-go that referenced this pull request May 3, 2023
## 🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-656

Go API client generation initial setup to prepare the groundwork is implemented. It is heavily inspired by algolia/api-clients-automation#1102. As decided in the RFC Go 1.19 is set as the version to go for now. 

### Changes included:

- CI pipeline updated to not break current flows. 
- Dockerfile updated to support go. 
- Client configs are created according to https://github.com/algolia/algoliasearch-client-go. 
- Go code generator implemented in `generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java` to follow a similar folder/packaging as the original client.
- Basic playground setup for ingestion client is created. 
- Initial Go templates are created. It is mostly copied from algolia/api-clients-automation#1102 and some parts are altered to cover other cases. Most of the creation problems are fixed but still, there are some problems to be handled in the future. Since it is already far from ready. It is not logical to block groundwork development for now. 

### Future Steps:
 - Go mustache templates still need more improvements.
     - Optional body parameters are not properly handled yet. In some cases, code generation is not working as expected.
     - All the [client requirements](https://api-clients-automation.netlify.app/docs/contributing/add-new-language/#algolia-requirements) should be implemented in the generated code. 
 - CTS development should be done. 
 - The release pipeline for the generated code should be set to create automated releases on the API client. 
 - (Nice to Have) fix docker container PATH to recognize go with yarn commands.
     - Somehow [`run`](https://github.com/algolia/api-clients-automation/blob/main/scripts/common.ts#L78) function PATH was not capturing the PATH updates that I made in Dockerfile. I have tried different approaches but couldn't resolve it properly.

## 🧪 Test

A small playground example was added. Initial linting with the generated code is fine except for some cases mentioned on `Future Steps`.
shortcuts pushed a commit to algolia/algoliasearch-client-python that referenced this pull request Nov 24, 2023
## 🧭 What and Why

🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-656

Go API client generation initial setup to prepare the groundwork is implemented. It is heavily inspired by algolia/api-clients-automation#1102. As decided in the RFC Go 1.19 is set as the version to go for now. 

### Changes included:

- CI pipeline updated to not break current flows. 
- Dockerfile updated to support go. 
- Client configs are created according to https://github.com/algolia/algoliasearch-client-go. 
- Go code generator implemented in `generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java` to follow a similar folder/packaging as the original client.
- Basic playground setup for ingestion client is created. 
- Initial Go templates are created. It is mostly copied from algolia/api-clients-automation#1102 and some parts are altered to cover other cases. Most of the creation problems are fixed but still, there are some problems to be handled in the future. Since it is already far from ready. It is not logical to block groundwork development for now. 

### Future Steps:
 - Go mustache templates still need more improvements.
     - Optional body parameters are not properly handled yet. In some cases, code generation is not working as expected.
     - All the [client requirements](https://api-clients-automation.netlify.app/docs/contributing/add-new-language/#algolia-requirements) should be implemented in the generated code. 
 - CTS development should be done. 
 - The release pipeline for the generated code should be set to create automated releases on the API client. 
 - (Nice to Have) fix docker container PATH to recognize go with yarn commands.
     - Somehow [`run`](https://github.com/algolia/api-clients-automation/blob/main/scripts/common.ts#L78) function PATH was not capturing the PATH updates that I made in Dockerfile. I have tried different approaches but couldn't resolve it properly.

## 🧪 Test

A small playground example was added. Initial linting with the generated code is fine except for some cases mentioned on `Future Steps`.
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.

2 participants