Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 26, 2025

This PR implements structured JSON manifest generation for the validation pipeline, enabling Last Known Good (LKG) tracking for Azure OpenAI template samples.

Changes Made

Enhanced validate-single-sample.sh

  • Added optional JSON output mode while maintaining backward compatibility
  • Captures timing data (start/end timestamps and duration in seconds)
  • Includes complete validation configuration metadata in results
  • Implements proper error handling with structured error reporting
  • Redirects command output to stderr in JSON mode for clean JSON output

Enhanced validate-samples.sh

  • Aggregates individual sample results into a single validation manifest
  • Generates validation-manifest.json conforming to the provided schema
  • Supports custom package versions via PACKAGE_VERSION environment variable
  • Maintains backward compatibility by continuing to generate traditional log files
  • Only includes successfully validated samples in the manifest (per schema requirements)

Key Features

  • Structured Output: Generates JSON manifest with timing, metadata, and configuration details
  • Multi-Language Support: Works across Python, C#, Java, and other supported languages
  • Backward Compatibility: Existing CI pipeline continues to work unchanged with traditional log files
  • Schema Compliance: All generated manifests validate against ci/validation-manifest.schema.json
  • Error Resilience: Gracefully handles build and validation failures with detailed error reporting

Example Usage

# Traditional usage (unchanged)
./scripts/validate-samples.sh python changed_samples.txt

# With custom package version
PACKAGE_VERSION=1.2.3 ./scripts/validate-samples.sh python changed_samples.txt

Generated Manifest Example

{
  "lastUpdated": "2025-07-26T00:41:25Z",
  "samples": {
    "python/chat-completion": {
      "lastValidated": "2025-07-26T00:41:24Z",
      "version": "1.2.3",
      "status": "validated"
    },
    "csharp/embeddings": {
      "lastValidated": "2025-07-26T00:41:25Z",
      "version": "1.2.3", 
      "status": "validated"
    }
  }
}

The manifest serves as a "Last Known Good" report that will be used by the packaging pipeline to select the latest successful package versions for each sample, ensuring complete packages with no gaps when current samples fail validation.

Fixes #34.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Update Pipeline to Generate Validation Manifest Update Pipeline to Generate Validation Manifest Jul 26, 2025
@Copilot Copilot AI requested a review from brandom-msft July 26, 2025 00:45
Copilot finished work on behalf of brandom-msft July 26, 2025 00:45
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.

Update Pipeline to Generate Validation Manifest
2 participants