Giter VIP home page Giter VIP logo

Comments (5)

clarkmcc avatar clarkmcc commented on June 12, 2024 1

@franz-josef-kaiser sorry, this issue auto-closed when I merged the PR. I'd say feel free to create issues for the other ideas/feedback you have and I'll prioritize them accordingly!

from go-hubspot.

clarkmcc avatar clarkmcc commented on June 12, 2024

Hi! Love the idea of generation in a container, that will make it more friendly and approachable to use. Currently you can generate everything (directories, formatting, patching, etc) with

go generate ./...

This handles a lot of stuff that isn't handled natively by the openapi-generator. You can see everything we're doing manually on top of generation here.

The main challenge with automated the generation is that manual patches need to be verified by hand and tested before committing. For example, I just updated this library to the newest version of the Hubspot client API spec and the recent auth changes broke how we're doing auth in this library, so I had to resolve that first.

Once/if API generation is a stable hands-off process, then I think we can automate it. Until then, it seems like manual generation with go generate + manual auditing might be required.

Thoughts?

from go-hubspot.

franz-josef-kaiser avatar franz-josef-kaiser commented on June 12, 2024

Well, it's my third day with Go (decade+ of other languages so far), so please take this into account when weighting my suggestions.

For the process itself, I'd say it's quite safe to automate towards a PR as this forces (haha) someone to do a review before merging.

I read through the generator file and saw that the process currently is bound to your user anyway. I also found that you execute the generator call in the process. Maybe it's a first step to move this to Docker so the at least the environment is stable (therefore more reliable and comparable) between runs and independent from a local machines setup?

One more thing -I know I am going off route here- is the general quality of the generated READMEs. As someone not that used to Go, I am having a hard time interpreting the examples. I couldn't get around querying the search API with a POST request and adding FilterGroups. The generated docs are pointing to parts that are not available in the repo itself (like the openapisomething package) and are generally quite confusing. I managed to build a quick request using http.Client tough, while I completely failed to do something quite simple by reading the docs and trying to replicate what I found there. Anyways, that might be just me.

from go-hubspot.

clarkmcc avatar clarkmcc commented on June 12, 2024

Congrats! Welcome to Go.

If you want to propose an automated process for generating clients, I'd be happy to look at it. I'm not sure that I totally understand the proposal, initially I was thinking the idea was Github actions would run periodically and open PRs against the repo, but in your latest message it sounds like you're thinking more along the lines of generation in a docker container so that you don't have to install any tooling in your environment. I'm happy to consider either, the Github Actions approach definitely sounds more involved (periodic generation, automatic PRs, etc).

So the env variables that you mentioned are required by openapi generator in order to construct proper Go imports. The way it works is like this

import "github.com/$GIT_USER_ID/$GIT_REPO_ID"

so really the variables just need to match the name of the repo hosting the code rather then being specific to me or someone else. In other words, even if you're running this on your machine to prepare a PR for this repo, you'd still need my username and repo name in there in order to produce the proper code generation from openapi generator.

Totally agree on the generated readmes. To be honest, openapi-generator is absolute garbage at code generation. I've considered switching to https://github.com/deepmap/oapi-codegen since it's much more tailored to the Go language, but that's a breaking change for this library so I've put it on the back burner. This isn't a whole lot of help to you since you're just getting started in Go, but after some time in Go generally, the usage for this library should become more intuitive without referring to the readmes. I use Goland, and the intellisense is really all I'm using to figure out what I need to do. If you'd like, tell me what you're trying to do and I'd be happy to prepare a few code examples using this library to get you up and going.

from go-hubspot.

franz-josef-kaiser avatar franz-josef-kaiser commented on June 12, 2024

Hey @clarkmcc ! Thanks for the quick update.

from go-hubspot.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.