manticoresoftware / manticoresearch-buddy

Manticore Buddy is a Manticore Search's sidecar which helps it with various tasks
GNU General Public License v3.0
20 stars 2 forks source link

Improve table formatter approach #369

Open donhardman opened 1 month ago

donhardman commented 1 month ago

Bug Description:

The table version of view for SHOW VERSION query gives us JSON

curl http://localhost:9308/cli?show%20version
[
  {
    "total": 5,
    "error": "",
    "warning": "",
    "columns": [
      {
        "Component": {
          "type": "string"
        }
      },
      {
        "Version": {
          "type": "string"
        }
      }
    ],
    "data": [
      {
        "Component": "Daemon",
        "Version": "6.3.3 f92db4ac1@24070715 dev"
      },
      {
        "Component": "Columnar",
        "Version": "columnar 2.3.1 42f2b06@24070110"
      },
      {
        "Component": "Secondary",
        "Version": "secondary 2.3.1 42f2b06@24070110"
      },
      {
        "Component": "KNN",
        "Version": "knn 2.3.1 42f2b06@24070110"
      },
      {
        "Component": "Buddy",
        "Version": "buddy v2.3.13"
      }
    ]
  }
]

Due to the underlying architecture we use in Buddy tableFormatter, we should consider rethinking our approach and possibly refactor it in a way that allows table representation for each command to be added automatically.

Manticore Search Version:

Latest dev version

Operating System Version:

Ubuntu Jammy

Have you tried the latest development version?

None

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

- [ ] Implementation completed - [ ] Tests developed - [ ] Documentation updated - [ ] Documentation reviewed - [ ] Changelog updated
sanikolaev commented 1 month ago

Once done let's add CLT tests for these combinations:

donhardman commented 4 weeks ago

Implementation finished, but waiting for https://github.com/manticoresoftware/manticoresearch/issues/2680 to be resolved before we can test it in the easiest way possible.

donhardman commented 3 weeks ago

@Nick-S-2018 I have no idea, but after refactoring, something happened to Elastic-like queries. I tried to fix what I could, but I'm afraid I need help to take a look at this logic:

1) InsertQueryTest::testHTTPElasticInsertQueryOk

/workdir/test/Buddy/functional/InsertQueryTest.php:69

If you need to assist with the new way of forming the response, reach me on Slack. The problem is that the test can't find "_id" in the response, which is weird.

@PavelShilin89, please proceed with the tests in this branch: https://github.com/manticoresoftware/manticoresearch/pull/2701. Let me know if you need any further information or assistance.

donhardman commented 3 weeks ago

I found and fixed the issue on my own, so we can proceed with tests

PavelShilin89 commented 2 days ago

@donhardman Testing performed in PR - https://github.com/manticoresoftware/manticoresearch/pull/2701 Requires test review and merge approval.