Skip to content

Add init, status, run, verify commands#1

Merged
kyosu-1 merged 6 commits intomainfrom
feature/new-commands
Feb 11, 2026
Merged

Add init, status, run, verify commands#1
kyosu-1 merged 6 commits intomainfrom
feature/new-commands

Conversation

@kyosu-1
Copy link
Copy Markdown
Owner

@kyosu-1 kyosu-1 commented Feb 11, 2026

Summary

  • init: Generate batcha.yml and job-definition.json from an existing AWS Batch job definition
  • status: Show the latest active revision info (name, ARN, revision, image, resources)
  • run: Submit a job via SubmitJob with --job-queue, --parameter, --wait support
  • verify: Local validation without AWS calls — template rendering, required fields, Fargate vCPU/memory constraints

Also includes:

  • File restructure: split monolithic batcha.go into per-command files (ecspresso pattern)
  • normalizeRemoteDefinition for cleaner diff/register comparison (strips AWS-managed fields)
  • skipConvertKeys case-insensitive matching for toCamelCase direction
  • Register now skips if remote definition already matches local
  • README updated with all new commands

Test plan

  • go test -race ./... passes (35 tests including Fargate resource validation)
  • golangci-lint run ./... — 0 issues
  • batcha verify --config batcha.yml works locally
  • batcha status --config batcha.yml shows active definition info
  • batcha run --config batcha.yml --job-queue <queue> submits a job
  • batcha init --job-definition-name <name> generates config files

🤖 Generated with Claude Code

kyosu-1 and others added 6 commits February 12, 2026 06:38
- Add init command to generate config and job definition from existing AWS Batch definition
- Extract code into separate files: config, diff, init, json, register, render
- Strip AWS-managed fields from remote side in diff to avoid false positives
- Skip registration when no changes detected (like ecspresso)
- Add normalizeRemoteDefinition helper and tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- status: show latest active revision info (name, ARN, revision, image, resources)
- run: submit a job via SubmitJob with --job-queue, --parameter, --wait support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename skipPascalKeys to skipConvertKeys and use case-insensitive
  lookup so init correctly preserves user-defined tag/parameter keys
  from PascalCase AWS responses
- Replace unreliable JSON string comparison in register skip logic
  with reflect.DeepEqual
- Add TestWalkMap_ToCamelCase_SkipConvertKeys test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Local validation without AWS calls, useful for CI:
- Template rendering and structure validation
- Required fields (jobDefinitionName, type, image, VCPU/MEMORY)
- Fargate constraints (executionRoleArn, valid vCPU/memory combos)
- Environment variable name validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kyosu-1 kyosu-1 merged commit a58c134 into main Feb 11, 2026
2 checks passed
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.

1 participant