Skip to content

feat(crs): validate target compatibility against CRS supported_target (fixes #457) - #485

Open
vatsaljain568 wants to merge 1 commit into
ossf:mainfrom
vatsaljain568:target-compatibility-validation
Open

vatsaljain568 wants to merge 1 commit into
ossf:mainfrom
vatsaljain568:target-compatibility-validation

Conversation

@vatsaljain568

Copy link
Copy Markdown

Summary

This PR implements target compatibility validation in CRS.__is_supported_target as outlined in #457 and tracked under the "Near-Term" roadmap in PLAN.md.

Previously, __is_supported_target was a stub unconditionally returning True. When running campaigns with multiple CRSs, an incompatible CRS (such as a JVM-only CRS paired with a C project) proceeded to the target build phase and failed with build errors.

This change:

  1. Validates the target's attributes (language, sanitizer, architecture, engine) against CRS.config.supported_target.
  2. Returns False on any mismatch, which triggers the existing graceful skip path in build_target and is_target_built (TaskResult(success=True) with a clear skip message).
  3. Exposes a public is_supported_target method on CRS.
  4. Adds 9 comprehensive unit tests in oss_crs/tests/unit/test_crs_supported_target.py.

Fixes #457

User Impact

  • User-facing change
  • Internal-only change

When running ensemble campaigns with targets that a specific CRS does not support, OSS-CRS now logs a skip message during target-build and allows other compatible CRSs to continue running, rather than aborting the build phase with compiler errors. No config changes or migrations required.

Release Note / Changelog

  • I updated CHANGELOG.md ([Unreleased]) for user-facing changes
  • No changelog entry needed (internal-only refactor/test/chore)

Validation

All checks passed locally via uv run verify:

  • ruff check oss_crs oss-crs-infra libCRS: PASS
  • ruff format --check oss_crs oss-crs-infra libCRS: PASS (127 files formatted)
  • pyright oss_crs/src libCRS/libCRS oss-crs-infra: PASS (0 errors, 0 warnings)
  • pytest -m "not integration" -v oss_crs: PASS (816 passed, 29 deselected)
  • pytest -m "not integration" -o pythonpath=libCRS -v libCRS/tests: PASS (24 passed)

Checklist

  • I followed Conventional Commits
  • I updated docs for behavior/config/CLI changes
  • I added/updated tests for behavior changes
  • I considered backward compatibility and migration impact

…fixes ossf#457)

Signed-off-by: Vatsal Jain <jain.vatsal2006@gmail.com>
@vatsaljain568
vatsaljain568 force-pushed the target-compatibility-validation branch from 1ea1b68 to 4674fd2 Compare November 16, 2026 10:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: validate target compatibility against CRS supported_target in crs.py

1 participant