Commit cbee3c33 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

add schema validation for .meepctl-repocfg.yaml & UX improvements

parent 4af7b1cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
# yaml-language-server: $schema=./meepctl-repocfg-schema.json
# Copyright (c) 2026  The AdvantEDGE Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
+215 −0
Original line number Diff line number Diff line
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "meepctl-repocfg",
  "type": "object",
  "properties": {
    "version": { "type": "string" },
    "repo": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "deployment": {
          "type": "object",
          "properties": {
            "permissions": {
              "type": "object",
              "properties": {
                "uid": { "type": "integer" },
                "gid": { "type": "integer" }
              }
            },
            "user": {
              "type": "object",
              "properties": {
                "frontend": { "type": "boolean" },
                "swagger": { "type": "boolean" }
              }
            },
            "ingress": {
              "type": "object",
              "properties": {
                "host": { "type": "string" },
                "https-only": { "type": "boolean" },
                "host-ports": { "type": "boolean" },
                "http-port": { "type": "integer" },
                "https-port": { "type": "integer" },
                "ca": { "type": "string" },
                "le-server-prod": { "type": "boolean" }
              }
            },
            "auth": {
              "type": "object",
              "properties": {
                "enabled": { "type": "boolean" },
                "provider-mode": { "type": "string" },
                "session": {
                  "type": "object",
                  "properties": {
                    "key-secret": { "type": "string" },
                    "max-sessions": { "type": "integer" }
                  }
                },
                "github": {
                  "type": "object",
                  "properties": {
                    "enabled": { "type": "boolean" },
                    "device-auth-url": { "type": "string" },
                    "device-poll-url": { "type": "string" },
                    "poll-url": { "type": "string" },
                    "auth-url": { "type": "string" },
                    "token-url": { "type": "string" },
                    "redirect-uri": { "type": "string" },
                    "secret": { "type": "string" }
                  }
                },
                "gitlab": {
                  "type": "object",
                  "properties": {
                    "enabled": { "type": "boolean" },
                    "auth-url": { "type": "string" },
                    "token-url": { "type": "string" },
                    "redirect-uri": { "type": "string" },
                    "api-url": { "type": "string" },
                    "secret": { "type": "string" }
                  }
                }
              }
            },
            "metrics": { "type": "object" }
          }
        },
        "resource-prerequisites": { "type": "object" },
        "core": { "$ref": "#/definitions/meepComponentGroups" },
        "sandbox": { "$ref": "#/definitions/meepComponentGroups" },
        "dep": {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9-]+$": { "$ref": "#/definitions/meepDep" }
          }
        },
        "packages": { "$ref": "#/definitions/meepPackageGroups" }
      },
      "required": ["name", "deployment"]
    }
  },
  "definitions": {
    "meepPackageGroups": {
      "type": "object",
      "properties": {
        "go-packages": {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9-]+$": { "$ref": "#/definitions/meepPackage" }
          }
        },
        "js-packages": {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9-]+$": { "$ref": "#/definitions/meepPackage" }
          }
        }
      }
    },
    "meepComponentGroups": {
      "type": "object",
      "properties": {
        "go-apps": {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9-]+$": { "$ref": "#/definitions/meepGoApp" }
          }
        },
        "js-apps": {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9-]+$": { "$ref": "#/definitions/meepJsApp" }
          }
        }
      }
    },
    "meepGoApp": {
      "type": "object",
      "properties": {
        "src": { "type": "string" },
        "bin": { "type": "string" },
        "build": { "type": "boolean" },
        "build-flags": { "type": "array", "items": { "type": "string" } },
        "dockerize": { "type": "boolean" },
        "deploy": { "type": "boolean" },
        "chart": { "type": "string" },
        "chart-user-values": { "type": "string" },
        "codecov": { "type": "boolean" },
        "lint": { "type": "boolean" },
        "api": {
          "type": ["array", "null"],
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "file": { "type": "string" }
            }
          }
        },
        "user-api": {
          "type": ["array", "null"],
          "items": {
            "type": "object",
            "properties": {
              "name": { "type": "string" },
              "file": { "type": "string" }
            }
          }
        },
        "docker-data": {
          "type": "object",
          "patternProperties": { ".*": { "type": "string" } }
        },
        "core-pods": { "type": "array", "items": { "type": "string" } },
        "dependency-pods": { "type": "array", "items": { "type": "string" } },
        "sandbox-pods": { "type": "array", "items": { "type": "string" } },
        "onboardedapp": { "type": "boolean" }
      },
      "additionalProperties": false
    },
    "meepJsApp": {
      "type": "object",
      "properties": {
        "src": { "type": "string" },
        "bin": { "type": "string" },
        "build": { "type": "boolean" },
        "dockerize": { "type": "boolean" },
        "deploy": { "type": "boolean" },
        "lint": { "type": "boolean" },
        "local-deps": {
          "type": "object",
          "patternProperties": { ".*": { "type": "string" } }
        },
        "env": {
          "type": "object",
          "patternProperties": { ".*": { "type": "string" } }
        }
      },
      "additionalProperties": false
    },
    "meepDep": {
      "type": "object",
      "properties": {
        "build": { "type": "boolean" },
        "dockerize": { "type": "boolean" },
        "deploy": { "type": "boolean" },
        "chart": { "type": "string" },
        "chart-user-values": { "type": "string" }
      },
      "additionalProperties": false
    },
    "meepPackage": {
      "type": "object",
      "properties": {
        "lint": { "type": "boolean" },
        "src": { "type": "string" },
        "test": { "type": "boolean" }
      },
      "additionalProperties": false
    }
  }
}
+9 −0
Original line number Diff line number Diff line
@@ -43,6 +43,14 @@ class CreateNewAppDialog extends Component {
    });
  }

  handleKeyPress(e) {
    if (e.key === 'Enter') {
      if (!(this.state.appName === '' || this.state.appErr || this.state.mepName === '')) {
        this.submitApp();
      }
    }
  }

  submitApp() {
    this.props.onSubmit(this.state);
  }
@@ -90,6 +98,7 @@ class CreateNewAppDialog extends Component {
              invalid={this.state.appErr ? true : false}
              value={this.state.appName}
              onChange={e => this.changeAppName(e.target.value)}
              onKeyPress={e => this.handleKeyPress(e)}
            />
            <TextFieldHelperText validationMsg={true}>
              <span>{this.state.appErr}</span>
+7 −2
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
import React, { Component } from 'react';
import BasicDialog from './basic-dialog';

import CircularProgress from '@material-ui/core/CircularProgress';

class SignInWaitDialog extends Component {
  constructor(props) {
    super(props);
@@ -21,8 +23,11 @@ class SignInWaitDialog extends Component {
        onSubmit={this.props.onClose}
        closeLabel={'Cancel'}
      >
        <p>This may take a few seconds...</p>
        <p>You will automatically be redirected to the sandbox page when ready.</p>
        <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', margin: '20px 0' }}>
          <CircularProgress style={{ marginBottom: 20 }} />
          <p style={{ margin: '5px 0' }}>This may take a few seconds...</p>
          <p style={{ margin: '5px 0', color: 'gray' }}>You will automatically be redirected to the sandbox page when ready.</p>
        </div>
      </BasicDialog>
    );
  }
+3 −1
Original line number Diff line number Diff line
@@ -178,7 +178,9 @@ class AppInstanceTable extends Component {
            {(!data || data.length === 0) && (
              <TableBody className={classes.tableBody}>
                <TableRow style={{ height: 49 * maxRows }}>
                  <TableCell colSpan={6} />
                  <TableCell colSpan={6} style={{ textAlign: 'center', color: '#757575', borderBottom: 'none' }}>
                    <Typography variant="body1">No Applications Running</Typography>
                  </TableCell>
                </TableRow>
              </TableBody>
            )}