Repository: kubernetes-sigs/kro

Issue:
add simpleschema short spec types (int and bool)
Provide short version for spec types:
`integer` -> `int`
`boolean` -> `bool`

Discussion:
@newtondev: Hi @a-hilaly , I have added the change and a test. Also confirm that it is working using the manifest as follows:

```yaml
apiVersion: kro.run/v1alpha1
kind: ResourceGroup
metadata:
  name: my-application
spec:
  schema:
    apiVersion: v1alpha1
    kind: Application
    spec:
      # Spec fields that users can provide.
      name: string
      image: string | default="nginx"
      service:
        port: int | default=80
      ingress:
        enabled: bool | default=false
    status:
      # Fields the controller will inject into instances status.
      deploymentConditions: ${deployment.status.conditions}
      availableReplicas: ${deployment.status.availableReplicas}
---
<remaining resources omitted>

- id: service
      template:
        apiVersion: v1
        kind: Service
        metadata:
          name: ${schema.spec.name}-service
        spec:
          selector: ${deployment.spec.selector.matchLabels} # Use the deployment selector
          ports:
            - protocol: TCP
              port: ${schema.spec.service.port}
              targetPort: 80

    - id: ingress
      includeWhen:
        - ${schema.spec.ingress.enabled} # Only include if the user wants to create an Ingress

<remaining resources omitted>      
```

```yaml
apiVersion: kro.run/v1alpha1
kind: Application
metadata:
  name: my-application-instance
spec:
  name: my-awesome-app
  ingress:
    enabled: false
  service: {}
```@matthchr: This was closed by #179

Solution patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c4b6a1c..e7651b0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -39,6 +39,32 @@ To send us a pull request, please:
 GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
 [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
 
+## Setting Up a Local Development Environment
+To test and run the project with your local changes, follow these steps to set up a development environment:
+
+1. Install Dependencies: Ensure you have the necessary dependencies installed, including:
+    - [Go](https://golang.org/doc/install) (version specified in `go.mod`).
+    - [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) for interacting with Kubernetes clusters.
+    - A local Kubernetes cluster such as [kind](https://kind.sigs.k8s.io/).
+
+2. Create a Local Kubernetes Cluster: If you don't already have a cluster, create one with your preferred tool. For example, with `kind`:
+    ```bash
+    kind create cluster
+    ```
+
+3. Install the Custom Resource Definitions (CRDs): Apply the latest CRDs to your cluster:
+    ```bash
+    make generate
+    kubectl apply -k ./config/crd
+    ```
+
+4. Run the kro Controller Locally: Execute the controller with your changes:
+    ```bash
+    go run ./cmd/controller --log-level 2
+    ```
+    This will connect to the default Kubernetes context in your local kubeconfig (`~/.kube/config`). Ensure the context is pointing to your local cluster.
+
+By following these steps, you can setup a local environment to test your contributions before submitting a pull request.
 
 ## Finding contributions to work on
 Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
diff --git a/pkg/graph/parser/parser.go b/pkg/graph/parser/parser.go
index 34ec81f..ba8caea 100644
--- a/pkg/graph/parser/parser.go
+++ b/pkg/graph/parser/parser.go
@@ -191,11 +191,11 @@ func parseScalarTypes(field interface{}, _ *spec.Schema, path, expectedType stri
 		if _, ok := field.(float64); !ok {
 			return nil, fmt.Errorf("expected number type for path %s, got %T", path, field)
 		}
-	case "integer":
+	case "integer", "int":
 		if !isInteger(field) {
 			return nil, fmt.Errorf("expected integer type for path %s, got %T", path, field)
 		}
-	case "boolean":
+	case "boolean", "bool":
 		if _, ok := field.(bool); !ok {
 			return nil, fmt.Errorf("expected boolean type for path %s, got %T", path, field)
 		}



Test patch:
diff --git a/pkg/graph/parser/parser_test.go b/pkg/graph/parser/parser_test.go
index 57dca04..35ee6c0 100644
--- a/pkg/graph/parser/parser_test.go
+++ b/pkg/graph/parser/parser_test.go
@@ -711,3 +711,23 @@ func TestJoinPathAndFieldName(t *testing.T) {
 		})
 	}
 }
+
+func TestPartScalerTypesShortSpecTypes(t *testing.T) {
+	tests := []struct {
+		name          string
+		shortSpecType string
+		field         interface{}
+	}{
+		{"int short type for integer", "int", 42},
+		{"bool short type for boolean", "bool", true},
+	}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			_, err := parseScalarTypes(tt.field, nil, "spec.someitem", tt.shortSpecType)
+			if err != nil {
+				t.Errorf("Expected %T resolved for %s, but got error: %s", tt.field, tt.shortSpecType, err.Error())
+			}
+		})
+	}
+}