Skip to content

Create the my-idea label on demand in file_idea() - #8

Merged
lorenzoliuzzo merged 1 commit into
mainfrom
fix/file-idea-missing-label
Jul 9, 2026
Merged

Create the my-idea label on demand in file_idea()#8
lorenzoliuzzo merged 1 commit into
mainfrom
fix/file-idea-missing-label

Conversation

@lorenzoliuzzo

Copy link
Copy Markdown
Contributor

Summary

  • file_idea() called github.add_labels(...) unconditionally after create_issue(...). Filing the very first idea against a fresh target repo (no my-idea label defined yet) crashed with GitHubError: 'my-idea' not found, leaving an unlabeled issue and no clean error.
  • file_idea() now catches GitHubError from add_labels, creates the my-idea label (idempotent via gh label create --force, with a description/color) scoped to the target repo, and retries the label add once.
  • Kept the label name/description/color as this tool's concern (not generic mythings.github plumbing), per the fleet convention of tool-specific labels living in the tool.

Test plan

  • pytest -q (8 passed, including new test_file_idea_creates_missing_label_and_retries)
  • GITHUB_ACTIONS=true pytest -q
  • ruff check .

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
lorenzoliuzzo marked this pull request as ready for review July 9, 2026 15:22
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lorenzoliuzzo
lorenzoliuzzo merged commit f0fd534 into main Jul 9, 2026
3 checks passed
@lorenzoliuzzo
lorenzoliuzzo deleted the fix/file-idea-missing-label branch July 9, 2026 15:52
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