Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/validate-structure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ jobs:

Please check the CI logs above for specific error details and fix the issues before merging.

📖 See the [validation documentation](docs/folder-format.md) for more details.`
📖 See the [validation documentation](docs/folder-format.md) for more details.

To disable the validation check please add a validation.yml file to your upgrade folder with 'disabled': true`
})
12 changes: 12 additions & 0 deletions validation-tool-interface/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions validation-tool-interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"next": "^14.2.30",
"react": "^18.2.0",
"yaml": "^2.8.1",
"zod": "^3.22.4"
},
"devDependencies": {
Expand Down
25 changes: 25 additions & 0 deletions validation-tool-interface/scripts/validate-structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { ConfigParser } from '../utils/parser';
import { parse as yamlParse } from "yaml";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -26,6 +27,10 @@ interface InvalidFile {
errors: Array<{ message: string }>;
}

interface ValidationConfig {
disabled: bool;
}

export class StructureValidator {
private errors: ValidationError[] = [];
private warnings: ValidationWarning[] = [];
Expand Down Expand Up @@ -101,6 +106,26 @@ export class StructureValidator {
return;
}

// Check if there is a validation configuration file
const validationsConfigFileYml = path.join(absolutePath, 'validation.yml');
const validationsConfigFileYaml = path.join(absolutePath, 'validation.yaml');
let configContent: string | undefined;
if (fs.existsSync(validationsConfigFileYml)) {
configContent = fs.readFileSync(validationsConfigFileYml, 'utf-8');
}

if (fs.existsSync(validationsConfigFileYaml)) {
configContent = fs.readFileSync(validationsConfigFileYaml, 'utf-8');
}

if (configContent !== undefined) {
const config = yamlParse(configContent) as ValidationConfig;
if (config.disabled) {
console.log('Validation check is disabled.');
return;
}
}

// Check if validations subdirectory exists
const validationsPath = path.join(absolutePath, 'validations');
if (!fs.existsSync(validationsPath)) {
Expand Down