Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add missing enum constraints#278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SamMorrowDrums merged 4 commits intomainfromtonytrg/add-constraints
Apr 15, 2025
Merged

Conversation

tonytrg
Copy link
Contributor

@tonytrgtonytrg commentedApr 15, 2025
edited
Loading

This pr adds some missing enum constraints for string props with enum like categories.
It also removes those listed enums from the descriptions, as the llm already receives the list of possible candidates by the the enum constraint.

This will save tokens as noted by@SamMorrowDrums

In regard to#228

Example testing with Copilot(Model Claude 3.7 Sonnet):

Please list me all code scanning alerts from:owner tonytrgrepo adventofcodeseverity ultraGitHub CopilotI need to help you retrieve code scanning alerts from the GitHub repository, but I notice that you've specified a severity level of "ultra" which isn't a standard severity level for GitHub code scanning alerts.GitHub's code scanning alerts use these severity levels: critical, high, medium, low, warning, note, and error. The value "ultra" isn't one of the supported severity options.Would you like me to list the alerts with a different severity level? For example, would you prefer "critical" (highest severity), "high", or another valid severity level?

SamMorrowDrums reacted with heart emoji
@CopilotCopilotAI review requested due to automatic review settingsApril 15, 2025 09:07
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR adds missing enum constraints for various string properties to ensure only the allowed values are accepted.

  • Enforced enum constraints for pull request state, sort options, merge methods, and review event types in pkg/github/pullrequests.go.
  • Added enum constraints for code scanning alert states and severity levels in pkg/github/code_scanning.go.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
pkg/github/pullrequests.goAdded enum constraints for pull request query and review parameters.
pkg/github/code_scanning.goAdded enum constraints for code scanning alerts parameters.

@tonytrgtonytrgforce-pushed thetonytrg/add-constraints branch from2928235 toa92e445CompareApril 15, 2025 14:37
@tonytrgtonytrgforce-pushed thetonytrg/add-constraints branch fromf810b65 to5a7d13cCompareApril 15, 2025 14:41
SamMorrowDrums
SamMorrowDrums previously approved these changesApr 15, 2025
Copy link
Collaborator

@SamMorrowDrumsSamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Added one minor suggestion (the word category doesn't add much I think) but it's a nit, and this looks great. Thanks for all your work on finding all these!

tonytrg reacted with thumbs up emoji
@SamMorrowDrumsSamMorrowDrums merged commit4457d0a intomainApr 15, 2025
13 of 15 checks passed
@SamMorrowDrumsSamMorrowDrums deleted the tonytrg/add-constraints branchApril 15, 2025 15:01
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@SamMorrowDrumsSamMorrowDrumsSamMorrowDrums left review comments

@juruenjuruenAwaiting requested review from juruen

@williammartinwilliammartinAwaiting requested review from williammartin

@tobytobyAwaiting requested review from toby

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@tonytrg@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp