Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 26, 2025

Problem

The CLI group create command was not enforcing all required fields at the command line level, allowing users to create event receiver groups without providing mandatory parameters. This could lead to confusing error messages from the backend validation rather than clear upfront validation.

According to the issue requirements, all Event Receiver Groups must have these required fields:

  • name: String!
  • type: String!
  • version: String!
  • description: String!
  • enabled: Boolean!
  • event_receiver_ids: [ID!]!

Changes

Updated cli/cmd/group/create.go to mark version and enabled flags as required, matching the backend validation requirements.

Before:

$ epr-cli group create --name "test" --type "test.type" --description "test desc" --event-receiver-ids "id1"
# Would attempt to send request to backend and fail with backend validation error

After:

$ epr-cli group create --name "test" --type "test.type" --description "test desc" --event-receiver-ids "id1"
Error: required flag(s) "enabled", "version" not set

Testing

  • ✅ CLI now properly validates all required fields are provided
  • ✅ Works correctly with both --enabled=true and --enabled=false
  • ✅ All existing tests continue to pass
  • ✅ Backend validation remains unchanged and functional

The fix ensures users get immediate, clear feedback about missing required parameters rather than cryptic backend errors.

Original prompt

This section details on the original issue you should resolve

<issue_title>CLI is able to create a event receiver group without a type</issue_title>
<issue_description>Need to make sure we are requiring all appropriate fields for create mutations in graphql

Require the following fields for event group receivers:

name: String!
type: String!
version: String!
description: String!
enabled: Boolean!
event_receiver_ids: [ID!]!

https://github.com/sassoftware/event-provenance-registry/blob/main/cli/cmd/group/create.go </issue_description>

<agent_instructions>Update the create command for groups to require all specified fields for an Event Receiver Group</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #96

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] CLI is able to create a event receiver group without a type Fix CLI group create command to require all mandatory fields Sep 26, 2025
@Copilot Copilot AI requested a review from xbcsmith September 26, 2025 20:44
Copilot finished work on behalf of xbcsmith September 26, 2025 20:44
@xbcsmith xbcsmith self-requested a review September 26, 2025 21:33
Removed the requirement for the 'enabled' flag in the create command.
@xbcsmith xbcsmith marked this pull request as ready for review October 4, 2025 12:19
Copy link
Member

@gbuskey gbuskey left a comment

Choose a reason for hiding this comment

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

insane PR description for a one line change

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.

CLI is able to create a event receiver group without a type

3 participants