feat: Make Advent of Code year configurable with validation#4
Merged
PaytonWebber merged 1 commit intomainfrom Nov 14, 2025
Merged
Conversation
This change adds support for configuring the Advent of Code year via the AOC_YEAR environment variable, making the bot more flexible and future-proof. Key improvements: - Added AOC_YEAR config field that defaults to the current year - Replaced hardcoded year (2024) in API URL with configurable year parameter - Added comprehensive config validation with descriptive error messages - Updated all test cases to work with the new year parameter - Enhanced documentation in README to explain the new optional setting The year validation ensures it's 2015 or later (when Advent of Code started) and defaults to the current year if not specified or invalid. This improvement resolves ENG-26 by making a valuable enhancement that improves maintainability and user experience. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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
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.
Summary
This PR adds support for configuring the Advent of Code year via the
AOC_YEARenvironment variable, making the bot more flexible and future-proof.Changes Made
AOCYearfield to theConfigstruct with smart defaulting to the current yearaoc.Clientto accept a year parameter, replacing the hardcoded "2024" in the API URLValidate()method for theConfigstruct that checks:AOC_YEARis not setAOC_YEARsettingBenefits
Technical Details
Testing
All tests pass in CI/CD (GitHub Actions will verify on merge).
Resolves
Closes ENG-26
🤖 Generated with Claude Code