• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KusionStack / karpor / 10989014698
64%

Build:
DEFAULT BRANCH: main
Ran 23 Sep 2024 06:44AM UTC
Jobs 1
Files 41
Run time 7min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Sep 2024 06:44AM UTC coverage: 74.136%. Remained the same
10989014698

push

github

web-flow
feat: add custom-columns capability in rest-api/v1/search (#618)

## What type of PR is this?

/kind feature

## What this PR does / why we need it:

The current search interface returns the full data stored in
Elasticsearch to the front-end. The front-end needs to perform an
operation to extract certain fields from the complete object and display
them to the user.

This PR moves the field extraction operation to the back-end, similar to
`kubectl get -o 'custom-columns=<spec>`. This will parameterize the data
returned by the back-end, simplify the integration workload for
third-party front-ends, and reduce the amount of data transmitted to the
front-end.

For example:

`curl -k
'https://127.0.0.1:7443/rest-api/v1/search?query=select+*+from+resources+where+kind+%3D+%27Pod%27+and+name+%3D+%27karpor-syncer-6dfddf556-djn9c%27&pattern=sql&page=1&pageSize=20&format=custom-columns%3DNAME%3Ametadata.name%2CAPI_VERSION%3AapiVersion'`

Output:

```json
{
  "success": true,
  "message": "OK",
  "data": {
    "items": [
      {
        "cluster": "kind",
        "object": {
          "fields": {
            "API_VERSION": "v1",
            "NAME": "karpor-syncer-6dfddf556-djn9c"
          },
          "titles": ["NAME", "API_VERSION"]
        }
      }
    ],
    "total": 1,
    "currentPage": 1,
    "pageSize": 20
  },
  "traceID": "karpor-server-db4c78b4b-6h628/mBPrQuHocQ-000034",
  "startTime": "2024-09-19T09:43:37.033057526Z",
  "endTime": "2024-09-19T09:43:37.618264576Z",
  "costTime": "585.20705ms"
}
```

## Which issue(s) this PR fixes:

<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related
issues/tests in a comment and do not use `Fixes`_*
-->

Fixes #

2 of 3 new or added lines in 2 files covered. (66.67%)

3388 of 4570 relevant lines covered (74.14%)

0.81 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10989014698.1 23 Sep 2024 06:44AM UTC 0
74.14
GitHub Action Run
Source Files on build 10989014698
Detailed source file information is not available for this build.
  • Back to Repo
  • 0fbeb9c3 on github
  • Prev Build on main (#10988814224)
  • Next Build on main (#11025984652)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc