argoproj-labs / argo-client-gen Goto Github PK
View Code? Open in Web Editor NEW⚠️⚠️⚠️This repository is no longer maintained, please find your Java SDKs https://github.com/argoproj/argo-workflows/blob/master/docs/client-libraries.md ⚠️⚠️⚠️
⚠️⚠️⚠️This repository is no longer maintained, please find your Java SDKs https://github.com/argoproj/argo-workflows/blob/master/docs/client-libraries.md ⚠️⚠️⚠️
To reproduce:
# Submit a workflow where withItems is an array of strings.
argo submit https://raw.githubusercontent.com/argoproj/argo/master/examples/loops-dag.yaml
# Grab my branch with the test modified to just list workflows.
git clone https://github.com/mac9416/argo-client-gen
cd argo-client-gen
git checkout withitems-bug
# Build and test.
make java
make test-java
You should receive the following error:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 758 path $.items[0].spec.templates[0].dag.tasks[1].withItems[0]
at io.argoproj.workflow.SmokeIT.testArgoServerAPI(SmokeIT.java:39)
Ideally fixing argoproj/argo-workflows#2790 would fix this. But I suspect that bug will require using Swagger's oneOf
feature, which it looks like openapi-generator does not yet support.
Assuming we can't find a swagger spec that satisfies openapi-generator, maybe the next best solution is to override withItems
to be simply a list of objects. That would allow proper posting of workflows. It may even permit proper retrieval, assuming the client can cast to a known type.
To go that route, we'd probably want to create a named, synthetic type in swagger.json to represent the type of withItems
. That would allow easily overriding the type by name in openapi-generator. If the type info were embedded directly in the withItems
block, I'm not sure it could be overridden so easily.
Here's the failure in the build logs:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/mcrenshaw/src/argo-client-gen/java/src/main/java/io/argoproj/workflow/models/Template.java:[28,35] cannot find symbol
symbol: class IoArgoprojV1alpha1WorkflowStep
location: package io.argoproj.workflow.models
[ERROR] /home/mcrenshaw/src/argo-client-gen/java/src/main/java/io/argoproj/workflow/models/Template.java:[169,21] cannot find symbol
symbol: class IoArgoprojV1alpha1WorkflowStep
location: class io.argoproj.workflow.models.Template
[ERROR] /home/mcrenshaw/src/argo-client-gen/java/src/main/java/io/argoproj/workflow/models/Template.java:[891,35] cannot find symbol
symbol: class IoArgoprojV1alpha1WorkflowStep
location: class io.argoproj.workflow.models.Template
[ERROR] /home/mcrenshaw/src/argo-client-gen/java/src/main/java/io/argoproj/workflow/models/Template.java:[897,37] cannot find symbol
symbol: class IoArgoprojV1alpha1WorkflowStep
location: class io.argoproj.workflow.models.Template
[ERROR] /home/mcrenshaw/src/argo-client-gen/java/src/main/java/io/argoproj/workflow/models/Template.java:[912,20] cannot find symbol
symbol: class IoArgoprojV1alpha1WorkflowStep
location: class io.argoproj.workflow.models.Template
[ERROR] /home/mcrenshaw/src/argo-client-gen/java/src/main/java/io/argoproj/workflow/models/Template.java:[917,34] cannot find symbol
symbol: class IoArgoprojV1alpha1WorkflowStep
location: class io.argoproj.workflow.models.Template
Must have been a recent change in swagger.json. I'm looking into it, but @alexec if anything jumps to mind let me know.
There is no support for Argo CD in official clients, so README should be updated to include the information, that the clients are for Argo Workflows.
Readme in clients could be also updated to state it clearly.
Name of the repository also suggest, that the client is generic for all Argo projects, not just workflows.
Unable to reach any of the below links.
https://github.com/argoproj/argo/blob/master/pkg/apiclient/apiclient.go
https://github.com/argoproj/argo/blob/master/cmd/argo/commands/submit.go
$ make java
git submodule update --init java
fatal: remote error: upload-pack: not our ref d9290f9a560f41cbcdf870ae4ccbcfcdeff916eb
Fetched in submodule path 'java', but it did not contain d9290f9a560f41cbcdf870ae4ccbcfcdeff916eb. Direct fetching of that commit failed.
I don't know what that hash refers to. I'm able to clone the argo-client-java repo, so I'm not sure why submodules would fail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.