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

Generate OpenAPI client libraries #2060

Closed
wants to merge 32 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 20, 2019

Related to #2052 "Publish OpenAPI clients" this pullrequest introduces a openapi stage in .travis.yaml that can be triggered either forcefully or by pushing a tag.

Stages

The travis doc on stages explains the concepts.

test

All previous jobs in the matrix: are now in the jobs: dict and have been put into this stage. It is activated by default but can be deactivated by NO_TESTING=true in the repository setting (or environment variable)

openapi

This stage will generate and then publish the clients passed to the job on travis.

Client lib generation

The repository setting (or environment var) API_LANGS is a : delimited list of client libs to generate.
A list of possible clients can be found here.

Requirements

A parameter config in the /openapi folder for the client e.g /openapi/python.yaml. The params can be generated by running the docker openapi-cli (see /scripts/openapi-clients.sh) e.g openapitools/openapi-generator-cli config-help -g python

Client lib publication

The client lib will be pushed to a github repository of the format "https://github.com/${API_GIT_USER}/${API_REPO_PREFIX}${lang}.git".

See /scripts/openapi-clients.sh for the required environment variables.

Examples

https://github.com/LoveIsGrief/peertube-api-kotlin

https://github.com/LoveIsGrief/peertube-api-go

https://github.com/LoveIsGrief/peertube-api-python

TODO in down the line

  • versioning: each package config can have a version (maybe the same as peertube?)

  • the python template doesn't like a multi-lined description (see the repo above and it will be glaringly obvious)

  • Modify the .travis.yaml of each published client lib to:

    • run tests
    • publish to their package index
  • List each published package in the API documentation.

LoveIsGrief added 30 commits August 19, 2019 16:36
@Chocobozzz
Copy link
Owner

Thanks. I will pull and update your branch to use gitlab ci schedules to generate these packages, and I'll create a peertube-rest-api-packages repository on framagit to put all the packages in the same repo (easier to maintain/link)

@ghost
Copy link
Author

ghost commented Aug 21, 2019 via email

@ghost
Copy link
Author

ghost commented Jan 10, 2020

Hi @Chocobozzz, I checked https://framagit.org/framasoft/peertube and the peertube-rest-api-packages repo doesn't exist.

Should I lend a hand writing the .gitlab-ci.yaml?

@Chocobozzz
Copy link
Owner

Chocobozzz commented Jan 10, 2020

Hi, sorry for the late reply. I created the repository: https://framagit.org/framasoft/peertube/peertube-rest-api-packages

Please create a MR on framagit 👍

@Chocobozzz Chocobozzz closed this Jan 10, 2020
Chocobozzz pushed a commit that referenced this pull request Feb 17, 2020
See merge request framasoft/peertube/PeerTube!28, which continued #2060
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.

1 participant