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

docs: Add JSON schema for IDE validation #4581

Merged
merged 21 commits into from
Nov 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f18d2b8
fix(controller): Correct default port logic (#4547)
alexec Nov 17, 2020
5a76dc0
docs: Update cost optimisation to include information about cleaning…
snowzach Nov 17, 2020
a2335ea
docs: Added CloudSeeds as one of the users for argo (#4553)
L3Nerd Nov 18, 2020
325d5f8
fix: Respect continueOn for leaf tasks (#4455)
simster7 Nov 18, 2020
93da1a0
fix: executor/pns containerid prefix fix (#4555)
L3Nerd Nov 19, 2020
337047b
chore: Remove unused image build and push hooks (#4539)
terrytangyuan Nov 19, 2020
8dc491b
docs: Clean-up examples. Fixes #4124 (#4128)
secretlifeof Nov 19, 2020
b48996a
feat(ui): Add Template/Cron workflow filter to workflow page. Closes …
tczhao Nov 19, 2020
1ecb59b
chore: Updated stress test YAML (#4569)
alexec Nov 20, 2020
3a4b20c
docs: Updated kubectl apply command in manifests README (#4577)
sgloutnikov Nov 20, 2020
bf38cb2
feat(controller): Make MAX_OPERATION_TIME configurable. Close #4239 (…
alexec Nov 21, 2020
44df788
Append VSCode instructions - needs a stable schema URL
brabster Nov 21, 2020
18dab75
Add IDEA instructions, move CRD-based instructions to the bottom and …
brabster Nov 21, 2020
81779db
feat: Add JSON schema. Closes #4477
alexec Nov 16, 2020
3108998
js: M api/jsonschema/schema.json
alexec Nov 16, 2020
835ffa5
js: M hack/swagger/secondaryswaggergen.go
alexec Nov 16, 2020
667c33c
js: M api/jsonschema/schema.json
alexec Nov 17, 2020
37ba277
js: M hack/swagger/kubeifyswagger.go
alexec Nov 17, 2020
41f4918
Remove unneeded CRD-based IDE setup
brabster Nov 23, 2020
beeef6b
Update link to JSON schema
brabster Nov 23, 2020
3394a13
Merge branch 'master' into ide-support-vscode
alexec Nov 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add IDEA instructions, move CRD-based instructions to the bottom and …
…warn

Signed-off-by: Paul Brabban <paul.brabban@gmail.com>
brabster committed Nov 24, 2020
commit 18dab75b2d8f93082566b846311c33f9b1f5dffe
Binary file added docs/assets/intellij-ide-step-1-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 37 additions & 18 deletions docs/ide-setup.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# IDE Set-Up

## How To Use CRD Validation With Your Editor
## Validating Argo YAML againt the JSON Schema

Use either VS Code or Kubernetes and load the full Custom Resource Definitions (CRDs) into an IDE that support CRD validation (e.g IntelliJ, VS Code).
Argo provides a [JSON Schema](https://tbc/schema.json) that enables validation of YAML resources in your IDE.

CRD URLs:

* [ClusterWorkflowTemplate](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_clusterworkflowtemplates.yaml)
* [WorkflowTemplate](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_workflowtemplates.yaml)
* [CronWorkflow](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_cronworkflows.yaml)
* [Workflow](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_workflows.yaml)

### IntelliJ
### IntelliJ IDEA (Community & Utimate Editions)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDEA instructions for JSON Schema @alexec


Install the Kubernetes plugin:

![Step 1](assets/ide-step-1.png)
YAML validation is supported natively in IDEA.

Add the CRD URLs to the Kubernetes configuration panel (choose “IDE” for the scope):
Configure your IDE to reference the Argo schema and map it to your Argo YAML files:

![Step 2](assets/ide-step-2.png)
![IDEA Configure Schema](assets/intellij-ide-step-1-config.png)
- The schema is located at [https://tbc/schema.json](https://tbc/schema.json).
- Specify a file glob pattern that locates **your** Argo files. The example glob here is for the Argo Github project!
- Note that you may need to restart IDEA to pick up the changes.

Finally, open your CRDs and verify no errors appear, example:
That's it. Open an Argo YAML file and you should see smarter behaviour, including type errors and context-sensitive autocomplete.

![Step 3](assets/ide-step-3.png)
![IDEA Example Functionality](assets/intellij-ide-step-1-example-functionality.png)

### VSCode

@@ -47,4 +41,29 @@ Add the Argo schema setting `yaml.schemas`:

That's it. Open an Argo YAML file and you should see smarter behaviour, including type errors and context-sensitive autocomplete.

![VScode Example Functionality](assets/vscode-ide-step-4-example-functionality.png)
![VScode Example Functionality](assets/vscode-ide-step-4-example-functionality.png)

## Validating Argo YAML using CRD Validation in IntelliJ Ultimate Edition

brabster marked this conversation as resolved.
Show resolved Hide resolved
:warning: This method is no longer recommended due to challenges with CRD validation, relatively complex setup and limited support across IDEs.

Load the full Custom Resource Definitions (CRDs) into IntelliJ Ultimate Edition, an IDE that support CRD validation via the Kubernetes plugin.

CRD URLs:

* [ClusterWorkflowTemplate](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_clusterworkflowtemplates.yaml)
* [WorkflowTemplate](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_workflowtemplates.yaml)
* [CronWorkflow](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_cronworkflows.yaml)
* [Workflow](https://raw.githubusercontent.com/argoproj/argo/master/manifests/base/crds/full/argoproj.io_workflows.yaml)

Install the Kubernetes plugin:

![Step 1](assets/ide-step-1.png)

Add the CRD URLs to the Kubernetes configuration panel (choose “IDE” for the scope):

![Step 2](assets/ide-step-2.png)

Finally, open your CRDs and verify no errors appear, example:

![Step 3](assets/ide-step-3.png)