Skip to content

Devenv Codegen - #2221

Merged
skudasov merged 17 commits into
mainfrom
chaos-generator-ci
Nov 20, 2025
Merged

skudasov merged 17 commits into
mainfrom
chaos-generator-ci

Conversation

@skudasov

@skudasov skudasov commented Nov 3, 2025 •

Copy link
Copy Markdown
Contributor
  • Add Go runtime version detection for chaos codegen
  • Add full N nodes devenv codegen for a single-network EVM product
  • E2E tests with CL node healthchecks
  • Smoke/Load/Chaos templates + generated CI workflows

This template enforces a simple workflow that developers can adapt when building system-level tests using CTF, see CLI docs:

   🔗 Chainlink's Developer Environment Generator 🔗

   Prerequisites:
     We are using Just, please install it first -  https://github.com/casey/just

   Usage:

     ⚙️ Generate basic environment:
       ctf gen env --cli myenv --product-name Knilniahc --nodes 4

     🔧 Address all TODO comments and customize it if needed

     💻 Enter the shell and spin up the environment:
       cd devenv && just cli && myenv sh

     🔍 Implement system-level smoke tests (tests/smoke_test.go) and run them:
       myenv test smoke

     📈 Implement load/chaos tests (tests/load_test.go) and run them:
       myenv test load

     🔄 Enforce quality standards in CI: copy .github/workflows to your CI templates

Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The code changes introduce a new framework for generating developer environments, CI configurations, and end-to-end tests for blockchain-based applications. These changes aim to streamline the setup and testing process for developers, making it easier to build, test, and deploy blockchain applications.

What

  • Added .github/workflows/framework-codegen.yml for Framework Code Generation CI configuration.
  • Added book/src/SUMMARY.md updates to include Generating Developer Environment documentation.
  • Added book/src/framework/generate.md with documentation on generating Chainlink environments and infrastructure testing templates.
  • Added .gitignore in framework/ to ignore generated development environments and automated test environments.
  • Added CLI command implementation in framework/cmd/main.go for generating developer environments and setting up Go environments.
  • Updated Go module dependencies in framework/components/dockercompose/go.sum.
  • Added new test file framework/components/fake/go.sum for testing purposes.
  • Implemented environment generation in framework/tmpl_gen.go and added a test in framework/tmpl_gen_test.go for validating the developer environment generation process.
  • Added template for generating Wasp load test configurations in wasp/tmpl_generator.go.

@skudasov
skudasov requested a review from Tofel November 3, 2025 18:19
Tofel
Tofel previously approved these changes Nov 4, 2025
@skudasov skudasov changed the title Generate CI Devenv Codegen Nov 17, 2025
@skudasov
skudasov requested a review from Tofel November 17, 2025 09:58
@skudasov
skudasov marked this pull request as ready for review November 20, 2025 13:08
@skudasov
skudasov requested a review from a team as a code owner November 20, 2025 13:08
@skudasov
skudasov requested a review from kdihalas November 20, 2025 13:23
@sebawo
sebawo requested a review from Copilot November 20, 2025 14:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a comprehensive developer environment generator for Chainlink testing, enabling automated creation of complete test environments with infrastructure and CI configurations. The changes streamline the setup process for system-level testing using the Chainlink Testing Framework (CTF).

Key Changes:

  • Added CLI command for generating complete Chainlink developer environments with configurable node counts and network types
  • Implemented Go runtime version detection for code generation to ensure compatibility
  • Enhanced chaos test naming to include pod label information for better test identification

Reviewed Changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/framework-codegen.yml New CI workflow for testing the code generation framework
book/src/SUMMARY.md Reorganized documentation structure to emphasize the new generator-first workflow
book/src/framework/generate.md Updated documentation covering both environment and infrastructure test generation
framework/.gitignore Added patterns to exclude generated development environments from version control
framework/cmd/main.go Implemented the gen env CLI command with interactive shell support
framework/config.go Refactored string replacement to use ReplaceAll and updated file permissions to octal notation
framework/tmpl_gen_test.go Added end-to-end test validating environment generation and health checks
wasp/tmpl_generator.go Enhanced with dynamic Go version detection and improved chaos test case naming

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread framework/config.go
Comment thread framework/tmpl_gen_test.go Outdated
kdihalas
kdihalas previously approved these changes Nov 20, 2025
@skudasov
skudasov enabled auto-merge (squash) November 20, 2025 17:02
@skudasov
skudasov disabled auto-merge November 20, 2025 17:21
- Add ensureJustInstalled() function to check and install 'just' automatically
- On macOS, automatically installs via Homebrew if available
- Provides helpful error messages with installation instructions for other platforms
- Update documentation to reflect automatic installation capability
- Fixes issue where environment generation failed when 'just' was not in PATH
@skudasov
skudasov merged commit b402fce into main Nov 20, 2025
72 checks passed
@skudasov
skudasov deleted the chaos-generator-ci branch November 20, 2025 17:51
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.

7 participants