WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@cblecker
Copy link

Summary

Adds a Go-based validation tool for candidate bio files, adapted from the Kubernetes community verify-steering-election-tool.go.

This PR includes:

  • Validation tool (scripts/validate-bios/): Standalone Go utility to validate candidate bios against Elekto format
  • Comprehensive tests: Full test coverage with 7 test suites
  • GitHub Actions integration: Automated CI testing for the Go code
  • Documentation: Complete README with usage examples and installation instructions

Key Features

  • ✅ Validates YAML frontmatter format (61-dash delimiter start, --- end)
  • ✅ Checks required fields (name, ID) and filename/ID matching
  • ✅ Validates election-specific info fields from election.yaml
  • ✅ Optional word count limits (configurable via flags)
  • ✅ Optional required markdown sections (configurable via flags)
  • ✅ Can be run directly from GitHub: go run github.com/elekto-io/elekto/scripts/validate-bios@latest <election-path>

Files Added

  • .github/workflows/go-test.yml - GitHub Actions workflow for automated testing
  • scripts/validate-bios/main.go - Main validation logic
  • scripts/validate-bios/main_test.go - Comprehensive test suite
  • scripts/validate-bios/go.mod - Go module definition
  • scripts/validate-bios/go.sum - Dependency checksums
  • scripts/validate-bios/README.md - Complete documentation

Test Plan

  • All tests pass locally (go test -v ./...)
  • GitHub Actions workflow validates correctly
  • Tool can be run with go run github.com/elekto-io/elekto/scripts/validate-bios@latest
  • Documentation is complete and accurate

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

Adds a Go-based validator for Elekto candidate bio files, adapted from
the Kubernetes community's verify-steering-election-tool.go.

Features:
- YAML frontmatter validation (name, ID, election-specific fields)
- Filename/ID matching enforcement
- Configurable word limits and required markdown sections
- Comprehensive test suite with 100% passing tests
- GitHub Actions workflow for automated CI testing

The tool can be run directly from GitHub or built locally, making it
easy for election administrators to validate candidate submissions.

Co-Authored-By: Claude <[email protected]>
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