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

cli-test(feat): Added datastore CLI commands #2041

Merged
merged 7 commits into from
Oct 1, 2024

Conversation

cchensh
Copy link
Contributor

@cchensh cchensh commented Sep 27, 2024

Summary

This PR adds basic datastore CLI commands for e2e test, it includes datastore get/put/query/delete

Requirements (place an x in each [ ])


export interface DatastoreCommandArguments {
/** @description datastore get <query> */
getQuery: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I'm using general string for datastore commands to make it easier than pre-define attributes such as datastore, item, and expression, etc

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this will make it easy to make mistakes. I think we should model these just like we model the actual methods:

Copy link
Contributor Author

@cchensh cchensh Sep 27, 2024

Choose a reason for hiding this comment

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

It makes sense, I'd say for get method, id is not a must as it's defined in the manifest as primary key. I'd like to change by adding the datastore as the new argument here.

Edit: my bad the id is always presented for get and delete command.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.74%. Comparing base (0861218) to head (2562383).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2041      +/-   ##
==========================================
- Coverage   92.51%   91.74%   -0.77%     
==========================================
  Files          37       38       +1     
  Lines        9981    10081     +100     
  Branches      631      631              
==========================================
+ Hits         9234     9249      +15     
- Misses        747      820      +73     
- Partials        0       12      +12     
Flag Coverage Δ
cli-hooks 95.23% <ø> (ø)
cli-test 95.69% <100.00%> (-0.32%) ⬇️
oauth 77.39% <ø> (-4.13%) ⬇️
socket-mode 58.22% <ø> (-0.86%) ⬇️
web-api 96.89% <ø> (-0.40%) ⬇️
webhook 96.65% <ø> (-0.42%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

I think we should model the API arguments as they are documented on our public docs 😞 sorry, I know that's annoying, but if we accept these JSON-payloads-as-strings, it would require a breaking change / major new version to change it to make it more accurate. I think the chance of making a typo with the string-based arguments is too high.


export interface DatastoreCommandArguments {
/** @description datastore get <query> */
getQuery: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this will make it easy to make mistakes. I think we should model these just like we model the actual methods:

@cchensh cchensh requested a review from filmaj September 27, 2024 20:13
@cchensh cchensh merged commit d8d4406 into main Oct 1, 2024
29 of 30 checks passed
@cchensh cchensh deleted the cchen-add-datastore-command branch October 1, 2024 16:28
@filmaj filmaj added this to the [email protected] milestone Oct 2, 2024
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.

2 participants