You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ossie.apache.org by "kayemkim (via GitHub)" <gi...@apache.org> on 2026/10/09 04:30:11 UTC

[PR] feat(validation): validate several files per run and look up the schema via OSSIE_SCHEMA [ossie]

kayemkim opened a new pull request, #545:
URL: https://github.com/apache/ossie/pull/545

   ## Summary
   
   validate.py took exactly one file. It now accepts any number of paths, reports each one, prints a summary when there is more than one and exits non-zero if any file failed, so `validate.py models/*.yaml` works in a CI step without a shell loop. Output for a single file is unchanged, which keeps the converter tests that read it (NVIDIA, Cube) as they are.
   
   The default schema path assumed this repository's layout. `--schema` still wins; otherwise `OSSIE_SCHEMA` is consulted before the repository default, and the not-found message now says how to point at a schema. I left out the `./schema/` fallback the issue floated, since the environment variable covers the vendored case without inventing a directory convention.
   
   The check sequence itself moved out of `main()` into `validate_document(data, schema)`, so a caller with a parsed document can run every check, including the ontology checks from #489, without going through the CLI.
   
   This sits on top of #534 and #542. The schema is still read and checked once, before the loop, now in `load_schema_or_report`. The model side now goes through `read_text_or_report`, which prints the same messages #534 added but returns None instead of exiting, so an unreadable file among several fails only itself and the run continues. There is a test for that case alongside the other eleven in validation/tests. #271 changes the reporting lines that moved into `validate_file` unchanged, so whichever lands second is a small rebase.
   
   ## Verification
   
   - `validation/tests/`: 176 passed, `validation/test_validate.py`: 53 OK, and the full validation workflow (3.11 to 3.14) run locally on this branch merged into current main.
   - Single-file output for `examples/tpcds_semantic_model.yaml` is byte-identical to main; the NVIDIA and Cube converter suites, which call or import validate.py, pass unchanged.
   - A run over a valid file, a binary file, a missing path and a directory reports each one and ends with `1 of 4 file(s) passed`, exit 1.
   
   ## Related Issues
   
   Follow-up to #266, items 2 and 3 (item 1 was #390).
   
   ## Checklist
   
   ### Validation
   - [x] New validation cases are covered by tests
   
   ### Tests
   - [x] All existing tests pass (`pytest` / CI green)
   - [x] New functionality is covered by tests
   
   ### Compliance
   - [x] ASF license headers are present on all new source files (no new files)
   - [x] No third-party dependencies are added without PMC/IPMC approval
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(validation): validate several files per run and look up the schema via OSSIE_SCHEMA [ossie]

Posted by "kayemkim (via GitHub)" <gi...@apache.org>.
kayemkim commented on PR #545:
URL: https://github.com/apache/ossie/pull/545#issuecomment-6091551703

   Thanks for the review. I took the first and third in this PR, pushed as a second commit so the diff on top of what you approved stays small.
   
   A check that raises now prints `Error: <ExceptionType> while validating <path>: <message>` on stdout, keeps the traceback on stderr and counts the file as failed, so the remaining files still run and the summary prints. A check raising on a document is a validator bug rather than a model problem, so I did not want to lose the traceback entirely; stderr keeps it out of the per-file report. There is a test that makes `validate_document` raise on one of two files.
   
   `--` now takes the rest of the arguments as file names, with a test for `-model.json`, and the usage line mentions it.
   
   On the PASSED line: in a multi-file run every file's block starts with `== <path>` as given on the command line, so `a/model.yaml` and `b/model.yaml` are told apart by the header above their PASSED or error lines. I left the single-file output alone because the NVIDIA tests and validation/test_validate.py read it, and a vendored copy may have a grep on the same text. If you would rather have the full path on the PASSED line in the multi-file case anyway, it is a one-line change and I am happy to add it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(validation): validate several files per run and look up the schema via OSSIE_SCHEMA [ossie]

Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #545:
URL: https://github.com/apache/ossie/pull/545


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(validation): validate several files per run and look up the schema via OSSIE_SCHEMA [ossie]

Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on PR #545:
URL: https://github.com/apache/ossie/pull/545#issuecomment-6076706968

   @kayemkim do you want to tackle first comment in this PR or as follow-up?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org