Create the my-idea label on demand in file_idea() - #8
Merged
Conversation
Filing the first idea against a fresh repo crashed: create_issue() succeeded but add_labels() raised GitHubError because the "my-idea" label didn't exist yet, leaving an unlabeled issue and a traceback. file_idea() now catches that, creates the label (idempotent via --force) with a description/color, and retries the label add once. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
lorenzoliuzzo
marked this pull request as ready for review
July 9, 2026 15:22
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
file_idea()calledgithub.add_labels(...)unconditionally aftercreate_issue(...). Filing the very first idea against a fresh target repo (nomy-idealabel defined yet) crashed withGitHubError: 'my-idea' not found, leaving an unlabeled issue and no clean error.file_idea()now catchesGitHubErrorfromadd_labels, creates themy-idealabel (idempotent viagh label create --force, with a description/color) scoped to the target repo, and retries the label add once.mythings.githubplumbing), per the fleet convention of tool-specific labels living in the tool.Test plan
pytest -q(8 passed, including newtest_file_idea_creates_missing_label_and_retries)GITHUB_ACTIONS=true pytest -qruff check .