Skip to content

Conversation

@pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Jun 19, 2025

I'm generating schemas and including them in the repository such that developers can use it with the graph representation exported through tuist graph --json or with LLMs.

Copilot

Summary

  • Add comprehensive JSON schema generation for all XcodeGraph models
  • Create executable target XcodeGraphSchemaGenerator to generate schemas
  • Integrate schema generation into CI/CD workflows for automated validation and release

Changes

🚀 New Features

  • Schema Generator: New executable target that generates JSON schemas for 32 core XcodeGraph models
  • Comprehensive Coverage: Schemas for Project, Target, Workspace, Graph, and all supporting models
  • Proper Type Definitions: Each schema includes accurate property definitions with correct types (string, integer, boolean, array, object)

📁 Generated Schemas

All schemas are saved to the schemas/ directory following the pattern ModelName.json:

  • Core models: Graph.json, Project.json, Target.json, Workspace.json
  • Actions: BuildAction.json, TestAction.json, RunAction.json, ArchiveAction.json
  • Configuration: Settings.json, BuildConfiguration.json, DeploymentTargets.json
  • And 20+ more models

🔧 CI/CD Integration

  • Release Workflow: Automatically generates and commits schemas during releases
  • CI Testing: Added schema generation test to verify functionality on every PR/push
  • Platform: Runs on macOS-15 for full compatibility

🏗️ Technical Details

  • Follows JSON Schema Draft 2020-12 specification
  • Schema URIs: https://github.com/tuist/XcodeGraph/schemas/ModelName.json
  • Sample-based approach: Creates representative data to infer schema structure
  • No external dependencies - uses native Swift reflection capabilities

Test Plan

  • Schema generator builds successfully
  • All 32 schemas generate without errors
  • CI workflow tests schema generation
  • Release workflow integrates schema generation
  • Review generated schemas for accuracy

Usage

# Generate schemas manually
swift run XcodeGraphSchemaGenerator

# Schemas are also generated automatically during releases

🤖 Generated with Claude Code

pepicrft and others added 2 commits June 19, 2025 19:02
- Add XcodeGraphSchemaGenerator executable target
- Generate comprehensive JSON schemas for 32 core models
- Include proper type definitions and property structures
- Add schema generation to CI/CD workflows
- Schemas saved to schemas/ folder following ModelName.json pattern
- Compatible with JSON Schema Draft 2020-12 specification
- Automated generation during releases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Test schema generation on every PR/push
- Verify all schemas are generated correctly
- Run on macOS to ensure compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Jun 19, 2025
},
"postActions" : {
"items" : {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm looking into the missing reference here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive JSON schema generation for all XcodeGraph models, including a new executable target to generate schemas and CI/CD integration for automated validation and release.

  • Introduces JSON schema files for 32 XcodeGraph models under the schemas/ directory
  • Adds the executable target "XcodeGraphSchemaGenerator" in Package.swift
  • Updates release and CI workflows to generate and validate schemas on macos-15

Reviewed Changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated no comments.

File Description
schemas/*.json Generated JSON schemas for various XcodeGraph models
Package.swift Added executable target for schema generation
.github/workflows/release.yml Updated to run schema generation during release workflow
.github/workflows/XcodeGraph.yml Added job to test schema generation in CI/CD workflows

- Implement reference detection for nested model types
- Use GitHub raw URLs for cross-schema references
- Ensure proper JSON Schema validation with interconnected models
- Support references for arrays and object properties

Examples:
- Target.dependencies -> TargetDependency.json
- Project.targets -> Target.json
- Workspace.schemes -> Scheme.json

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pepicrft pepicrft requested a review from cschmatzler June 19, 2025 17:09
@pepicrft
Copy link
Contributor Author

There are some references that are not right. I'm looking into them.

@pepicrft pepicrft closed this Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants