feat(issue-labeler): set native issue type and language field on issues#72
Open
yonib05 wants to merge 10 commits into
Open
feat(issue-labeler): set native issue type and language field on issues#72yonib05 wants to merge 10 commits into
yonib05 wants to merge 10 commits into
Conversation
…dry-run preview, reuse helper Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wrap the additive native-targets block in main() so any failure (missing gh, malformed field config, API or permission error) is downgraded to a warning instead of failing the workflow. Labels are already applied at that point, so the run stays green and we can troubleshoot type/field writes separately.
This was referenced Jun 26, 2026
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.
What
Extends the
issue-labeleraction so that, for issues only, it also sets the org's native issue Type and the Language issue field, mapped from the labels it already classifies. This is purely additive: the existing label classification and application are unchanged.These features do not apply to pull requests, so the new behavior self-gates on
github.event_name == 'issues'.How
type:(maps to a native issue type), and a config may declare a top-levelfield:block with per-labeloption:keys (maps to a single-select issue field). Existing string/descriptionconfig forms keep working untouched.Bug,Language,Python) are resolved to GraphQL node IDs via a repo-level query, matched case-insensitively. No org IDs are hardcoded.updateIssueIssueTypeandsetIssueFieldValue. Existing values are overwritten.gh, malformed field config, API/permission error) is downgraded to a::warning::and the workflow stays green. Labels are applied before this block runs.backfill.pyapplies the same logic to existing issues (all states), reusing existing labels where present and only calling the LLM for issues missing one. Supports--dry-run.Security model
Unchanged. The LLM still has no tools and its output is constrained to the enum allowlist. The new code acts only on those allowlisted labels routed through static, operator-authored config; it never receives free-form LLM text. Worst case remains mislabeling.
Testing
pytest test_classify.py test_backfill.py), covering config parsing, ID indexing, label→target mapping, event gating, the non-fatal guard, and the backfill decision logic. GitHub I/O is mocked.GITHUB_TOKEN(issues: write) can perform the type/field mutations. The non-fatal guard means a permission gap surfaces as a warning, not a failed run. Will confirm against a live issue and add a PAT fallback if needed.Follow-up
Consuming-repo config changes (
harness-sdk,evals: adddesign/bloglabels, addtype:/field:mappings) ship as separate PRs once this merges.