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

Add all/none root queries #1471

Merged
merged 1 commit into from
Sep 6, 2019
Merged

Add all/none root queries #1471

merged 1 commit into from
Sep 6, 2019

Conversation

lukebjerring
Copy link
Contributor

Fixes #1467

Description

Adds root query options for all and none (instead of the default, exists).

Strangely, count and seq get wrapped in exists. I started to tweak that behaviour, but decided against busying up the PR. Will clean that up another time.

}
}
{
var a AbstractAll
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All / None re-used a/n, and the variables persisting makes for copy-pasta bugs, so I've scoped all the attempts. This (AbstractAll) and AbstractNone are added.

Copy link
Member

Choose a reason for hiding this comment

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

Great, thanks for explaining!


`none` query objects perform a disjunction of all of the runs, in order to ensure
that no single run satisfies all of its queries. `none` queries are a simplification for
`{"not": {"exists": [...] }}` queries.
Copy link
Member

Choose a reason for hiding this comment

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

Ah, makes sense!

for _, run := range runs {
bound := arg.BindToRuns(run)
if _, ok := bound.(True); !ok { // And with True is pointless.
byRun = append(byRun, bound)
Copy link
Member

Choose a reason for hiding this comment

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

What kind of query hits this condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a simplification behaviour when binding to runs (e.g. an empty OR becomes false) which this accounts for.

}
}
{
var a AbstractAll
Copy link
Member

Choose a reason for hiding this comment

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

Great, thanks for explaining!

@@ -230,6 +230,26 @@
});
});

test('all', () => {
assertQueryParse('all(status:!PASS status:!OK)', {
Copy link
Member

Choose a reason for hiding this comment

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

Good example, I'd like to search for this :)

@lukebjerring
Copy link
Contributor Author

Force-merging to ignore Travis timeouts.

@lukebjerring lukebjerring merged commit 69365c5 into master Sep 6, 2019
@lukebjerring lukebjerring deleted the all-or-none branch September 6, 2019 18:54
foolip added a commit that referenced this pull request May 8, 2024
These noticed have been there since 2019:

#1445
#1463
#1471
#1498

They've been stable since then, so not beta.
past pushed a commit that referenced this pull request May 30, 2024
These noticed have been there since 2019:

#1445
#1463
#1471
#1498

They've been stable since then, so not beta.
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.

More aliases for the count atom
3 participants