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 xtdb-cli tool to Octopoes #2733

Merged
merged 7 commits into from
Mar 29, 2024
Merged

Add xtdb-cli tool to Octopoes #2733

merged 7 commits into from
Mar 29, 2024

Conversation

originalsouth
Copy link
Contributor

@originalsouth originalsouth commented Mar 27, 2024

Changes

Last time at @zcrt some malfunctioning Boefje was producing bogus objects in xtdb breaking the serialization. This tool would have been very handy then; @underdarknl was surprised it did not exist already so hereby it exists.

I probably have some bugs here and there but the basic script should work, feel free to contribute.

Issue link

None

Demo

% octopoes/tools/xtdb-cli.py submit-tx '[["put", {"xt/id": "ivan", "name": "Ivan", "last-name": "Petrov"}]]'
{"tx-ops": [["put", {"xt/id": "ivan", "name": "Ivan", "last-name": "Petrov"}]]}
{"txId":198,"txTime":"2024-03-27T15:21:56Z"}

% octopoes/tools/xtdb-cli.py entity ivan
{"last-name":"Petrov","name":"Ivan","xt/id":"ivan"}

Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue; tickets have been created for newly discovered issues.
  • I have written unit tests for the changes or fixes I made.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have performed a self-review of my code and refactored it to the best of my abilities.

Communication

  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have made corresponding changes to the documentation, if necessary.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

ammar92
ammar92 previously approved these changes Mar 28, 2024
Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Nice stuff 👍 Actually there were some snippets of code used by me and @Lisser for mainly deletion of objects, but it has never been versioned or documented.

I do have some suggestions for improvements, mainly in the usage of httpx, type hinting and possibly better cli experience using click. My suggestion is to merge this tool, as it already provides value and works effectively. I could then (or together) come up with an improvement PR later on.

@underdarknl
Copy link
Contributor

@ammar92 could you add those snippets as cli tools in the octopoes folder?

@originalsouth originalsouth marked this pull request as draft March 28, 2024 10:51
@originalsouth originalsouth marked this pull request as ready for review March 28, 2024 11:26
@originalsouth originalsouth removed their assignment Mar 29, 2024
@ammar92 ammar92 merged commit 0f7c842 into main Mar 29, 2024
20 checks passed
@ammar92 ammar92 deleted the xtdb-cli branch March 29, 2024 13:11
jpbruinsslot added a commit that referenced this pull request Apr 4, 2024
* main: (51 commits)
  Fix static files for container images/Debian packages when DEBUG is on (#2742)
  OOI selection at Aggregate report does not remember changed selection (#2619)
  fix schema errors on empty / missing schemas (#2744)
  Updated `phonenumbers` and `django-phonenumber-field` (#2757)
  Remove octopoes coverage workflow (#2755)
  Bump actions/configure-pages from 4 to 5 (#2745)
  Add xtdb-cli tool to Octopoes (#2733)
  Dont report vulnerabilities without version info of the software for snyk (#2730)
  Feature/boefjes to oci images (#2709)
  Query non-reference fields and subclass-specific fields through path queries (#2662)
  Fix in System Specific (#2732)
  Plugins overview in appendix not showing any plugins (#2694)
  Feat stepper design v2 (#2704)
  Undo project-directory in Rocky (#2734)
  Remove Docker Compose: "version" (#2718)
  Upgrade `pre-commit` hooks (#2729)
  Fix #1739 (#2705)
  Improve generate report (#2633)
  Fix critical vulnerability counter (#2712)
  Fix pdf alignment (#2674)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants