Skip to content

Conversation

@Mercurial
Copy link
Contributor

@Mercurial Mercurial commented Oct 27, 2025

Summary

Adds automated code generation and package validation for pull requests to catch proto definition, generation, and packaging issues before merge.

Changes

  • Added new workflow .github/workflows/pr-check.yml that triggers on PRs targeting main
  • Reuses existing generate.yml and publish-all.yml workflows for consistency
  • Includes concurrency control to cancel outdated workflow runs when new commits are pushed
  • Runs full dry-run validation including package publishing checks

Validation Performed

Code Generation:

  • Validates proto file syntax
  • Generates code for all supported languages (Rust, Node, Go, Python, .NET, Haskell)
  • Uploads generated code as artifact

Package Validation (dry-run):

  • Rust: cargo publish --dry-run validates crate structure and dependencies
  • Node: TypeScript transpilation and npm publish --dry-run validates package
  • Go: Module structure validation
  • Python: Package structure validation
  • .NET: NuGet package validation
  • Haskell: Package validation

Benefits

  • Early feedback on proto definition errors
  • Prevents broken code generation from being merged
  • Catches package structure and dependency issues
  • Validates publishing readiness without actually publishing
  • No code duplication (reuses existing workflows)
  • Resource-efficient (cancels outdated runs)

Related Issues

Closes #172

🤖 Generated with Claude Code

Mercurial and others added 2 commits October 27, 2025 21:48
Add automated code generation check for pull requests to validate
proto file changes and ensure code generation succeeds before merge.

This addresses GitHub issue #172 by:
- Running buf code generation on every PR targeting main
- Validating generation for all supported languages (Rust, Node, Go, Python, .NET, Haskell)
- Reusing existing generate.yml workflow for consistency
- Including concurrency control to cancel outdated runs
- Uploading generated code as artifact for inspection

The workflow triggers on PR open, synchronize, and reopen events,
providing early feedback to contributors about generation issues.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Extend PR code generation check to include full publish dry-run
validation for all language packages, catching additional issues:

- Package structure validation (Cargo.toml, package.json, etc.)
- TypeScript transpilation for Node packages
- Dependency resolution for all languages
- Package metadata and version validation
- Publishing readiness checks

This now matches the dry-run.yml workflow pattern and provides
comprehensive validation as originally requested in issue #172.

Changes:
- Add publish-dry-run job that depends on codegen
- Run publish-all.yml in dry-run mode for all languages
- Validate Rust, Node, Go, Python, .NET, and Haskell packages
- Inherit secrets for package registry authentication

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

Co-Authored-By: Claude <noreply@anthropic.com>
@scarmuega scarmuega merged commit 63aa2b1 into main Oct 27, 2025
7 checks passed
@scarmuega scarmuega deleted the feature/pr-codegen-check branch October 27, 2025 15:06
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.

Run codegen on Pull Request

3 participants