Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QT-555] Fix panic when passing an invalid scenario filter #89

Merged
merged 1 commit into from
May 5, 2023

Conversation

ryancragun
Copy link
Collaborator

Fix a panic when we tried to execute scenario sub-commands against a scenario that has no variants but we've included invalid matrix filters.

Checklist

  • The commit message includes an explanation of the changes
  • Manual validation of the changes have been performed (if possible)
  • New or modified code has requisite test coverage (if possible)
  • I have performed a self-review of the changes
  • I have made necessary changes and/or pull requests for documentation
  • I have written useful comments in the code

Fix a panic when we tried to execute scenario sub-commands against a
scenario that has no variants but we've included invalid matrix filters.

Signed-off-by: Ryan Cragun <me@ryan.ec>
@ryancragun ryancragun requested a review from a team as a code owner May 5, 2023 18:06
@ryancragun ryancragun added the changelog/bug Fix for something that wasn't working. Will be included in "Bug Fixes" category in release notes. label May 5, 2023
@@ -99,11 +99,6 @@ func (e Element) Equal(other Element) bool {
return true
}

// NewElementFromProto creates a new Element from a proto filter element
func NewElementFromProto(p *pb.Scenario_Filter_Element) Element {
Copy link
Contributor

Choose a reason for hiding this comment

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

was this just unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah

@@ -10,7 +10,7 @@ import (

// Test_ScenarioFilter_WithScenarioFilterFromScenarioRef tests filtering a
// scenario that was created from a scenario reference.
func Test_ScenarioFilter_WithScenarioFilterFromScenarioRe(t *testing.T) {
func Test_ScenarioFilter_WithScenarioFilterFromScenarioRef(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

😆

@ryancragun ryancragun merged commit 4e38fc0 into main May 5, 2023
@ryancragun ryancragun deleted the qt-555 branch May 5, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/bug Fix for something that wasn't working. Will be included in "Bug Fixes" category in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants