-
Notifications
You must be signed in to change notification settings - Fork 38
Refactor campaign code to pkg/campaign with schema validation and comprehensive tests #6136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Created pkg/campaign package with modular structure: - spec.go: Campaign spec type definitions - loader.go: Loading specs from files using parser.ExtractFrontmatterFromContent - validation.go: JSON schema-based validation - status.go: Campaign status computation - command.go: Cobra command integration - Replaced manual frontmatter parsing with parser package helper (addresses comment 2610682143) - Created campaign_spec_schema.json for JSON schema validation (addresses comment 2610689719) - Added extensive tests: - campaign_test.go: Integration tests - loader_test.go: 10 tests for loading specs - validation_test.go: 16 tests for validation logic - filter_test.go: 7 tests for filtering - create_test.go: 11 tests for spec creation - Updated main.go to use new campaign package - Removed old pkg/cli/campaigns.go - All tests passing (45 tests total) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Address feedback on campaign management commands
Refactor campaign code to pkg/campaign with schema validation and comprehensive tests
Dec 11, 2025
Contributor
|
@pelikhan: LGTM! 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses feedback on #6082 to improve campaign management code structure, reuse existing frontmatter parsing, and add JSON schema validation.
Changes
Package structure
pkg/cli/campaigns.gotopkg/campaignpackagespec.go: Type definitionsloader.go: Loading and filtering withparser.ExtractFrontmatterFromContentvalidation.go: JSON schema validationstatus.go: Runtime status and metricscommand.go: CLI integrationValidation improvements
campaign_spec_schema.jsonfor structured validationgojsonschema(matches workflow validation pattern)Before (manual frontmatter parsing):
After (reuse parser package):
Test coverage
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.