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

Query improvements #45

Merged
merged 19 commits into from
Jul 8, 2019
Merged

Query improvements #45

merged 19 commits into from
Jul 8, 2019

Conversation

johan-bjareholt
Copy link
Member

@johan-bjareholt johan-bjareholt commented May 12, 2019

Additions:

  • Boolean support
  • Basic if/elif/else support
  • == support
  • Added concat function
  • Added contains function
  • Better error messages (line numbers during lexing, but not parsing)
  • Event and Bucket models now use serde_json Map instead of Value as it should
  • Coverage in travis with codecov.io

Issues:

  • Since this is the first PR with coverage we will miss coverage report for the base branch so that will always fail

Fixes #44
Fixes #39

@johan-bjareholt johan-bjareholt force-pushed the dev/query-if-support branch 12 times, most recently from 6fdcd5e to 521da1f Compare May 19, 2019 12:16
@codecov-io
Copy link

codecov-io commented May 19, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@3046fa4). Click here to learn what that means.
The diff coverage is 85.59%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #45   +/-   ##
=========================================
  Coverage          ?   83.25%           
=========================================
  Files             ?       25           
  Lines             ?     2699           
  Branches          ?        0           
=========================================
  Hits              ?     2247           
  Misses            ?      452           
  Partials          ?        0
Impacted Files Coverage Δ
src/main.rs 0% <0%> (ø)
tests/query.rs 88.74% <82.39%> (ø)
src/query/mod.rs 82.71% <83.7%> (ø)
src/query/functions.rs 92.24% <97.1%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3046fa4...26880d2. Read the comment docs.

@ErikBjare
Copy link
Member

Kinda lame that it needs to have sudo: required and custom apt installs, but oh well.

Weird that the Windows build times out, could be due to sudo: required?

@johan-bjareholt
Copy link
Member Author

The windows timeout could be because of this, I added a secret env variable in the travis project settings for codecov.io
https://travis-ci.community/t/windows-ci-not-starting/2057/5

@ErikBjare
Copy link
Member

@johan-bjareholt You should be able to put the secret env variable in the environment field for the specific build (in the Travis config, not in the Travis UI). That way it wouldn't be used in the Windows build in the first place (although it would obviously be preferred if they just fixed the issue upstream).

@johan-bjareholt
Copy link
Member Author

Just realized that you only needed the codecov.io token on private repositories so I removed it. We'll see if it works now...

@johan-bjareholt
Copy link
Member Author

@ErikBjare Works now, please review

@ErikBjare
Copy link
Member

ErikBjare commented May 22, 2019

Can I see a more complex query example using the new features (if/elif/else, ==)? I assume the if/elif/else syntax you've gone for would make query2 no longer a subset of Python syntax?

Does this mean a further departure from the query2 in aw-server-python? If so, that should be documented somehow (or the new features at least clearly marked unstable).

@johan-bjareholt
Copy link
Member Author

Can I see a more complex query example using the new features (if/elif/else, ==)?

The tests has lots of examples on all of that with multiple variations.

I assume the if/elif/else syntax you've gone for would make query2 no longer a subset of Python syntax?

It has never really been a subset of python, it's just that the syntax has been so simple that it might look like python but it could've just as well have been javascript or some other scripting language which uses normal +-/*% operators, = for assigning variables without a type declaration, calls funtions with parentheses and supports lists and hashmaps with {} and [].

The reason for using {} instead of : and space indentation like in python is because that space indentation would be pretty annoying to parse and space indentation doesn't have any technical advantages.

Does this mean a further departure from the query2 in aw-server-python? If so, that should be documented somehow (or the new features at least clearly marked unstable).

We're still backwards compatible. The day query2 in aw-server-python is dropped we can start using the new query features in the web-ui but for now we shouldn't.

@johan-bjareholt
Copy link
Member Author

@ErikBjare Can I merge this?

@johan-bjareholt
Copy link
Member Author

@ErikBjare Pls review

Copy link
Member

@ErikBjare ErikBjare left a comment

Choose a reason for hiding this comment

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

I haven't looked at it carefully but looks good to me.

@johan-bjareholt johan-bjareholt merged commit d05f572 into master Jul 8, 2019
@johan-bjareholt johan-bjareholt deleted the dev/query-if-support branch July 8, 2019 06:54
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.

query: Implement concat function Code coverage in CI
3 participants